diff --git a/script.sh b/script.sh index 3a171506f979aef129575a8b318f29c56ddcd3a6..5b4047f5efc7558ae8d7697a45f56161c826b92f 100644 --- a/script.sh +++ b/script.sh @@ -1,3 +1,2 @@ #!/bin/bash -#ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i deez_nodes h1.yml h2.yml r1.yml wg.yml -ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i deez_nodes r1.yml wg.yml \ No newline at end of file +ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i deez_nodes h1.yml h2.yml r1.yml wg.yml \ No newline at end of file diff --git a/templates/wg b/templates/wg index 1bd503d762836b4e104662e1f3ec3a05e0cd9b85..faf3ecd2122cb15aa56c2e1231c8492fa72d585d 100644 --- a/templates/wg +++ b/templates/wg @@ -4,6 +4,6 @@ PostUp = wg set %i private-key /etc/wireguard/privatekey ListenPort = 51902 [Peer] -PublicKey = {{ publickey }} +PublicKey = {{ pubk }} Endpoint = {{ dst }}:51902 AllowedIPs = 10.0.0.0/24 diff --git a/wg.yml b/wg.yml index 198fef7fc2582fb54311ff81a7d743a7e3f59df6..90f3f09f061fdef7558f83ccbd337cad6a85b3f8 100644 --- a/wg.yml +++ b/wg.yml @@ -1,49 +1,5 @@ -- 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 + hosts: h1 roles: - role: wg vars: @@ -51,9 +7,8 @@ myAddr: 10.0.0.10 dst: 10.0.3.2 - - name: h2_key_set - hosts: h1 + hosts: h2 roles: - role: wg vars: