Compare commits
49 Commits
automotive
...
main
| Author | SHA1 | Date |
|---|---|---|
|
|
5413bb5036 | |
|
|
2a7017a8c8 | |
|
|
d0efa5e9be | |
|
|
a6d9794abb | |
|
|
8a0ec15e56 | |
|
|
e9b251a18f | |
|
|
894cb17f7e | |
|
|
9aa2fe8bca | |
|
|
9e275303c9 | |
|
|
b0d53248ec | |
|
|
eb84432a4a | |
|
|
1d970e843e | |
|
|
d60fafdf7e | |
|
|
3550797a5f | |
|
|
2b18b0f316 | |
|
|
53a6db2fad | |
|
|
a09e56f4e3 | |
|
|
0d7b47021e | |
|
|
c3adcc1cf1 | |
|
|
4835be1e30 | |
|
|
bba9096ac4 | |
|
|
a50ab533bc | |
|
|
cf83f7bd2c | |
|
|
e29626c550 | |
|
|
af433bf4f9 | |
|
|
1ba1f48a67 | |
|
|
152f556d55 | |
|
|
e864964b95 | |
|
|
976b96b3bb | |
|
|
ce83465f7b | |
|
|
5472f1ff2a | |
|
|
7c837e3a74 | |
|
|
2d8495fb53 | |
|
|
bb6c96ebf0 | |
|
|
eec3cc677f | |
|
|
b1a19a374c | |
|
|
954a6c3562 | |
|
|
16309ca46f | |
|
|
e0b7533bec | |
|
|
57eeda2a52 | |
|
|
8b4d7737e1 | |
|
|
dd585233e2 | |
|
|
e320843d5a | |
|
|
84b509ec37 | |
|
|
e3c1b4082e | |
|
|
5bef64c3c0 | |
|
|
525fc50429 | |
|
|
d5698f4be6 | |
|
|
256fdc5b58 |
|
|
@ -1 +1,2 @@
|
|||
.DS_Store
|
||||
ansible/playbooks/wg_clients
|
||||
|
|
@ -1,5 +1,9 @@
|
|||
---
|
||||
externals:
|
||||
children:
|
||||
nextcloud:
|
||||
hosts:
|
||||
c-service.sse.cloud.isti.cnr.it
|
||||
rup_tests:
|
||||
hosts:
|
||||
liquid:
|
||||
|
|
@ -2,11 +2,28 @@
|
|||
wg_interface: wg0
|
||||
wg_port: 51820
|
||||
#wg_server_public_interface: eth0
|
||||
wg_server_address: 192.168.99.1/32
|
||||
wg_server_address: 192.168.98.1/32
|
||||
#wg_server_private_key: "{{ wg_server_private_key }}"
|
||||
|
||||
|
||||
wg_peers:
|
||||
- name: fabio_test
|
||||
publicKey: "dzODOKndtafZSf2GqvClFdxrpwyNJnZ/AsZkNl+ovEE="
|
||||
allowedIP: "192.168.99.4/32"
|
||||
- name: fabio
|
||||
ip: "192.168.98.11/32"
|
||||
allowedIPs :
|
||||
- "192.168.98.0/24"
|
||||
- "10.22.0.0/16"
|
||||
- name: lucio
|
||||
ip: "192.168.98.12/32"
|
||||
allowedIPs :
|
||||
- "192.168.98.0/24"
|
||||
- "10.22.0.0/16"
|
||||
- name: roberto
|
||||
ip: "192.168.98.13/32"
|
||||
allowedIPs :
|
||||
- "192.168.98.0/24"
|
||||
- "10.22.0.0/16"
|
||||
- name: giorgio
|
||||
ip: "192.168.98.14/32"
|
||||
allowedIPs :
|
||||
- "192.168.98.0/24"
|
||||
- "10.22.0.0/16"
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
wg_interface: wg0
|
||||
wg_port: 51820
|
||||
#wg_server_public_interface: eth0
|
||||
wg_server_address: 192.168.99.1/32
|
||||
#wg_server_private_key: "{{ wg_server_private_key }}"
|
||||
|
||||
|
||||
wg_peers:
|
||||
- name: fabio_test
|
||||
publicKey: "9a3tgXpF5CAOffbHZdW1QBEJgSLFnBDVbD1JaMPgzkM="
|
||||
ip: "192.168.99.4/32"
|
||||
allowedIPs :
|
||||
- "192.168.99.0/24"
|
||||
- "10.22.0.0/16"
|
||||
- name: missing_key_test
|
||||
ip: "192.168.99.5/32"
|
||||
allowedIPs :
|
||||
- "192.168.99.0/24"
|
||||
- "10.22.0.0/16"
|
||||
- name: forced_missing_key_test
|
||||
forceRegeneration: True
|
||||
ip: "192.168.99.6/32"
|
||||
allowedIPs :
|
||||
- "192.168.99.0/24"
|
||||
- "10.22.0.0/16"
|
||||
|
|
@ -2,22 +2,22 @@
|
|||
# SIFI
|
||||
sifi:
|
||||
children:
|
||||
opn:
|
||||
hosts:
|
||||
sifi_opnsense.sifi.isti.cnr.it:
|
||||
#opn:
|
||||
#hosts:
|
||||
# sifi_opnsense.sifi.isti.cnr.it:
|
||||
# ns1.sifi.isti.cnr.it:
|
||||
# ansible_host: 146.48.108.51 #[WAN public ip]
|
||||
# ansible_host: 10.20.30.111
|
||||
wireguard_server:
|
||||
hosts:
|
||||
wireguarder.sifi.isti.cnr.it:
|
||||
vpn-1.sifi.sse.cloud.isti.cnr.it:
|
||||
# ansible_host: 146.48.108.13
|
||||
nameserver:
|
||||
hosts:
|
||||
ns1.sifi.isti.cnr.it:
|
||||
ansible_host: 146.48.108.51
|
||||
# nameserver:
|
||||
# hosts:
|
||||
#ns1.sifi.isti.cnr.it:
|
||||
# ansible_host: 146.48.108.51
|
||||
# dns1.internal.sifi.isti.cnr.it:
|
||||
# ansible_host: 10.11.12.11
|
||||
workers:
|
||||
hosts:
|
||||
worker1.internal.sifi.isti.cnr.it:
|
||||
dev-1.sifi.sse.cloud.isti.cnr.it:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
vlab-1:
|
||||
children:
|
||||
yuno:
|
||||
hosts:
|
||||
yuno.sse.cloud.isti.cnr.it:
|
||||
wireguard_server:
|
||||
hosts:
|
||||
vpn-1.sse.cloud.isti.cnr.it:
|
||||
nextcloud:
|
||||
hosts:
|
||||
b-service_2:
|
||||
ansible_host: 10.22.2.77
|
||||
b-service_1:
|
||||
ansible_host: 10.22.1.145
|
||||
|
|
@ -1,17 +1,8 @@
|
|||
---
|
||||
- name: Install Nextcloud AIO Docker
|
||||
hosts: all
|
||||
hosts: nextcloud
|
||||
become: true
|
||||
vars:
|
||||
pip_install_packages:
|
||||
- name: docker
|
||||
docker_version: "=5:28.2.2-1~ubuntu.24.04~noble"
|
||||
docker_users:
|
||||
- fabio
|
||||
- ansible
|
||||
|
||||
|
||||
roles:
|
||||
- geerlingguy.pip
|
||||
- geerlingguy.docker
|
||||
# - nextcloud_aio
|
||||
- nextcloud_aio
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
# defaults file for docker
|
||||
docker_version: "*.*.*"
|
||||
docker_sudo_users: []
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
nextcloud_docker_image_name: "ghcr.io/nextcloud-releases/all-in-one"
|
||||
nextcloud_docker_image_tag: latest
|
||||
nextcloud_docker_skip_domain_validation: "true"
|
||||
nextcloud_docker_mastercontainer_volume_dir: /usr/data/nextcloud_aio_mastercontainer
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
dependencies:
|
||||
- role: docker
|
||||
|
|
@ -1,18 +1,31 @@
|
|||
---
|
||||
- name: Create volumes
|
||||
debug:
|
||||
msg:
|
||||
- "TODO!!!"
|
||||
- name: Pull docker image
|
||||
docker_image:
|
||||
name: "{{ nextcloud_docker_image_name }}"
|
||||
tag: "{{ nextcloud_docker_image_tag }}"
|
||||
source: pull
|
||||
|
||||
- name: Download compose file
|
||||
become: true
|
||||
become_user: docker
|
||||
ansible.builtin.git:
|
||||
repo: "https://gitea-s2i2s.isti.cnr.it/sinibaldi/SSE-Lab"
|
||||
dest: SSE-Lab
|
||||
- name: Create Master Container volume dir
|
||||
file:
|
||||
path: "{{ nextcloud_docker_mastercontainer_volume_dir }}"
|
||||
state: directory
|
||||
mode: "0766"
|
||||
|
||||
- name: create and start docker compose services
|
||||
become: true
|
||||
become_user: docker
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: ~/SSE-Lab/dockerized/nextcloud-aio/compose.yaml
|
||||
- name: Create container
|
||||
docker_container:
|
||||
name: nextcloud-aio-mastercontainer
|
||||
image: "{{ nextcloud_docker_image_name }}"
|
||||
ports:
|
||||
- "8080:8080"
|
||||
- "80:80"
|
||||
- "8443:8443"
|
||||
env:
|
||||
APACHE_PORT: "443"
|
||||
APACHE_IP_BINDING: "0.0.0.0"
|
||||
APACHE_ADDITIONAL_NETWORK: ""
|
||||
SKIP_DOMAIN_VALIDATION: "{{ nextcloud_docker_skip_domain_validation }}"
|
||||
volumes:
|
||||
- nextcloud_aio_mastercontainer:/mnt/docker-aio-config
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
restart_policy : "always"
|
||||
init : true
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
- name: Check if config already exists
|
||||
stat:
|
||||
path: "/etc/wireguard/{{ wg_interface }}.conf"
|
||||
register: interface_configuration
|
||||
|
||||
- name: Parse configuration
|
||||
ansible.utils.cli_parse:
|
||||
command: "cat /etc/wireguard/{{ wg_interface }}.conf "
|
||||
parser:
|
||||
name: ansible.netcommon.native
|
||||
template_path: templates/wg_config_template.yaml
|
||||
set_fact: existing_wg_config
|
||||
when: interface_configuration.stat.exists
|
||||
|
||||
- name: Updating client configs info
|
||||
set_fact:
|
||||
wg_peers: "{{ wg_peers | community.general.lists_mergeby([{'name':item.key,'publicKey':item.value.publicKey}] ,'name')}}"
|
||||
when: item.key in (wg_peers | map(attribute='name'))
|
||||
loop: "{{ existing_wg_config | ansible.builtin.dict2items }}"
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
---
|
||||
- name: Init generated Keys dict
|
||||
set_fact:
|
||||
generated_keys: []
|
||||
|
||||
- name : Gather needed key generation
|
||||
set_fact:
|
||||
generated_keys: "{{ generated_keys + [{'name': item.name}] }}"
|
||||
when : item.publicKey is not defined or (item.forceRegeneration is defined and item.forceRegeneration)
|
||||
loop: "{{ wg_peers }}"
|
||||
|
||||
- name : Generate private keys
|
||||
command : wg genkey
|
||||
register: privateKeyObjects
|
||||
loop : "{{ generated_keys }}"
|
||||
|
||||
|
||||
- name : Generate public keys
|
||||
shell : echo "{{privateKeyObjects.results[ansible_loop.index0].stdout}}" | wg pubkey
|
||||
register: publicKeyObjects
|
||||
loop : "{{ generated_keys }}"
|
||||
loop_control:
|
||||
extended: true
|
||||
|
||||
- name: Registering generated keys
|
||||
set_fact:
|
||||
generated_keys: "{{ generated_keys | community.general.lists_mergeby ([{'privateKey' : privateKeyObjects.results[ansible_loop.index0].stdout, 'publicKey' : publicKeyObjects.results[ansible_loop.index0].stdout, 'name':item.name }],'name') }}"
|
||||
loop: "{{ generated_keys }}"
|
||||
loop_control:
|
||||
extended: true
|
||||
|
||||
- name: Updating client configs info
|
||||
set_fact:
|
||||
wg_peers: "{{ wg_peers | community.general.lists_mergeby(generated_keys,'name')}}"
|
||||
|
||||
|
||||
- name: Delete local configs directory
|
||||
become: false
|
||||
local_action : ansible.builtin.file
|
||||
args:
|
||||
path: "{{ playbook_dir }}/wg_clients/{{ inventory_hostname }}"
|
||||
state: absent
|
||||
|
||||
|
||||
- name: Re-create local configs directory
|
||||
become: false
|
||||
local_action : ansible.builtin.file
|
||||
args:
|
||||
path: "{{ playbook_dir }}/wg_clients/{{ inventory_hostname }}"
|
||||
state: directory
|
||||
mode: '0700'
|
||||
|
||||
|
||||
|
||||
- name : Generate client config file
|
||||
become: false
|
||||
local_action : ansible.builtin.template
|
||||
args:
|
||||
src: templates/wireguard_client.jinja
|
||||
dest: "{{ playbook_dir }}/wg_clients/{{ inventory_hostname }}/{{ item.name }}.conf"
|
||||
vars:
|
||||
wg_client_public_key: "{{ item.publicKey }}"
|
||||
wg_client_private_key: "{{ item.privateKey | default('')}}"
|
||||
wg_client_address: "{{ item.ip }}"
|
||||
allowed_ips : "{{ item.allowedIPs }}"
|
||||
wg_server : "{{ inventory_hostname }}"
|
||||
loop: "{{ wg_peers }}"
|
||||
|
|
@ -6,39 +6,39 @@
|
|||
state: directory
|
||||
mode: '0700'
|
||||
|
||||
- name: Check if private key already exists
|
||||
- name: Check if server private key already exists
|
||||
ansible.builtin.stat:
|
||||
path: /etc/wireguard/privatekey
|
||||
register: privkey_file
|
||||
register: privatekey_file
|
||||
|
||||
- name: Generate private key
|
||||
- name: Generate server private key
|
||||
ansible.builtin.command: wg genkey
|
||||
register: wg_private_key
|
||||
when: not privkey_file.stat.exists
|
||||
when: not privatekey_file.stat.exists
|
||||
changed_when: true
|
||||
|
||||
- name: Save private key
|
||||
- name: Save server private key
|
||||
ansible.builtin.copy:
|
||||
content: "{{ wg_private_key.stdout }}"
|
||||
dest: /etc/wireguard/privatekey
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0600'
|
||||
when: not privkey_file.stat.exists
|
||||
when: not privatekey_file.stat.exists
|
||||
|
||||
- name: Read private key
|
||||
- name: Read server private key
|
||||
ansible.builtin.slurp:
|
||||
src: /etc/wireguard/privatekey
|
||||
register: private_key_content
|
||||
|
||||
- name: Generate public key from private key
|
||||
- name: Generate server public key from private key
|
||||
ansible.builtin.shell: echo "{{ private_key_content.content | b64decode | trim }}" | wg pubkey
|
||||
register: wg_public_key
|
||||
register: wg_server_public_key
|
||||
changed_when: false
|
||||
|
||||
- name: Save public key
|
||||
- name: Save server public key
|
||||
ansible.builtin.copy:
|
||||
content: "{{ wg_public_key.stdout }}"
|
||||
content: "{{ wg_server_public_key.stdout }}"
|
||||
dest: /etc/wireguard/publickey
|
||||
owner: root
|
||||
group: root
|
||||
|
|
@ -46,4 +46,4 @@
|
|||
|
||||
- name: Display public key for reference
|
||||
ansible.builtin.debug:
|
||||
msg: "Public key for {{ inventory_hostname }}: {{ wg_public_key.stdout }}"
|
||||
msg: "Public key for {{ inventory_hostname }}: {{ wg_server_public_key.stdout }}"
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
---
|
||||
- include_tasks: install_wireguard.yaml
|
||||
- include_tasks: generate_keys.yaml
|
||||
- include_tasks: gather_current_config.yaml
|
||||
- include_tasks: generate_server_keys.yaml
|
||||
- include_tasks: generate_client_configs.yaml
|
||||
- include_tasks: configure_server.yaml
|
||||
|
|
|
|||
|
|
@ -1,62 +0,0 @@
|
|||
---
|
||||
- name: Install Wireguard Server
|
||||
apt:
|
||||
pkg:
|
||||
- wireguard
|
||||
state: latest
|
||||
update_cache: true
|
||||
|
||||
|
||||
- name: Create directory for wg keys
|
||||
ansible.builtin.file:
|
||||
path: /etc/wireguard/keys
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Creating server privatekey and publickey
|
||||
shell: wg genkey | tee privatekey | wg pubkey > publickey
|
||||
args:
|
||||
chdir: /etc/wireguard/keys
|
||||
|
||||
- name: Get Private Key [privatekey => var_privatekey]
|
||||
shell: cat privatekey
|
||||
register: var_privatekey
|
||||
args:
|
||||
chdir: /etc/wireguard/keys
|
||||
|
||||
|
||||
#- name: Add WireGuard interface
|
||||
# command: ip link add dev wg0 type wireguard
|
||||
|
||||
|
||||
- name: Updating configuration
|
||||
template:
|
||||
src: wireguard_server.jinja
|
||||
dest: /etc/wireguard/wg0.conf
|
||||
|
||||
#- name: Activating link
|
||||
# command: ip link set up dev wg0
|
||||
|
||||
|
||||
- name: Starting wg service
|
||||
systemd:
|
||||
state: started
|
||||
name: wg-quick@wg0
|
||||
enabled: yes
|
||||
|
||||
|
||||
- name: Getting public key
|
||||
shell: cat publickey
|
||||
register: var_publickey
|
||||
args:
|
||||
chdir: /etc/wireguard/keys
|
||||
|
||||
|
||||
- name: Check server public IP
|
||||
shell: curl https://ipinfo.io/ip
|
||||
register: var_server_ip
|
||||
|
||||
|
||||
- name: Printing public key
|
||||
debug:
|
||||
msg: "Server {{ ansible_hostname }} reachable @{{var_server_ip}}. Public key is {{ var_publickey }}"
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
- example: "# Peer ID : fabio_test"
|
||||
getval: '# Peer ID : (?P<peer_id>\S+)'
|
||||
result:
|
||||
"{{ peer_id }}":
|
||||
name: "{{ peer_id }}"
|
||||
shared: true
|
||||
|
||||
- example: "PublicKey = 9a3tgXpF5CAOffbHZdW1QBEJgSLFnBDVbD1JaMPgzkM="
|
||||
getval: 'PublicKey = (?P<publicKey>\S+)'
|
||||
result:
|
||||
"{{ peer_id }}":
|
||||
publicKey: "{{ publicKey }}"
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
[Interface]
|
||||
{% if wg_client_private_key is defined and wg_client_private_key != None and wg_client_private_key != ''%}
|
||||
PrivateKey = {{wg_client_private_key}}
|
||||
{% else%}
|
||||
|
||||
# Public and private keys were pre generated by client
|
||||
# Insert private key below and uncomment in order to use the present configuration
|
||||
# PrivateKey =
|
||||
|
||||
{% endif %}
|
||||
|
||||
Address = {{wg_client_address}}
|
||||
|
||||
[Peer]
|
||||
PublicKey = {{wg_server_public_key.stdout}}
|
||||
AllowedIPs = {{ allowed_ips | join(', ') }}
|
||||
Endpoint = {{ wg_server }}:{{ wg_port }}
|
||||
PersistentKeepalive = 25
|
||||
|
|
@ -16,10 +16,10 @@ PostDown = iptables -t nat -D POSTROUTING ! -o {{wg_interface}} -m mark --mark 0
|
|||
|
||||
|
||||
{% for peer in wg_peers %}
|
||||
# {{ peer.name }}
|
||||
# Peer ID : {{ peer.name }}
|
||||
[Peer]
|
||||
PublicKey = {{ peer.publicKey }}
|
||||
AllowedIPs = {{ peer.allowedIP }}
|
||||
AllowedIPs = {{ peer.ip }}
|
||||
{% if peer.persistent_keepalive is defined %}
|
||||
PersistentKeepalive = {{ peer.persistent_keepalive }}
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -37,11 +37,15 @@ Calls role nextcloud_aio, dependent on docker role.
|
|||
- Downloads SSE-Lab Repo
|
||||
- Runs compose up (using ansible plugins)
|
||||
|
||||
E.g. `ansible-playbook -i inventories/ -l nextrup_copy_test playbooks/nextcloud.yaml`
|
||||
E.g.
|
||||
|
||||
```ansible-playbook -i inventories/ -l nextrup_copy_test playbooks/nextcloud.yaml```
|
||||
|
||||
### Bootstrap ###
|
||||
Creates sudoer user ansible, necessitates of sudoer user.
|
||||
Use `ansible-playbook -i inventories playbooks/bootstrap.yml -l [TARGET_HOST] -e 'ansible_user=[REMOTE_USER]' -K`
|
||||
Use
|
||||
|
||||
```ansible-playbook -i inventories playbooks/bootstrap.yml -l [TARGET_HOST] -e 'ansible_user=[REMOTE_USER]' -K```
|
||||
|
||||
|
||||
### NameServer ###
|
||||
|
|
@ -56,8 +60,72 @@ Configures a OPNSense edge node features :
|
|||
- Wireguard VPN
|
||||
|
||||
NB runs locally so python intepreter needs to be specified
|
||||
E.g. `ansible-playbook -i inventories/sifi.yaml playbooks/opnsense.yaml --extra-vars="ansible_python_interpreter=$(which python)"
|
||||
`
|
||||
E.g.
|
||||
|
||||
```ansible-playbook -i inventories/sifi.yaml playbooks/opnsense.yaml --extra-vars="ansible_python_interpreter=$(which python)"
|
||||
```
|
||||
|
||||
### VPN Server ###
|
||||
Configures a VPN Server (only wireguard supported at the moment) for the specified 'wg_peers'.
|
||||
|
||||
The server acts as a gateway into a site, tunneling each connection and allowing only traffic into allowed subnets.
|
||||
|
||||
|
||||
Needed parameters and configuration example :
|
||||
|
||||
```
|
||||
wg_interface: wg0
|
||||
wg_port: 51820
|
||||
wg_server_address: 192.168.99.1/32
|
||||
wg_peers:
|
||||
- name: fabio_test
|
||||
publicKey: "9a3tgXpF5CAOffbHZdW1QBEJgSLFnBDVbD1JaMPgzkM="
|
||||
ip: "192.168.99.4/32"
|
||||
allowedIPs :
|
||||
- "192.168.99.0/24"
|
||||
- "10.22.0.0/16"
|
||||
- name: missing_key_test
|
||||
ip: "192.168.99.5/32"
|
||||
allowedIPs :
|
||||
- "192.168.99.0/24"
|
||||
- "10.22.0.0/16"
|
||||
- name: forced_missing_key_test
|
||||
forceRegeneration: True
|
||||
ip: "192.168.99.6/32"
|
||||
allowedIPs :
|
||||
- "192.168.99.0/24"
|
||||
- "10.22.0.0/16"
|
||||
|
||||
```
|
||||
|
||||
#### Wg-peers items ####
|
||||
|
||||
Each item represents a client [**Peer**] with :
|
||||
|
||||
- *name* [**Mandatory**] : a unique label for the client configuration
|
||||
- *publicKey*: public key used by the client. If missing, the playbook generates both public and private keys, if needed.
|
||||
- *ip* [**Mandatory**]: reserved ip for the client
|
||||
- *allowedIPs* [**Mandatory**]: subnets to which the server allows traffic to for the present client
|
||||
- *forceRegeneration*: force regeneration of public / private keys pair.
|
||||
|
||||
#### Client configurations ####
|
||||
The playbook generates client configurations at the following path
|
||||
|
||||
> "{{ playbook_dir }}/wg_clients/{{ inventory_hostname }}/{{ item.name }}.conf"
|
||||
|
||||
**NB** Client configurations are ready to be imported in wireguard client if the playbook generated both public and private keys. Otherwise only the client's public key is reported and the user is expected to fill the configuration properly with their private key.
|
||||
|
||||
|
||||
#### Key pair generation policy ####
|
||||
|
||||
In order to configure peers to connect to the server, public/private key pairs are needed.
|
||||
|
||||
The playbook evalutes the need for key generation as following :
|
||||
- If *forceRegeneration* is set to *True*, keys are generated
|
||||
- If *publicKey* is declared, that key is used
|
||||
- If a public Key is already configured on the server for that Peer's name, that key is used
|
||||
- If no public key is declared nor found, a new private / public key pair is generated and reported in client's configuration
|
||||
|
||||
|
||||
## Inventories
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
# requirements.yml
|
||||
---
|
||||
roles:
|
||||
- name: githubixx.ansible_role_wireguard
|
||||
src: https://github.com/githubixx/ansible-role-wireguard.git
|
||||
version: 19.0.0
|
||||
|
||||
# - name: bodsch.dns.bind
|
||||
# version:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue