--- - name: Add config of backbones copy: content: | {{ lookup('file', global_wireguard_peers_directory + '/' + item) }} PersistentKeepalive = {{ keepalive_timeout }} dest: "{{ global_wireguard_configuration_environment_directory }}/peers/{{ item }}" owner: root group: root mode: "u=rw,g=r,o=r" when: "item != inventory_hostname" loop: "{{ groups['wireguard_backbones'] }}" notify: reassemble wireguard config - name: Store public key to backbones copy: src: "{{ global_wireguard_peers_directory }}/{{ inventory_hostname }}" dest: "{{ global_wireguard_configuration_environment_directory }}/peers/{{ inventory_hostname }}" owner: root group: root mode: "u=rw,g=r,o=r" delegate_to: "{{ item }}" when: "item != inventory_hostname" loop: "{{ groups['wireguard_backbones'] }}"