cleanup
This commit is contained in:
parent
894cb17f7e
commit
e9b251a18f
|
|
@ -4,13 +4,6 @@
|
|||
path: "/etc/wireguard/{{ wg_interface }}.conf"
|
||||
register: interface_configuration
|
||||
|
||||
# - name: Fetching configuration file
|
||||
# ansible.builtin.fetch:
|
||||
# src: "/etc/wireguard/{{ wg_interface }}.conf"
|
||||
# dest: "/tmp/{{ wg_interface }}.conf"
|
||||
|
||||
|
||||
|
||||
- name: Parse configuration
|
||||
ansible.utils.cli_parse:
|
||||
command: "cat /etc/wireguard/{{ wg_interface }}.conf "
|
||||
|
|
@ -19,17 +12,8 @@
|
|||
template_path: templates/wg_config_template.yaml
|
||||
set_fact: existing_wg_config
|
||||
when: interface_configuration.stat.exists
|
||||
|
||||
- name: Check registered peers
|
||||
debug:
|
||||
msg: "Found configs : {{ existing_wg_config }}"
|
||||
|
||||
|
||||
- name: Updating client configs info
|
||||
set_fact:
|
||||
wg_peers: "{{ wg_peers | community.general.lists_mergeby([{'name':item.key,'publicKey':item.value.publicKey}] ,'name')}}"
|
||||
loop: "{{ existing_wg_config | ansible.builtin.dict2items }}"
|
||||
|
||||
- name: Log client configs info
|
||||
debug:
|
||||
msg: "Updated peers defintion : {{ wg_peers }}"
|
||||
Loading…
Reference in New Issue