diff --git a/roles/vpn/tasks/main.yml b/roles/vpn/tasks/main.yml index 16b0bf1..dfd31eb 100644 --- a/roles/vpn/tasks/main.yml +++ b/roles/vpn/tasks/main.yml @@ -259,6 +259,18 @@ - "{{ PayloadContent.results }}" no_log: True +- name: Build the strongswan app android config + local_action: + module: template + src: sswan.j2 + dest: configs/{{ IP_subject_alt_name }}/{{ item.0 }}.sswan + mode: 0600 + become: no + with_together: + - "{{ users }}" + - "{{ PayloadContent.results }}" + no_log: True + - name: Build the client ipsec config file local_action: module: template diff --git a/roles/vpn/templates/sswan.j2 b/roles/vpn/templates/sswan.j2 new file mode 100644 index 0000000..1c2a87a --- /dev/null +++ b/roles/vpn/templates/sswan.j2 @@ -0,0 +1,11 @@ +{ + "uuid": "{{ 600000 | random | to_uuid }}", + "name": "Algo VPN {{ IP_subject_alt_name }}", + "type": "ikev2-cert", + "remote": { + "addr": "{{ IP_subject_alt_name }}" + }, + "local": { + "p12": "{{ item.1.stdout }}" + } +}