2 # tasks file for vpn_client
3 - name: Create Directory for Client Config Files
5 path: "{{ openvpn_ca }}/client_configs/{{ item }}"
12 - name: Copy Client Sample Config file
15 dest: "{{ openvpn_ca }}/client_configs/base.conf"
18 - name: Client certs and keys to client_configs
21 dest: "{{ openvpn_ca }}/client_configs/keys"
23 - "{{ hostvars['localhost']['vpn_user_files_location'] }}/{{ user_name }}.crt"
24 - "{{ hostvars['localhost']['vpn_user_files_location'] }}/{{ user_name }}.key"
26 - name: Copy ta & Client certs and keys to client_configs
30 dest: "{{ openvpn_ca }}/client_configs/keys"
32 - "/etc/openvpn/ta.key"
33 - "/etc/openvpn/ca.crt"
35 - name: Create Client .ovpn file
36 script: make_config.sh "{{ user_name }}"
38 chdir: "{{ openvpn_ca }}/client_configs/"
41 - name: Fetch Client .ovpn file
43 src: "{{ openvpn_ca }}/client_configs/files/{{ item|basename }}"
44 dest: "{{ hostvars['localhost']['vpn_user_files_location'] }}/"
47 - "{{ user_name }}.ovpn"
49 - name: Start and Enable Openvpn Service
56 - name: Log user specific ovpn files location on the console
59 - +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
60 - zone specific user ovpn files are located in {{ hostvars['localhost']['vpn_user_files_location'] }}
61 - +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++