1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00

Update openvpn/tasks/main.yml

This commit is contained in:
A Holt 2020-01-23 22:11:24 -05:00 committed by GitHub
parent c1dd54ea23
commit ee4f51d36a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,9 +1,8 @@
# TO DO: WRAP 10 OR 11 STANZAS BELOW (and saving vars to iiab_ini_file at
# bottom) INTO install.yml, somehow conditioned by...
# when: openvpn_install | bool
# TO DO: WRAP 11 OR 12 STANZAS BELOW INTO install.yml, conditioned by...
# 'when: openvpn_installed is undefined'
#
# BEWARE: 11th stanza (ssh pubkey deletions) is already conditioned by...
# when: not openvpn_install
# BEWARE: 4th stanza (ssh pubkey deletions) is already conditioned by...
# 'when: not openvpn_install' (revise?)
- name: Install OpenVPN and Nmap packages
package:
@ -84,30 +83,37 @@
dest: /usr/bin/
mode: '0755'
- name: Create iiab-support-on (symlink to iiab-support for now)
- name: Symlink /usr/bin/iiab-support-on -> /usr/bin/iiab-support
file:
src: /usr/bin/iiab-support
path: /usr/bin/iiab-support-on
state: link
- name: Create iiab-support-off (symlink to iiab-remote-off for now)
- name: Symlink /usr/bin/iiab-support-off -> /usr/bin/iiab-remote-off
file:
src: /usr/bin/iiab-remote-off
path: /usr/bin/iiab-support-off
state: link
- name: Create iiab-vpn-on (symlink to iiab-remote-on for now)
- name: Symlink /usr/bin/iiab-vpn-on -> /usr/bin/iiab-remote-on
file:
src: /usr/bin/iiab-remote-on
path: /usr/bin/iiab-vpn-on
state: link
- name: Create iiab-vpn-off (symlink to iiab-remote-off for now)
- name: Symlink /usr/bin/iiab-vpn-off -> /usr/bin/iiab-remote-off
file:
src: /usr/bin/iiab-remote-off
path: /usr/bin/iiab-vpn-off
state: link
- name: "Add 'openvpn_installed: True' to {{ iiab_state_file }}"
lineinfile:
dest: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
regexp: '^openvpn_installed'
line: 'openvpn_installed: True'
# TO DO: WRAP COMMENTS + 4 ACTIVE STANZAS BELOW INTO enable.yml...
# FIXED SOMETIME PRIOR TO AUGUST 2018: earlier versions of Ansible had not
@ -147,7 +153,7 @@
# /lib/systemd/systemd-sysv-install sets /etc/rc*.d/S|K01openvpn
# e.g. when "systemctl enable openvpn"
- name: Enable & (Re)Start PARENT service openvpn, which (re)starts CHILD service openvpn@xscenet (& actual tunnel)
- name: Enable & (Re)Start PARENT 'openvpn' system service, which (re)starts CHILD service 'openvpn@xscenet' (& actual tunnel)
systemd:
name: openvpn
daemon_reload: yes
@ -171,7 +177,7 @@
state: absent
when: not openvpn_enabled or not openvpn_cron_enabled
- name: Disable & Stop PARENT service openvpn, which stops CHILD service openvpn@xscenet (& actual tunnel)
- name: Disable & Stop PARENT 'openvpn' system service, which stops CHILD service 'openvpn@xscenet' (& actual tunnel)
systemd:
name: openvpn
enabled: no
@ -191,6 +197,7 @@
# ignore_errors: True
# when: not openvpn_enabled and not installing
- name: Add 'openvpn' variable values to {{ iiab_ini_file }}
ini_file:
path: "{{ iiab_ini_file }}"