summaryrefslogtreecommitdiffstats
path: root/roles/common/tasks
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2016-05-18 00:10:50 +0200
committerGuilhem Moulin <guilhem@fripost.org>2016-05-18 00:47:05 +0200
commit71aefcc229f999f92b25e51b9444b313d95fbc86 (patch)
tree0cfda622ac987e35543361dcc478dfe6b5b3fa08 /roles/common/tasks
parentf4c280d1c6f43f7ca0c1e498ab87fe7aa08d5eb2 (diff)
Add an ansible module 'fetch_cmd' to fetch the output of a remote command locally.
And use this to fetch all X.509 leaf certificates.
Diffstat (limited to 'roles/common/tasks')
-rw-r--r--roles/common/tasks/bacula.yml7
-rw-r--r--roles/common/tasks/mail.yml7
-rw-r--r--roles/common/tasks/munin-node-ssl.yml7
3 files changed, 9 insertions, 12 deletions
diff --git a/roles/common/tasks/bacula.yml b/roles/common/tasks/bacula.yml
index f0919e4..1bd2b77 100644
--- a/roles/common/tasks/bacula.yml
+++ b/roles/common/tasks/bacula.yml
@@ -21,10 +21,9 @@
- name: Fetch Bacula FD X.509 certificate
# Ensure we don't fetch private data
become: False
- fetch: src=/etc/stunnel/certs/{{ inventory_hostname_short }}-fd.pem
- dest=certs/bacula/
- fail_on_missing=yes
- flat=yes
+ fetch_cmd: cmd="openssl x509"
+ stdin=/etc/stunnel/certs/{{ inventory_hostname_short }}-fd.pem
+ dest=certs/bacula/{{ inventory_hostname_short }}-fd.pem
tags:
- genkey
diff --git a/roles/common/tasks/mail.yml b/roles/common/tasks/mail.yml
index cd3020b..1533893 100644
--- a/roles/common/tasks/mail.yml
+++ b/roles/common/tasks/mail.yml
@@ -69,10 +69,9 @@
- name: Fetch Postfix's X.509 certificate
# Ensure we don't fetch private data
become: False
- fetch: src=/etc/postfix/ssl/{{ ansible_fqdn }}.pem
- dest=certs/postfix/
- fail_on_missing=yes
- flat=yes
+ fetch_cmd: cmd="openssl x509"
+ stdin=/etc/postfix/ssl/{{ ansible_fqdn }}.pem
+ dest=certs/postfix/{{ ansible_fqdn }}.pem
tags:
- genkey
diff --git a/roles/common/tasks/munin-node-ssl.yml b/roles/common/tasks/munin-node-ssl.yml
index 59ed7d7..e0b1d8c 100644
--- a/roles/common/tasks/munin-node-ssl.yml
+++ b/roles/common/tasks/munin-node-ssl.yml
@@ -21,10 +21,9 @@
- name: Fetch Munin X.509 certificate
# Ensure we don't fetch private data
become: False
- fetch: src=/etc/stunnel/certs/munin-{{ inventory_hostname_short }}.pem
- dest=certs/munin/{{ inventory_hostname }}.pem
- fail_on_missing=yes
- flat=yes
+ fetch_cmd: cmd="openssl x509"
+ stdin=/etc/stunnel/certs/munin-{{ inventory_hostname_short }}.pem
+ dest=certs/munin/{{ inventory_hostname }}.pem
tags:
- genkey