mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
clean up OpenVPN messaging
This commit is contained in:
parent
82bd0d346a
commit
0d2d29b386
1 changed files with 26 additions and 25 deletions
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
|
||||
- name: Install openvpn packages
|
||||
- name: Install OpenVPN packages
|
||||
package: name={{ item }}
|
||||
state=present
|
||||
with_items:
|
||||
|
@ -27,7 +27,7 @@
|
|||
file: path=/usr/lib/iiab
|
||||
state=directory
|
||||
|
||||
- name: Configure openvpn
|
||||
- name: Configure OpenVPN
|
||||
template: src={{ item.src }}
|
||||
dest={{ item.dest }}
|
||||
owner={{ item.owner }}
|
||||
|
@ -49,59 +49,60 @@
|
|||
- { src: 'iiab-remote-on', dest: '/usr/bin/iiab-remote-on', owner: "root" , mode: '0755' }
|
||||
- { src: 'iiab-remote-off', dest: '/usr/bin/iiab-remote-off', owner: "root" , mode: '0755' }
|
||||
|
||||
- name: put up_wan in place for debian
|
||||
- name: Put up_wan in place for Debian
|
||||
template: src=up_wan dest=/usr/lib/iiab/up_wan
|
||||
when: is_debuntu
|
||||
|
||||
- name: put dispatcher up for NM
|
||||
- name: Put dispatcher up for NM
|
||||
template: src=15-openvpn dest=/etc/NetworkManager/dispatcher.d/
|
||||
when: not is_debuntu
|
||||
|
||||
- name: check for manually configured openvpn tunnel
|
||||
- name: Check for manually configured OpenVPN tunnel
|
||||
stat: path=/etc/openvpn/iiab-vpn.conf
|
||||
register: stat
|
||||
|
||||
|
||||
# note that ansible does not currently handle @ in a service name
|
||||
- name: enable the openvpn tunnel at boot time
|
||||
- name: Enable the OpenVPN tunnel at boot time
|
||||
shell: systemctl enable openvpn@xscenet.service
|
||||
when: openvpn_enabled and not stat.exists is defined and is_debuntu
|
||||
|
||||
- name: enable the openvpn tunnel at boot time for Debian
|
||||
- name: Enable the OpenVPN tunnel at boot time for Debian
|
||||
shell: update-rc.d openvpn enable
|
||||
when: openvpn_enabled and not stat.exists is defined and is_debuntu
|
||||
|
||||
- name: start the openvpn tunnel now
|
||||
- name: Start the OpenVPN tunnel now
|
||||
shell: systemctl start openvpn@xscenet.service
|
||||
when: openvpn_enabled and not stat.exists is defined and not installing
|
||||
|
||||
- name: make openvpn connection automatic
|
||||
|
||||
- name: Make OpenVPN connection automatic
|
||||
lineinfile: dest=/etc/crontab
|
||||
line="25 * * * * root (/usr/bin/systemctl start openvpn@xscenet.service) > /dev/null"
|
||||
when:
|
||||
openvpn_enabled and openvpn_cron_enabled and not stat.exists is defined
|
||||
when: openvpn_enabled and openvpn_cron_enabled and not stat.exists is defined
|
||||
|
||||
- name: make openvpn connection manual
|
||||
- name: Make OpenVPN connection manual
|
||||
lineinfile: dest=/etc/crontab
|
||||
regexp=".*/usr/bin/systemctl*"
|
||||
state=absent
|
||||
when:
|
||||
not openvpn_enabled or not openvpn_cron_enabled
|
||||
when: not openvpn_enabled or not openvpn_cron_enabled
|
||||
|
||||
|
||||
- name: stop starting the openvpn tunnel at boot time
|
||||
shell: systemctl disable openvpn@xscenet.service
|
||||
when: not openvpn_enabled and not is_debuntu
|
||||
- name: Stop starting the OpenVPN tunnel at boot time
|
||||
shell: systemctl disable openvpn@xscenet.service
|
||||
when: not openvpn_enabled and not is_debuntu
|
||||
|
||||
- name: stop starting the openvpn tunnel at boot time for Debian
|
||||
shell: update-rc.d openvpn disable
|
||||
when: not openvpn_enabled and is_debuntu
|
||||
- name: Stop starting the OpenVPN tunnel at boot time for Debian
|
||||
shell: update-rc.d openvpn disable
|
||||
when: not openvpn_enabled and is_debuntu
|
||||
|
||||
- name: stop openvpn tunnel immediately
|
||||
shell: systemctl stop openvpn@xscenet.service
|
||||
- name: Stop OpenVPN tunnel immediately
|
||||
shell: systemctl stop openvpn@xscenet.service
|
||||
ignore_errors: True
|
||||
when: not openvpn_enabled and not installing
|
||||
when: not openvpn_enabled and not installing
|
||||
|
||||
- name: Add openvpn to service list
|
||||
|
||||
- name: Add OpenVPN to service list
|
||||
ini_file: dest='{{ service_filelist }}'
|
||||
section=openvpn
|
||||
option='{{ item.option }}'
|
||||
|
@ -110,7 +111,7 @@
|
|||
- option: name
|
||||
value: "openvpn"
|
||||
- option: description
|
||||
value: '"Openvpn is a means of Contacting a server anywhere on the internet via a middleman server"'
|
||||
value: '"OpenVPN is a means of connecting to a server anywhere on the internet via a middleman server"'
|
||||
- option: middleman_url
|
||||
value: "{{ vpn_presence }}"
|
||||
- option: port
|
||||
|
|
Loading…
Add table
Reference in a new issue