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 }}
|
package: name={{ item }}
|
||||||
state=present
|
state=present
|
||||||
with_items:
|
with_items:
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
file: path=/usr/lib/iiab
|
file: path=/usr/lib/iiab
|
||||||
state=directory
|
state=directory
|
||||||
|
|
||||||
- name: Configure openvpn
|
- name: Configure OpenVPN
|
||||||
template: src={{ item.src }}
|
template: src={{ item.src }}
|
||||||
dest={{ item.dest }}
|
dest={{ item.dest }}
|
||||||
owner={{ item.owner }}
|
owner={{ item.owner }}
|
||||||
|
@ -49,59 +49,60 @@
|
||||||
- { src: 'iiab-remote-on', dest: '/usr/bin/iiab-remote-on', owner: "root" , mode: '0755' }
|
- { 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' }
|
- { 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
|
template: src=up_wan dest=/usr/lib/iiab/up_wan
|
||||||
when: is_debuntu
|
when: is_debuntu
|
||||||
|
|
||||||
- name: put dispatcher up for NM
|
- name: Put dispatcher up for NM
|
||||||
template: src=15-openvpn dest=/etc/NetworkManager/dispatcher.d/
|
template: src=15-openvpn dest=/etc/NetworkManager/dispatcher.d/
|
||||||
when: not is_debuntu
|
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
|
stat: path=/etc/openvpn/iiab-vpn.conf
|
||||||
register: stat
|
register: stat
|
||||||
|
|
||||||
|
|
||||||
# note that ansible does not currently handle @ in a service name
|
# 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
|
shell: systemctl enable openvpn@xscenet.service
|
||||||
when: openvpn_enabled and not stat.exists is defined and is_debuntu
|
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
|
shell: update-rc.d openvpn enable
|
||||||
when: openvpn_enabled and not stat.exists is defined and is_debuntu
|
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
|
shell: systemctl start openvpn@xscenet.service
|
||||||
when: openvpn_enabled and not stat.exists is defined and not installing
|
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
|
lineinfile: dest=/etc/crontab
|
||||||
line="25 * * * * root (/usr/bin/systemctl start openvpn@xscenet.service) > /dev/null"
|
line="25 * * * * root (/usr/bin/systemctl start openvpn@xscenet.service) > /dev/null"
|
||||||
when:
|
when: openvpn_enabled and openvpn_cron_enabled and not stat.exists is defined
|
||||||
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
|
lineinfile: dest=/etc/crontab
|
||||||
regexp=".*/usr/bin/systemctl*"
|
regexp=".*/usr/bin/systemctl*"
|
||||||
state=absent
|
state=absent
|
||||||
when:
|
when: not openvpn_enabled or not openvpn_cron_enabled
|
||||||
not openvpn_enabled or not openvpn_cron_enabled
|
|
||||||
|
|
||||||
|
|
||||||
- name: stop starting the openvpn tunnel at boot time
|
- name: Stop starting the OpenVPN tunnel at boot time
|
||||||
shell: systemctl disable openvpn@xscenet.service
|
shell: systemctl disable openvpn@xscenet.service
|
||||||
when: not openvpn_enabled and not is_debuntu
|
when: not openvpn_enabled and not is_debuntu
|
||||||
|
|
||||||
- name: stop starting the openvpn tunnel at boot time for Debian
|
- name: Stop starting the OpenVPN tunnel at boot time for Debian
|
||||||
shell: update-rc.d openvpn disable
|
shell: update-rc.d openvpn disable
|
||||||
when: not openvpn_enabled and is_debuntu
|
when: not openvpn_enabled and is_debuntu
|
||||||
|
|
||||||
- name: stop openvpn tunnel immediately
|
- name: Stop OpenVPN tunnel immediately
|
||||||
shell: systemctl stop openvpn@xscenet.service
|
shell: systemctl stop openvpn@xscenet.service
|
||||||
ignore_errors: True
|
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 }}'
|
ini_file: dest='{{ service_filelist }}'
|
||||||
section=openvpn
|
section=openvpn
|
||||||
option='{{ item.option }}'
|
option='{{ item.option }}'
|
||||||
|
@ -110,7 +111,7 @@
|
||||||
- option: name
|
- option: name
|
||||||
value: "openvpn"
|
value: "openvpn"
|
||||||
- option: description
|
- 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
|
- option: middleman_url
|
||||||
value: "{{ vpn_presence }}"
|
value: "{{ vpn_presence }}"
|
||||||
- option: port
|
- option: port
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue