From aca036142fb14c037ea457a72881580b757745a9 Mon Sep 17 00:00:00 2001 From: Jack Ivanov Date: Fri, 17 Feb 2017 00:30:21 +0300 Subject: [PATCH] AndroidVPNClientProfiles #240 --- roles/vpn/tasks/main.yml | 12 ++++++++++++ roles/vpn/templates/sswan.j2 | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 roles/vpn/templates/sswan.j2 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 }}" + } +}