Finalise the Wireguard configuration setup
This commit is contained in:
parent
688aad887f
commit
2ffdd1c44c
|
@ -1,6 +1,7 @@
|
||||||
- name: Checkout some repositories for local config
|
- name: 'Config: Checkout some repositories for local config'
|
||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
|
- repos
|
||||||
git:
|
git:
|
||||||
repo: "{{ item.repo }}"
|
repo: "{{ item.repo }}"
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
|
@ -13,19 +14,40 @@
|
||||||
template:
|
template:
|
||||||
src: 'templates/conkyrc.j2'
|
src: 'templates/conkyrc.j2'
|
||||||
dest: '~/.conkyrc'
|
dest: '~/.conkyrc'
|
||||||
mode: '0600'
|
mode: '0400'
|
||||||
|
|
||||||
- name: 'Wireguard: Configuration template'
|
- name: 'Wireguard'
|
||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
- wireguard
|
- wireguard
|
||||||
block:
|
block:
|
||||||
- stat:
|
- set_fact:
|
||||||
path: /etc/wireguard/wg0.conf
|
wgconfig_path: /etc/wireguard/wg0.conf
|
||||||
|
|
||||||
|
- name: 'Wireguard: Check for existing configuration'
|
||||||
|
stat:
|
||||||
|
path: "{{ wgconfig_path }}"
|
||||||
register: wgconfig
|
register: wgconfig
|
||||||
- copy:
|
|
||||||
dest: /etc/wireguard/wg0.conf
|
- name: 'Wireguard: Create configuration template'
|
||||||
|
copy:
|
||||||
|
dest: "{{ wgconfig_path }}"
|
||||||
src: files/wireguard.conf
|
src: files/wireguard.conf
|
||||||
mode: '0400'
|
mode: '0400'
|
||||||
when: wgconfig.stat.exists == False
|
when: wgconfig.stat.exists == False
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
|
- name: 'Wireguard: Fix configuration permissions'
|
||||||
|
file:
|
||||||
|
state: file
|
||||||
|
path: "{{ wgconfig_path }}"
|
||||||
|
mode: '0400'
|
||||||
|
owner: 'root'
|
||||||
|
group: 'root'
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: 'Wireguard: Service enabled'
|
||||||
|
service:
|
||||||
|
name: 'wg-quick@wg0'
|
||||||
|
enabled: true
|
||||||
|
state: started
|
||||||
|
|
Loading…
Reference in a new issue