mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Test (#20)
* change apache_data to apache_user in all * no libapach2 in centos. just php. no php-magick in centos * remove redundant vars entries * do not create apache user * missed one pound sign * soft code all references to apache_user * centos requires older setuptools * revert ansible_lsb.id in xsce.yml * try getting recent pip * move pip download to 2prep so that kalite success is not dependent on iiab coming first * still need to replace setuptools in kalite * add curl -- needed in debian * massivly substitue iiab for xsce, and rename files * completed runansible * centos fixes,install pip * appliance means no iptables rules * change to earlier version of setuptools for centos * delete file duplicate, hopefully unnecessary. generate the offline docs * wiki docs errors * create the admin group -- deleted earlier * use the --yes option with pip uninstall * base of repo moved from schoolserver to iiab, unleashkids.org->iiab.io * network detection broken due to tupo
This commit is contained in:
parent
6ef68cc480
commit
f319afa432
179 changed files with 978 additions and 672 deletions
|
@ -1,4 +1,4 @@
|
|||
vpn_presence: xscenet.net
|
||||
vpn_presence: iiabnet.net
|
||||
openvpn_server_virtual_ip: 10.8.0.1
|
||||
openvpn_server_port: 1194
|
||||
openvpn_install: True
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
group=root
|
||||
mode=0755
|
||||
|
||||
- name: Create a folder for xsce executable not on path
|
||||
file: path=/usr/lib/xsce
|
||||
- name: Create a folder for iiab executable not on path
|
||||
file: path=/usr/lib/iiab
|
||||
state=directory
|
||||
|
||||
- name: Configure openvpn
|
||||
|
@ -40,15 +40,15 @@
|
|||
- { src: 'announce', dest: '/etc/openvpn/scripts/announce', owner: "root" , mode: '0755' }
|
||||
- { src: 'announcer', dest: '/etc/openvpn/scripts/announcer', owner: "root" , mode: '0755' }
|
||||
- { src: 'silence', dest: '/etc/openvpn/scripts/silence', owner: "root" , mode: '0755' }
|
||||
- { src: 'xscenet.conf', dest: '/etc/openvpn/xscenet.conf', owner: "root" , mode: '0644' }
|
||||
- { src: 'xsce-vpn.conf.in', dest: '/etc/openvpn/xsce-vpn.conf.in', owner: "root" , mode: '0644' }
|
||||
- { src: 'iiabnet.conf', dest: '/etc/openvpn/iiabnet.conf', owner: "root" , mode: '0644' }
|
||||
- { src: 'iiab-vpn.conf.in', dest: '/etc/openvpn/iiab-vpn.conf.in', owner: "root" , mode: '0644' }
|
||||
- { src: 'xs-vpn', dest: '/usr/bin/xs-vpn', owner: "root" , mode: '0755' }
|
||||
- { src: 'xs-handle', dest: '/usr/bin/xs-handle', owner: "root" , mode: '0755' }
|
||||
- { src: 'up_wan', dest: '/usr/lib/xsce/up_wan', owner: "root" , mode: '0755' }
|
||||
- { src: 'start.j2', dest: '/usr/lib/xsce/start', owner: "root" , mode: '0755' }
|
||||
- { src: 'up_wan', dest: '/usr/lib/iiab/up_wan', owner: "root" , mode: '0755' }
|
||||
- { src: 'start.j2', dest: '/usr/lib/iiab/start', owner: "root" , mode: '0755' }
|
||||
|
||||
- name: put up_wan in place for debian
|
||||
template: src=up_wan dest=/usr/lib/xsce/up_wan
|
||||
template: src=up_wan dest=/usr/lib/iiab/up_wan
|
||||
when: is_debuntu
|
||||
|
||||
- name: put dispatcher up for NM
|
||||
|
@ -56,12 +56,12 @@
|
|||
when: not is_debuntu
|
||||
|
||||
- name: check for manually configured openvpn tunnel
|
||||
stat: path=/etc/openvpn/xsce-vpn.conf
|
||||
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
|
||||
shell: systemctl enable openvpn@xscenet.service
|
||||
shell: systemctl enable openvpn@iiabnet.service
|
||||
when: openvpn_enabled and not stat.exists is defined and is_debuntu
|
||||
|
||||
- name: enable the openvpn tunnel at boot time for Debian
|
||||
|
@ -69,12 +69,12 @@
|
|||
when: openvpn_enabled and not stat.exists is defined and is_debuntu
|
||||
|
||||
- name: start the openvpn tunnel now
|
||||
shell: systemctl start openvpn@xscenet.service
|
||||
shell: systemctl start openvpn@iiabnet.service
|
||||
when: openvpn_enabled and not stat.exists is defined and not installing
|
||||
|
||||
- name: make openvpn connection automatic
|
||||
lineinfile: dest=/etc/crontab
|
||||
line="25 * * * * root (/usr/bin/systemctl start openvpn@xscenet.service) > /dev/null"
|
||||
line="25 * * * * root (/usr/bin/systemctl start openvpn@iiabnet.service) > /dev/null"
|
||||
when:
|
||||
openvpn_enabled and openvpn_cron_enabled and not stat.exists is defined
|
||||
|
||||
|
@ -87,7 +87,7 @@
|
|||
|
||||
|
||||
- name: stop starting the openvpn tunnel at boot time
|
||||
shell: systemctl disable openvpn@xscenet.service
|
||||
shell: systemctl disable openvpn@iiabnet.service
|
||||
when: not openvpn_enabled and not is_debuntu
|
||||
|
||||
- name: stop starting the openvpn tunnel at boot time for Debian
|
||||
|
@ -95,7 +95,7 @@
|
|||
when: not openvpn_enabled and is_debuntu
|
||||
|
||||
- name: stop openvpn tunnel immediately
|
||||
shell: systemctl stop openvpn@xscenet.service
|
||||
shell: systemctl stop openvpn@iiabnet.service
|
||||
ignore_errors: True
|
||||
when: not openvpn_enabled and not installing
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ if [ "$2" = "up" ]; then
|
|||
sleep 2
|
||||
/sbin/ip route list dev "$1" | grep -q '^default' &&
|
||||
# restart the services
|
||||
systemctl -q is-enabled openvpn@xscenet.service && /usr/lib/xsce/up-wan
|
||||
systemctl -q is-enabled openvpn@iiabnet.service && /usr/lib/iiab/up-wan
|
||||
fi
|
||||
|
||||
# we added this to prevent logs from filling with openvpn errors
|
||||
|
@ -22,7 +22,7 @@ fi
|
|||
# sleep 2
|
||||
# /sbin/ip route list dev "$1" | grep -q '^default' ||
|
||||
# stop the services
|
||||
# systemctl -q is-enabled openvpn@xscenet.service && systemctl stop openvpn@xscenet.service
|
||||
# systemctl -q is-enabled openvpn@iiabnet.service && systemctl stop openvpn@iiabnet.service
|
||||
#fi
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -3,18 +3,18 @@
|
|||
|
||||
HANDLE=
|
||||
UUID=
|
||||
source /etc/xsce/xsce.env
|
||||
source /etc/iiab/iiab.env
|
||||
if [ -z "$HANDLE" ]; then
|
||||
HANDLE=`cat /etc/xsce/xsce.ini | gawk \
|
||||
HANDLE=`cat /etc/iiab/iiab.ini | gawk \
|
||||
'{ if((toupper($1) == "HANDLE") && ($2 == "=")) { print $3;}}'`
|
||||
fi
|
||||
if [ -z "$HANDLE" ]; then
|
||||
if [ -f /etc/xsce/handle ]; then
|
||||
HANDLE=`cat /etc/xsce/handle`
|
||||
if [ -f /etc/iiab/handle ]; then
|
||||
HANDLE=`cat /etc/iiab/handle`
|
||||
fi
|
||||
fi
|
||||
if [ -f /etc/xsce/uuid ]; then
|
||||
UUID=`cat /etc/xsce/uuid`
|
||||
if [ -f /etc/iiab/uuid ]; then
|
||||
UUID=`cat /etc/iiab/uuid`
|
||||
fi
|
||||
# start the daemon which will serve the handle on demand
|
||||
source /etc/init.d/functions
|
||||
|
|
6
roles/openvpn/templates/iiab-vpn.conf.in
Normal file
6
roles/openvpn/templates/iiab-vpn.conf.in
Normal file
|
@ -0,0 +1,6 @@
|
|||
# this file allows changing the world accessable vpn server and its ip address
|
||||
#
|
||||
# copy this template file to /etc/openvpn/iiab-vpn.conf, and set properly
|
||||
|
||||
# VPNCONFIG=< put the name of the config file in /etc/openvpn you want to use>
|
||||
# VPNIP=<put the ip address of server, pinged to test for existence of vpn tunnel>
|
37
roles/openvpn/templates/iiabnet.conf
Normal file
37
roles/openvpn/templates/iiabnet.conf
Normal file
|
@ -0,0 +1,37 @@
|
|||
#########################################
|
||||
# Sample client-side OpenVPN config file
|
||||
# for connecting to multi-client server.
|
||||
#
|
||||
# Adapted from http://openvpn.sourceforge.net/20notes.html
|
||||
#
|
||||
# The server can be pinged at {{ openvpn_server_virtual_ip }}
|
||||
#
|
||||
|
||||
port {{ openvpn_server_port }}
|
||||
dev tun
|
||||
remote iiabnet.net
|
||||
|
||||
# TLS parms
|
||||
|
||||
tls-client
|
||||
ca keys/ca.crt
|
||||
cert keys/client1.crt
|
||||
key keys/client1.key
|
||||
|
||||
# This parm is required for connecting
|
||||
# to a multi-client server. It tells
|
||||
# the client to accept options which
|
||||
# the server pushes to us.
|
||||
pull
|
||||
|
||||
# Scripts can be used to do various
|
||||
# things (change nameservers, for
|
||||
# example.
|
||||
script-security 2
|
||||
up scripts/announce
|
||||
down scripts/silence
|
||||
log /var/log/openvpn.log
|
||||
|
||||
verb 3
|
||||
comp-lzo yes
|
||||
keepalive 5 30
|
|
@ -22,6 +22,6 @@ if [ "$enabled" = 'True' ]; then
|
|||
killall openvpn
|
||||
sleep 10
|
||||
#echo "Starting openvpn and waiting 10 seconds for daemon to become ready"
|
||||
systemctl start openvpn@xscenet
|
||||
systemctl start openvpn@iiabnet
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -4,6 +4,6 @@ systemctl is-enabled openvpn
|
|||
if [ $? -eq 0 ]; then
|
||||
pgrep openvpn
|
||||
if [ $? -ne 0 ]; then
|
||||
systemctl start openvpn@xscenet
|
||||
systemctl start openvpn@iiabnet
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -4,10 +4,10 @@ echo
|
|||
echo
|
||||
read -p "what identifying handle would you like to use? " ans
|
||||
if [ "$ans" == "" ]; then
|
||||
if [ -f /etc/xsce/handle ]; then
|
||||
rm -f /etc/xsce/handle
|
||||
if [ -f /etc/iiab/handle ]; then
|
||||
rm -f /etc/iiab/handle
|
||||
fi
|
||||
else
|
||||
echo $ans > /etc/xsce/handle
|
||||
echo $ans > /etc/iiab/handle
|
||||
fi
|
||||
{{ systemctl_program }} restart openvpn@xscenet
|
||||
{{ systemctl_program }} restart openvpn@iiabnet
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#!/bin/sh
|
||||
# script to manage openvpn
|
||||
if [ ! -f "/etc/openvpn/xsce-vpn.conf" ]; then
|
||||
if [ ! -f "/etc/openvpn/iiab-vpn.conf" ]; then
|
||||
VPNCONFIG='party-line.conf'
|
||||
VPNIP={{ openvpn_server_virtual_ip }}
|
||||
else
|
||||
# expect the sourced file to set the above variables
|
||||
source /etc/openvpn/xsce-vpn.conf
|
||||
source /etc/openvpn/iiab-vpn.conf
|
||||
fi
|
||||
|
||||
# we'd like the user of this script to have root privilege
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue