delete previous client configurations from local folder
This commit is contained in:
parent
a6d9794abb
commit
d0efa5e9be
|
|
@ -1,12 +1,4 @@
|
||||||
---
|
---
|
||||||
- name: Create local configs directory
|
|
||||||
become: false
|
|
||||||
local_action : ansible.builtin.file
|
|
||||||
args:
|
|
||||||
path: "{{ playbook_dir }}/wg_clients/{{ inventory_hostname }}"
|
|
||||||
state: directory
|
|
||||||
mode: '0700'
|
|
||||||
|
|
||||||
- name: Init generated Keys dict
|
- name: Init generated Keys dict
|
||||||
set_fact:
|
set_fact:
|
||||||
generated_keys: []
|
generated_keys: []
|
||||||
|
|
@ -42,6 +34,24 @@
|
||||||
wg_peers: "{{ wg_peers | community.general.lists_mergeby(generated_keys,'name')}}"
|
wg_peers: "{{ wg_peers | community.general.lists_mergeby(generated_keys,'name')}}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Delete local configs directory
|
||||||
|
become: false
|
||||||
|
local_action : ansible.builtin.file
|
||||||
|
args:
|
||||||
|
path: "{{ playbook_dir }}/wg_clients/{{ inventory_hostname }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
|
||||||
|
- name: Re-create local configs directory
|
||||||
|
become: false
|
||||||
|
local_action : ansible.builtin.file
|
||||||
|
args:
|
||||||
|
path: "{{ playbook_dir }}/wg_clients/{{ inventory_hostname }}"
|
||||||
|
state: directory
|
||||||
|
mode: '0700'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- name : Generate client config file
|
- name : Generate client config file
|
||||||
become: false
|
become: false
|
||||||
local_action : ansible.builtin.template
|
local_action : ansible.builtin.template
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue