2 - name: Check {{ user_name }} key existence
4 path: "{{ nordix_openvpn_easyrsa_path }}/pki/private/{{ user_name }}.key"
5 register: client_privatekey
7 - name: Create client cert and csr
8 command: ./easyrsa --batch --req-cn={{ user_name }} gen-req {{ user_name }} nopass
10 chdir: "{{ nordix_openvpn_easyrsa_path }}"
11 when: client_privatekey.stat.exists == false
13 - name: Copy client key to client_config directory
15 src: "{{ nordix_openvpn_easyrsa_path }}/pki/private/{{ user_name }}.key"
16 dest: "{{ nordix_openvpn_clientconfig }}/keys/"
23 - name: Fetch the CA, user {{ user_name }} cert and key
25 src: "{{ nordix_openvpn_easyrsa_path }}/pki/reqs/{{ user_name }}.req"
26 dest: "{{ hostvars['localhost']['vpn_user_files_location'] }}/"