chore: fix ansible-lint violations and add pre-commit hooks
This commit is contained in:
@@ -1,19 +1,22 @@
|
||||
---
|
||||
- name: Start OpenVPN
|
||||
systemd:
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ openvpn_service }}"
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
- name: Wait for tap0
|
||||
command: ip link show tap0
|
||||
ansible.builtin.command: ip link show tap0
|
||||
register: tap_check
|
||||
retries: 10
|
||||
delay: 2
|
||||
until: tap_check.rc == 0
|
||||
changed_when: false
|
||||
|
||||
- name: Bring tap0 up
|
||||
command: ip link set tap0 up
|
||||
ansible.builtin.command: ip link set tap0 up
|
||||
changed_when: false
|
||||
|
||||
- name: Attach tap0 to bridge
|
||||
command: ip link set tap0 master br-main-vpn
|
||||
ansible.builtin.command: ip link set tap0 master br-main-vpn
|
||||
changed_when: false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: Create certificate directory
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ openvpn_cert_dir }}"
|
||||
state: directory
|
||||
owner: root
|
||||
@@ -8,7 +8,7 @@
|
||||
mode: "0755"
|
||||
|
||||
- name: Deploy CA certificate
|
||||
copy:
|
||||
ansible.builtin.copy:
|
||||
src: certs/ca.crt
|
||||
dest: "{{ openvpn_cert_dir }}/ca.crt"
|
||||
owner: root
|
||||
@@ -16,7 +16,7 @@
|
||||
mode: "0644"
|
||||
|
||||
- name: Deploy server certificate
|
||||
copy:
|
||||
ansible.builtin.copy:
|
||||
src: certs/server.crt
|
||||
dest: "{{ openvpn_cert_dir }}/server.crt"
|
||||
owner: root
|
||||
@@ -24,9 +24,9 @@
|
||||
mode: "0644"
|
||||
|
||||
- name: Deploy server private key
|
||||
copy:
|
||||
ansible.builtin.copy:
|
||||
src: certs/server.key
|
||||
dest: "{{ openvpn_cert_dir }}/server.key"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0600"
|
||||
mode: "0600"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: Deploy OpenVPN configuration
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: server.conf.j2
|
||||
dest: /etc/openvpn/server/server.conf
|
||||
owner: root
|
||||
@@ -9,7 +9,7 @@
|
||||
notify: restart openvpn
|
||||
|
||||
- name: Deploy Radius configuration
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: radiusplugin.cnf.j2
|
||||
dest: /etc/openvpn/radiusplugin.cnf
|
||||
owner: root
|
||||
@@ -18,7 +18,7 @@
|
||||
notify: restart openvpn
|
||||
|
||||
- name: Deploy client-connect script
|
||||
copy:
|
||||
ansible.builtin.copy:
|
||||
src: client-connect.sh
|
||||
dest: /etc/openvpn/scripts/client-connect.sh
|
||||
owner: root
|
||||
@@ -26,6 +26,6 @@
|
||||
mode: "0755"
|
||||
|
||||
- name: Enable OpenVPN service
|
||||
systemd:
|
||||
ansible.builtin.systemd:
|
||||
name: openvpn@server
|
||||
enabled: true
|
||||
enabled: true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: Install OpenVPN packages
|
||||
apt:
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- openvpn
|
||||
- openvpn-auth-radius
|
||||
@@ -8,7 +8,7 @@
|
||||
update_cache: true
|
||||
|
||||
- name: Create OpenVPN directories
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: root
|
||||
@@ -17,4 +17,4 @@
|
||||
loop:
|
||||
- "{{ openvpn_ccd_dir }}"
|
||||
- "{{ openvpn_config_dir }}"
|
||||
- /etc/openvpn/scripts
|
||||
- /etc/openvpn/scripts
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
---
|
||||
- import_tasks: install.yml
|
||||
- import_tasks: certs.yml
|
||||
- import_tasks: config.yml
|
||||
- import_tasks: bridge-tap.yml
|
||||
- name: Import OpenVPN installation tasks
|
||||
ansible.builtin.import_tasks: install.yml
|
||||
- name: Import OpenVPN certificate tasks
|
||||
ansible.builtin.import_tasks: certs.yml
|
||||
- name: Import OpenVPN configuration tasks
|
||||
ansible.builtin.import_tasks: config.yml
|
||||
- name: Import OpenVPN bridge-tap tasks
|
||||
ansible.builtin.import_tasks: bridge-tap.yml
|
||||
|
||||
Reference in New Issue
Block a user