summaryrefslogtreecommitdiff
path: root/roles/gnupg
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@fretlink.com>2018-11-02 17:03:49 +0100
committerIsmaël Bouya <ismael.bouya@fretlink.com>2018-11-02 17:03:49 +0100
commit397c4fed757d201af627636822981e85e84ea572 (patch)
treed6733d4022bf04784be84581f6c16e96a1b229e8 /roles/gnupg
downloadAnsible-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.conf4
-rw-r--r--roles/gnupg/files/gnupg/gpg.conf7
-rw-r--r--roles/gnupg/tasks/main.yml34
-rw-r--r--roles/gnupg/templates/systemd/dirmngr.conf.j23
-rw-r--r--roles/gnupg/templates/systemd/gpg-agent-browser.conf.j23
-rw-r--r--roles/gnupg/templates/systemd/gpg-agent-extra.conf.j23
-rw-r--r--roles/gnupg/templates/systemd/gpg-agent-ssh.conf.j23
-rw-r--r--roles/gnupg/templates/systemd/gpg-agent.conf.j23
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 @@
1pinentry-program /usr/bin/pinentry
2allow-loopback-pinentry
3enable-ssh-support
4allow-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
2default-key DB1CFE90
3
4default-recipient-self
5encrypt-to 0326A611
6auto-key-retrieve
7no-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]
2ListenStream=
3ListenStream=%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]
2ListenStream=
3ListenStream=%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]
2ListenStream=
3ListenStream=%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]
2ListenStream=
3ListenStream=%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]
2ListenStream=
3ListenStream=%t/gnupg/{{ gnupg_runtime_dir_cmd.get('stdout', debug_gnupg_runtime_dir) }}/S.gpg-agent