Changeset - 23db7092008e
[Not reviewed]
0 1 0
x - 21 months ago 2023-08-24 02:14:36
xbr@c3l.lu
feat: copy fastd key during initial setup
1 file changed with 7 insertions and 0 deletions:
0 comments (0 inline, 0 general)
gateway/initial_gw_setup.yml
Show inline comments
 
@@ -146,48 +146,55 @@
 
    - name: List all peers but ourselves
 
      ansible.builtin.find:
 
        path: "{{ server_config_dir }}/fastd/peers-gw/"
 
        excludes: "{{ inventory_hostname }}"
 
      delegate_to: localhost
 
      become: false
 
      register: peers_to_copy
 
      tags: config
 
    - name: Copy fastd peers
 
      ansible.builtin.copy:
 
        src: "{{ item.path }}"
 
        dest: /etc/fastd/fflux/peers-gw/
 
        owner: root
 
        mode: "0644"
 
      with_items: "{{ peers_to_copy.files }}"
 
      tags: config
 
    - name: Copy fastd blacklist script
 
      ansible.builtin.copy:
 
        src: "{{ server_scripts_dir }}/fastd-blacklist.sh"
 
        dest: /etc/fastd/fflux/fastd-blacklist.sh
 
        owner: root
 
        group: root
 
        mode: "0755"
 
      tags: config
 
    - name: Copy fastd key
 
      ansible.builtin.copy:
 
        src: "~/keys/{{ inventory_hostname }}.conf"
 
        dest: /etc/fastd/fflux/secret.conf
 
        owner: root
 
        group: root
 
        mode: "0400"
 
    - name: Start + Enable fastd
 
      ansible.builtin.service:
 
        name: "fastd@fflux"
 
        state: "started"
 
        enabled: true
 
      tags: config
 

	
 
    # OpenVPN
 
    - name: Remove client directory
 
      ansible.builtin.file:
 
        path: /etc/openvpn/client
 
        state: absent
 
      tags: config
 
    - name: Remove server directory
 
      ansible.builtin.file:
 
        path: /etc/openvpn/server
 
        state: absent
 
      tags: config
 
    - name: Copy hideme config
 
      ansible.builtin.copy:
 
        src: "{{ server_config_dir }}/openvpn/hideme.conf"
 
        dest: /etc/openvpn/hideme.conf
 
        owner: root
 
        group: root
0 comments (0 inline, 0 general)