Delete openvpn client files
[infra/tools.git] / infra / delete_openvpn_client / playbooks / roles / delete-openvpn-client-certs / tasks / main.yaml
1 ---
2 - name: Delete certificate for user {{ user_name }}
3   openssl_certificate:
4     path: "/root/CA/newcerts/{{ user_name }}.crt"
5     force: true
6     state: absent
7
8 - name: Delete CSR for user {{ user_name }}
9   openssl_csr:
10     path: "/root/CA/requests/{{ user_name }}.csr"
11     force: true
12     state: absent
13
14 - name: Delete User Private Key
15   openssl_privatekey:
16     path: "/root/CA/private/{{ user_name }}.key"
17     force: true
18     state: absent
19
20 - name: Log user specific ovpn files location on the console
21   debug:
22     msg:
23       - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
24       - "The OpenVPN access has been revoked for the user {{ user_name }}"
25       - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
26       - ''