Change structure
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
---
|
||||
|
||||
- name: "Install packages"
|
||||
ansible.builtin.include_tasks: install_package.yml
|
||||
|
||||
- name: "Configure system"
|
||||
ansible.builtin.include_tasks: configure_system.yml
|
||||
|
||||
- name: "Configure wireguard server"
|
||||
ansible.builtin.include_tasks: configure_wireguard_server.yml
|
||||
|
||||
- name: "Create client directory"
|
||||
ansible.builtin.file:
|
||||
path: "{{ wireguard_client_config_dir }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0700"
|
||||
|
||||
- name: "Include peer management tasks"
|
||||
tags: peers
|
||||
ansible.builtin.include_tasks: peers.yml
|
||||
|
||||
- name: "Deploy wireguard server configuration"
|
||||
ansible.builtin.template:
|
||||
src: wg0.conf.j2
|
||||
dest: "{{ wireguard_config_dir }}/{{ wireguard_interface }}.conf"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0600'
|
||||
notify: "restart wireguard"
|
||||
|
||||
- name: "Enable and start wireguard"
|
||||
ansible.builtin.systemd:
|
||||
name: "wg-quick@{{ wireguard_interface }}"
|
||||
state: started
|
||||
enabled: yes
|
||||
Reference in New Issue
Block a user