From 8cf4032ecec5b9f58d829e89f231179170432539 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 22 May 2016 17:21:16 +0200 Subject: =?UTF-8?q?Tunnel=20bacula=20(dir=20=E2=86=92=20{fd,sd}=20and=20fd?= =?UTF-8?q?=20=E2=86=92=20sd)=20traffic=20through=20IPSec.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roles/bacula-dir/tasks/main.yml | 69 ----------------------------------------- 1 file changed, 69 deletions(-) (limited to 'roles/bacula-dir/tasks') diff --git a/roles/bacula-dir/tasks/main.yml b/roles/bacula-dir/tasks/main.yml index 8d182d2..30a25c1 100644 --- a/roles/bacula-dir/tasks/main.yml +++ b/roles/bacula-dir/tasks/main.yml @@ -1,72 +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 Dir - command: genkeypair.sh x509 - --pubkey=/etc/stunnel/certs/{{ inventory_hostname_short }}-dir.pem - --privkey=/etc/stunnel/certs/{{ inventory_hostname_short }}-dir.key - --ou=BaculaDir --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-dir - tags: - - genkey - -- name: Fetch Bacula Dir X.509 certificate - # Ensure we don't fetch private data - become: False - fetch_cmd: cmd="openssl x509" - stdin=/etc/stunnel/certs/{{ inventory_hostname_short }}-dir.pem - dest=certs/bacula/{{ inventory_hostname_short }}-dir.pem - tags: - - genkey - -- 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 - with_items: "{{ groups['bacula-sd'] | difference([inventory_hostname]) | sort }}" - register: r2 - notify: - - Restart stunnel@bacula-dir - -- name: Copy Bacula FD X.509 certificates - copy: src=certs/bacula/{{ hostvars[item].inventory_hostname_short }}-fd.pem - dest=/etc/stunnel/certs/ - owner=root group=root - mode=0644 - with_items: "{{ groups.all | difference([inventory_hostname]) | sort }}" - register: r3 - notify: - - Restart stunnel@bacula-dir - -- name: Configure stunnel - template: src=etc/stunnel/bacula-dir.conf.j2 - dest=/etc/stunnel/bacula-dir.conf - owner=root group=root - mode=0644 - register: r4 - notify: - - Restart stunnel@bacula-dir - -- name: Enable stunnel@bacula-dir - service: name=stunnel4@bacula-dir enabled=yes - -- name: Start stunnel@bacula-dir - service: name=stunnel4@bacula-dir state=started - when: not (r1.changed or r2.changed or r3.changed or r4.changed) - -- meta: flush_handlers - - - - name: Install bacula-director apt: pkg={{ item }} with_items: -- cgit v1.2.3