diff --git a/roles/ipsec/defaults/main.yml b/roles/ipsec/defaults/main.yml index 9113d34..0553fc3 100644 --- a/roles/ipsec/defaults/main.yml +++ b/roles/ipsec/defaults/main.yml @@ -7,4 +7,9 @@ strongswan_requeriments: - conntrack certificates: - { content: '{{ cert_ipsec }}', dest: '/etc/ipsec.d/certs/cert.pem', mode: 'u=rw,g=r,o=r' } - - { content: '{{ ca }}', dest: '/etc/ipsec.d/cacerts/ca.pem', mode: 'u=rw,g=r,o=r' } \ No newline at end of file + - { content: '{{ ca }}', dest: '/etc/ipsec.d/cacerts/ca.pem', mode: 'u=rw,g=r,o=r' } +config_ipsec_files: + - { src: 'ipsec.conf', dest: '/etc/ipsec.conf', mode: 'u=rw,g=r,o=r' } + - { src: 'vn-attr.conf', dest: '/etc/strongswan.d/charon/vn-attr.conf', mode: 'u=rw,g=r,o=r' } + - { src: 'vn-eap-radius.conf', dest: '/etc/strongswan.d/charon/vn-eap-radius.conf', mode: 'u=r,g=,o=' } + - { src: 'ipsec.secrets', dest: '/etc/ipsec.secrets', mode: 'u=r,g=,o=' } diff --git a/roles/ipsec/tasks/ipsec.yml b/roles/ipsec/tasks/ipsec.yml index ce822dd..36ad57e 100644 --- a/roles/ipsec/tasks/ipsec.yml +++ b/roles/ipsec/tasks/ipsec.yml @@ -29,11 +29,7 @@ owner: root group: root mode: "{{ item.mode }}" - loop: - - { src: 'ipsec.conf', dest: '/etc/ipsec.conf', mode: 'u=rw,g=r,o=r' } - - { src: 'vn-attr.conf', dest: '/etc/strongswan.d/charon/vn-attr.conf', mode: 'u=rw,g=r,o=r' } - - { src: 'vn-eap-radius.conf', dest: '/etc/strongswan.d/charon/vn-eap-radius.conf', mode: 'u=r,g=,o=' } - - { src: 'ipsec.secrets', dest: '/etc/ipsec.secrets', mode: 'u=r,g=,o=' } + loop: "{{ config_ipsec_files }}" - name: Copy Configure file copy: src: vn.conf