From 27fb2aaab7d0a333f7cdab6ead574f40cced093c Mon Sep 17 00:00:00 2001 From: Justus Grunow Date: Mon, 25 Nov 2024 06:45:01 -0500 Subject: [PATCH] Not working, not finding group_vars? --- ansible/assets/docker-ext/wg0.conf.j2 | 7 +++++-- ansible/inventory/group_vars/wireguard/vars | 4 ++++ ansible/inventory/group_vars/wireguard/vault | 13 +++++++++++++ ansible/inventory/host_vars/all/vars | 5 +++-- ansible/inventory/host_vars/basementpi/vars | 2 ++ ansible/inventory/host_vars/bastion/vars | 2 ++ ansible/inventory/hosts.yaml | 8 ++++++++ 7 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 ansible/inventory/group_vars/wireguard/vars create mode 100644 ansible/inventory/group_vars/wireguard/vault diff --git a/ansible/assets/docker-ext/wg0.conf.j2 b/ansible/assets/docker-ext/wg0.conf.j2 index 174b5d7..8b43e4d 100644 --- a/ansible/assets/docker-ext/wg0.conf.j2 +++ b/ansible/assets/docker-ext/wg0.conf.j2 @@ -3,7 +3,7 @@ PrivateKey = {{ docker-ext_wg_private_key }} Address = 10.11.20.2/24 [Peer] -PublicKey = s3Ch/zcv5IeSpIbHBT5pdzpHWwV2qh4Z9W/0DSZg/CQ= +PublicKey = {{ bastion_wg_public_key }} AllowedIPs = 0.0.0.0/0 Endpoint = vps.mycomputer.party:51820 PersistentKeepalive = 25 @@ -11,4 +11,7 @@ PersistentKeepalive = 25 [Peer] PublicKey = eEHA7CSOR5nha9w4SCB+tOXcuCxgkxIXtNU3xB7wZn4= AllowedIPs = 10.11.20.5/32 -Endpoint = vps.mycomputer.party:51820 + +[Peer] +PublicKey = QJmTVggRFs6Df/snbb3Fx3PeFFeaOqy3eUruV0eIXyE= +AllowedIPs = 10.11.20.6/32 diff --git a/ansible/inventory/group_vars/wireguard/vars b/ansible/inventory/group_vars/wireguard/vars new file mode 100644 index 0000000..9a59354 --- /dev/null +++ b/ansible/inventory/group_vars/wireguard/vars @@ -0,0 +1,4 @@ +bastion_wg_public_key: uBjwOBqEeH/2V7qo5GLGQaX159I1YBztzxvYE9pXOnI= +bastion_wg_private_key: "{{ vault_bastion_wg_private_key }}" +docker_ext_wg_public_key: 84ITOv/sB0f/h7fIY+uLQeTmMDgTCjvVzIQmEsLAZmo= +docker_ext_wg_private_key: "{{ vault_docker_ext_wg_private_key }}" diff --git a/ansible/inventory/group_vars/wireguard/vault b/ansible/inventory/group_vars/wireguard/vault new file mode 100644 index 0000000..938e65c --- /dev/null +++ b/ansible/inventory/group_vars/wireguard/vault @@ -0,0 +1,13 @@ +$ANSIBLE_VAULT;1.1;AES256 +65633461333438396463383333323364616536316536363136646361613837353938316562363466 +6431373436363535666662323636623439643532323865610a356334333430356138363561363039 +37613232333932663833303038353531636261663830653436633132386432623835643433663532 +6533343630353634320a326139346666643135326566336263653965623835396236366433313031 +37656666613035663764626430366635316430303835396436666563653531373635303633383264 +64356631393433303337373631313034323339623338383937653565376261633034666330656331 +38663262656264323639643261623263646537343430396265663762393835646566646563353766 +61363237393033643034343862663739303736336636326230386131356632626630633361646664 +66343637393439393463363434303331343161656364386535366535666433356332396364353630 +62376262373839656339353530656666626235643630303665643633326365616266656330333538 +62626237383835306534643839353465316664643161373465306461373366356433343863393635 +63363235633339373538 diff --git a/ansible/inventory/host_vars/all/vars b/ansible/inventory/host_vars/all/vars index ae0a96d..25246d5 100644 --- a/ansible/inventory/host_vars/all/vars +++ b/ansible/inventory/host_vars/all/vars @@ -1,2 +1,3 @@ -docker-ext_wg_public_key: 84ITOv/sB0f/h7fIY+uLQeTmMDgTCjvVzIQmEsLAZmo= -docker-ext_wg_private_key: GFNTkhkNuQe63+SgCrPVGgAtU98WKHdtUPSmsqjiDVs= +ansible_ssh_user: root +docker_ext_wg_public_key: 84ITOv/sB0f/h7fIY+uLQeTmMDgTCjvVzIQmEsLAZmo= +docker_ext_wg_private_key: GFNTkhkNuQe63+SgCrPVGgAtU98WKHdtUPSmsqjiDVs= diff --git a/ansible/inventory/host_vars/basementpi/vars b/ansible/inventory/host_vars/basementpi/vars index 77e3436..cad3171 100644 --- a/ansible/inventory/host_vars/basementpi/vars +++ b/ansible/inventory/host_vars/basementpi/vars @@ -1,4 +1,6 @@ --- +ansible_host: 10.11.1.10 + pi_ip: 10.11.1.10 pi_mask: 255.255.255.0 pi_gateway: 10.11.1.1 diff --git a/ansible/inventory/host_vars/bastion/vars b/ansible/inventory/host_vars/bastion/vars index a6ae81d..3b84b4c 100644 --- a/ansible/inventory/host_vars/bastion/vars +++ b/ansible/inventory/host_vars/bastion/vars @@ -1,4 +1,6 @@ --- +ansible_host: 51.222.155.202 + wg_private_key: "{{ vault_wg_private_key }}" wg_interface_ip: 10.11.20.1/24 diff --git a/ansible/inventory/hosts.yaml b/ansible/inventory/hosts.yaml index 7bf5bb0..768b313 100644 --- a/ansible/inventory/hosts.yaml +++ b/ansible/inventory/hosts.yaml @@ -1,3 +1,4 @@ +--- ungrouped: hosts: bastion: @@ -17,3 +18,10 @@ docker: ansible_ssh_user: root gitea: ansible_ssh_user: root +wireguard: + hosts: + docker-ext: + ansible_ssh_user: root + bastion: + ansible_host: 51.222.155.202 + ansible_ssh_user: root