diff options
author | Ismaël Bouya <ismael.bouya@fretlink.com> | 2018-11-02 17:03:49 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@fretlink.com> | 2018-11-02 17:03:49 +0100 |
commit | 397c4fed757d201af627636822981e85e84ea572 (patch) | |
tree | d6733d4022bf04784be84581f6c16e96a1b229e8 /roles/gnupg | |
download | Ansible-397c4fed757d201af627636822981e85e84ea572.tar.gz Ansible-397c4fed757d201af627636822981e85e84ea572.tar.zst Ansible-397c4fed757d201af627636822981e85e84ea572.zip |
Validation initiale
Diffstat (limited to 'roles/gnupg')
-rw-r--r-- | roles/gnupg/files/gnupg/gpg-agent.conf | 4 | ||||
-rw-r--r-- | roles/gnupg/files/gnupg/gpg.conf | 7 | ||||
-rw-r--r-- | roles/gnupg/tasks/main.yml | 34 | ||||
-rw-r--r-- | roles/gnupg/templates/systemd/dirmngr.conf.j2 | 3 | ||||
-rw-r--r-- | roles/gnupg/templates/systemd/gpg-agent-browser.conf.j2 | 3 | ||||
-rw-r--r-- | roles/gnupg/templates/systemd/gpg-agent-extra.conf.j2 | 3 | ||||
-rw-r--r-- | roles/gnupg/templates/systemd/gpg-agent-ssh.conf.j2 | 3 | ||||
-rw-r--r-- | roles/gnupg/templates/systemd/gpg-agent.conf.j2 | 3 |
8 files changed, 60 insertions, 0 deletions
diff --git a/roles/gnupg/files/gnupg/gpg-agent.conf b/roles/gnupg/files/gnupg/gpg-agent.conf new file mode 100644 index 0000000..3c4e379 --- /dev/null +++ b/roles/gnupg/files/gnupg/gpg-agent.conf | |||
@@ -0,0 +1,4 @@ | |||
1 | pinentry-program /usr/bin/pinentry | ||
2 | allow-loopback-pinentry | ||
3 | enable-ssh-support | ||
4 | allow-preset-passphrase | ||
diff --git a/roles/gnupg/files/gnupg/gpg.conf b/roles/gnupg/files/gnupg/gpg.conf new file mode 100644 index 0000000..17bc522 --- /dev/null +++ b/roles/gnupg/files/gnupg/gpg.conf | |||
@@ -0,0 +1,7 @@ | |||
1 | # Main signing key | ||
2 | default-key DB1CFE90 | ||
3 | |||
4 | default-recipient-self | ||
5 | encrypt-to 0326A611 | ||
6 | auto-key-retrieve | ||
7 | no-greeting | ||
diff --git a/roles/gnupg/tasks/main.yml b/roles/gnupg/tasks/main.yml new file mode 100644 index 0000000..8adaf69 --- /dev/null +++ b/roles/gnupg/tasks/main.yml | |||
@@ -0,0 +1,34 @@ | |||
1 | --- | ||
2 | - name: Config files | ||
3 | synchronize: | ||
4 | recursive: yes | ||
5 | archive: no | ||
6 | checksum: yes | ||
7 | src: gnupg | ||
8 | dest: /$XDG_CONFIG_HOME/ | ||
9 | - name: Protect directory | ||
10 | file: | ||
11 | path: $XDG_CONFIG_HOME/gnupg | ||
12 | state: directory | ||
13 | mode: 0700 | ||
14 | - name: Get gnupg runtime folder name | ||
15 | shell: 'GNUPGHOME=$XDG_CONFIG_HOME/gnupg gpgconf --list-dirs socketdir | sed -e "s@$XDG_RUNTIME_DIR/gnupg/@@"' | ||
16 | register: gnupg_runtime_dir_cmd | ||
17 | - name: Add systemd overrides | ||
18 | template: | ||
19 | src: "systemd/{{ item }}.conf.j2" | ||
20 | dest: "$XDG_CONFIG_HOME/systemd/user/{{ item }}.socket.d/override.conf" | ||
21 | register: results | ||
22 | loop: | ||
23 | - dirmngr | ||
24 | - gpg-agent | ||
25 | - gpg-agent-browser | ||
26 | - gpg-agent-extra | ||
27 | - gpg-agent-ssh | ||
28 | - name: Restart systemd units | ||
29 | systemd: | ||
30 | daemon_reload: true | ||
31 | scope: user | ||
32 | state: restarted | ||
33 | name: "{{ item }}.socket" | ||
34 | loop: "{{ results.results|selectattr('changed')|map(attribute='item')|list }}" | ||
diff --git a/roles/gnupg/templates/systemd/dirmngr.conf.j2 b/roles/gnupg/templates/systemd/dirmngr.conf.j2 new file mode 100644 index 0000000..9083ab5 --- /dev/null +++ b/roles/gnupg/templates/systemd/dirmngr.conf.j2 | |||
@@ -0,0 +1,3 @@ | |||
1 | [Socket] | ||
2 | ListenStream= | ||
3 | ListenStream=%t/gnupg/{{ gnupg_runtime_dir_cmd.get('stdout', debug_gnupg_runtime_dir) }}/S.dirmngr | ||
diff --git a/roles/gnupg/templates/systemd/gpg-agent-browser.conf.j2 b/roles/gnupg/templates/systemd/gpg-agent-browser.conf.j2 new file mode 100644 index 0000000..61ddeb6 --- /dev/null +++ b/roles/gnupg/templates/systemd/gpg-agent-browser.conf.j2 | |||
@@ -0,0 +1,3 @@ | |||
1 | [Socket] | ||
2 | ListenStream= | ||
3 | ListenStream=%t/gnupg/{{ gnupg_runtime_dir_cmd.get('stdout', debug_gnupg_runtime_dir) }}/S.gpg-agent.browser | ||
diff --git a/roles/gnupg/templates/systemd/gpg-agent-extra.conf.j2 b/roles/gnupg/templates/systemd/gpg-agent-extra.conf.j2 new file mode 100644 index 0000000..f34606c --- /dev/null +++ b/roles/gnupg/templates/systemd/gpg-agent-extra.conf.j2 | |||
@@ -0,0 +1,3 @@ | |||
1 | [Socket] | ||
2 | ListenStream= | ||
3 | ListenStream=%t/gnupg/{{ gnupg_runtime_dir_cmd.get('stdout', debug_gnupg_runtime_dir) }}/S.gpg-agent.extra | ||
diff --git a/roles/gnupg/templates/systemd/gpg-agent-ssh.conf.j2 b/roles/gnupg/templates/systemd/gpg-agent-ssh.conf.j2 new file mode 100644 index 0000000..b7cd0c2 --- /dev/null +++ b/roles/gnupg/templates/systemd/gpg-agent-ssh.conf.j2 | |||
@@ -0,0 +1,3 @@ | |||
1 | [Socket] | ||
2 | ListenStream= | ||
3 | ListenStream=%t/gnupg/{{ gnupg_runtime_dir_cmd.get('stdout', debug_gnupg_runtime_dir) }}/S.gpg-agent.ssh | ||
diff --git a/roles/gnupg/templates/systemd/gpg-agent.conf.j2 b/roles/gnupg/templates/systemd/gpg-agent.conf.j2 new file mode 100644 index 0000000..666c22e --- /dev/null +++ b/roles/gnupg/templates/systemd/gpg-agent.conf.j2 | |||
@@ -0,0 +1,3 @@ | |||
1 | [Socket] | ||
2 | ListenStream= | ||
3 | ListenStream=%t/gnupg/{{ gnupg_runtime_dir_cmd.get('stdout', debug_gnupg_runtime_dir) }}/S.gpg-agent | ||