summaryrefslogtreecommitdiffstats
path: root/roles/common/tasks
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2016-05-22 17:21:16 +0200
committerGuilhem Moulin <guilhem@fripost.org>2016-05-22 17:53:58 +0200
commit8cf4032ecec5b9f58d829e89f231179170432539 (patch)
tree24947cc32af42e98bca3ed0b6319c69c77321262 /roles/common/tasks
parentf7a5a19edc504980e2e8f93ab027162756710d59 (diff)
Tunnel bacula (dir → {fd,sd} and fd → sd) traffic through IPSec.
Diffstat (limited to 'roles/common/tasks')
-rw-r--r--roles/common/tasks/bacula.yml72
1 files changed, 0 insertions, 72 deletions
diff --git a/roles/common/tasks/bacula.yml b/roles/common/tasks/bacula.yml
index 1bd2b77..35666bd 100644
--- a/roles/common/tasks/bacula.yml
+++ b/roles/common/tasks/bacula.yml
@@ -1,75 +1,3 @@
-- name: Create /etc/stunnel/certs
- file: path=/etc/stunnel/certs
- state=directory
- owner=root group=root
- mode=0755
-
-- name: Generate a private key and a X.509 certificate for Bacula FD
- command: genkeypair.sh x509
- --pubkey=/etc/stunnel/certs/{{ inventory_hostname_short }}-fd.pem
- --privkey=/etc/stunnel/certs/{{ inventory_hostname_short }}-fd.key
- --ou=BaculaFD --cn={{ inventory_hostname }} --dns={{ inventory_hostname }}
- -t rsa -b 4096 -h sha512
- register: r1
- changed_when: r1.rc == 0
- failed_when: r1.rc > 1
- notify:
- - Restart stunnel@bacula-fd
- tags:
- - genkey
-
-- name: Fetch Bacula FD X.509 certificate
- # Ensure we don't fetch private data
- become: False
- fetch_cmd: cmd="openssl x509"
- stdin=/etc/stunnel/certs/{{ inventory_hostname_short }}-fd.pem
- dest=certs/bacula/{{ inventory_hostname_short }}-fd.pem
- tags:
- - genkey
-
-- name: Copy Bacula Dir X.509 certificates
- assemble: src=certs/bacula regexp="-dir\.pem$" remote_src=no
- dest=/etc/stunnel/certs/bacula-dirs.pem
- owner=root group=root
- mode=0644
- register: r2
- when: "'bacula-dir' not in group_names"
- notify:
- - Restart stunnel@bacula-fd
-
-- name: Copy Bacula SD X.509 certificates
- copy: src=certs/bacula/{{ hostvars[item].inventory_hostname_short }}-sd.pem
- dest=/etc/stunnel/certs/
- owner=root group=root
- mode=0644
- register: r3
- with_items: "{{ groups['bacula-sd'] | difference([inventory_hostname]) }}"
- notify:
- - Restart stunnel@bacula-fd
-
-- name: Configure stunnel
- template: src=etc/stunnel/bacula-fd.conf.j2
- dest=/etc/stunnel/bacula-fd.conf
- owner=root group=root
- mode=0644
- register: r4
- when: "'bacula-dir' not in group_names or 'bacula-sd' not in group_names"
- notify:
- - Restart stunnel@bacula-fd
-
-- name: Enable stunnel@bacula-fd
- when: "'bacula-dir' not in group_names or 'bacula-sd' not in group_names"
- service: name=stunnel4@bacula-fd enabled=yes
-
-- name: Start stunnel@bacula-fd
- service: name=stunnel4@bacula-fd state=started
- when: ('bacula-dir' not in group_names or 'bacula-sd' not in group_names) and
- not (r1.changed or r2.changed or r3.changed or r4.changed)
-
-- meta: flush_handlers
-
-
-
- name: Install bacula-fd
apt: pkg=bacula-fd