Skip to content
Snippets Groups Projects
Select Git revision
  • 81e1a3f4c6fcce120b51beb2f83fd9b93f04e0b9
  • main default protected
  • ci
3 results

wg.yml

Blame
  • Antwan's avatar
    a
    antoine.blancy authored
    81e1a3f4
    History
    wg.yml 1.04 KiB
    - name: curl
      hosts: h1
      roles:
        - hosts
        - post
        - keys
      become: yes
      vars:
        addr: 10.0.1.2
        router_addr: 10.0.1.1
        other_subnet: 10.0.3.0
      tasks:
        - name: install curl
          apt:
            name: curl
    
    - name: nginx
      hosts: h2
      become: yes
      vars:
        my_cool_greeting: HEHEHELOOLOLOLO
        addr: 10.0.3.2
        router_addr: 10.0.3.1
        other_subnet: 10.0.1.0
      tasks:
        - name: install nginx
          apt:
            name: nginx
        - name: copy index.html
          template:
            src: index.html
            dest: /var/www/html/index.html
          notify: nginx-restarter
      roles:
        - hosts
        - post
        - keys
      handlers:
        - name: nginx-restarter
          service:
            name: nginx
            state: restarted
    
    
    - name: h1_key_set
      hosts: h2
      roles:
        - role: wg
          vars:
            publickey: "{{ hostvars['h2'].publickey }}"
            myAddr: 10.0.0.10
            dst: 10.0.3.2
    
    - name: h2_key_set
      hosts: h1
      roles:
        - role: wg
          vars:
            publickey: "{{ hostvars['h1'].publickey }}"
            myAddr: 10.0.0.20
            dst: 10.0.1.2