diff --git a/ansible/playbooks/roles/wireguard_server/tasks/gather_current_config.yaml b/ansible/playbooks/roles/wireguard_server/tasks/gather_current_config.yaml index d30825f..3a9b73c 100644 --- a/ansible/playbooks/roles/wireguard_server/tasks/gather_current_config.yaml +++ b/ansible/playbooks/roles/wireguard_server/tasks/gather_current_config.yaml @@ -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 }}" \ No newline at end of file