Skip to content

Commit

Permalink
variables
Browse files Browse the repository at this point in the history
OS specific files not complete
  • Loading branch information
tim-moody committed Mar 28, 2017
1 parent da2244d commit 5be4fdb
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ansible_hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[localhost]
127.0.0.1

31 changes: 31 additions & 0 deletions iiab-admin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
- hosts: all
become: yes

vars:
iiab_base: /opt/schoolserver
iiab_repo: "{{ iiab_base }}/iiab"
iiab_config_dir: /etc/xsce
admin_install_base : /opt/admin
#admin_install_base : /opt/schoolserver/admin

xsce_base: "{{ iiab_base }}"
pip_packages_dir: "{{ xsce_base }}/pip-packages"
yum_packages_dir: "{{ xsce_base }}/yum-packages"
downloads_dir: "{{ xsce_base }}/downloads"
use_cache: False
no_network: False
doc_root: /library/www/html
adm_cons_force_ssl: False
xsce_home_url: /home


vars_files:
- "{{ iiab_repo }}/vars/{{ ansible_distribution }}.yml"
- "{{ iiab_repo }}/vars/local_vars.yml"
- vars/default_vars.yml
- vars/{{ ansible_distribution }}.yml

roles:
- { role: cmdsrv }
- { role: console }
35 changes: 35 additions & 0 deletions install
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash -x

if [ -f /etc/xsce/xsce.env ]
then
. /etc/xsce/xsce.env
else
echo "IIAB Config not found."
echo "Please install Internet in a Box before installing the Admin Console."
echo "Exiting."
exit
fi

PLAYBOOK="iiab-admin.yml"
INVENTORY="ansible_hosts"

IIAB_ADMIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

if [ ! -f $IIAB_ADMIN_DIR/$PLAYBOOK ]; then
echo "Admin Console Playbook not found."
echo "Please make sure you have cloned the iiab-admin git repo."
echo "Exiting."
exit
fi

cd $IIAB_ADMIN_DIR

echo "Running local playbooks! "

# ARGS="--extra-vars '{\"target_base\":\"$XSCE_DIR\"}'"
#ARGS="target_base=$XSCE_DIR"

export ANSIBLE_LOG_PATH="$IIAB_ADMIN_DIR/admin-install.log"

#ansible-playbook -i $INVENTORY $PLAYBOOK --extra-vars "${ARGS}" --connection=local
ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local
5 changes: 5 additions & 0 deletions vars/CentOS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ansible_playbook_program: /usr/bin/ansible-playbook
ansible_program: /usr/bin/ansible
apache_data: apache
squid_service: squid
df_program: "/usr/bin/df
5 changes: 5 additions & 0 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ansible_playbook_program: /usr/local/bin/ansible-playbook
ansible_program: /usr/local/bin/ansible
apache_data: www-data
squid_service: squid3
df_program: /bin/df
19 changes: 19 additions & 0 deletions vars/Fedora.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
is_debuntu: false
is_centos: false
is_redhat: true
dns_service: named
dns_user: named
proxy: squid
proxy_user: squid
apache_service: httpd
apache_user: apache
apache_config_dir: httpd/conf.d
apache_data: apache
apache_log_dir: /var/log/httpd
smb_service: smb
nmb_service: nmb
kalite_program: /usr/bin/kalite
systemctl_program: /usr/bin/systemctl
mysql_service: mariadb
apache_log: /var/log/httpd/access_log
sshd_service: sshd
19 changes: 19 additions & 0 deletions vars/OLPC.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
is_debuntu: false
is_centos: false
is_redhat: true
dns_service: named
dns_user: named
proxy: squid
proxy_user: squid
apache_service: httpd
apache_user: apache
apache_config_dir: httpd/conf.d
apache_data: apache
apache_log_dir: /var/log/httpd
smb_service: smb
nmb_service: nmb
kalite_program: /usr/bin/kalite
systemctl_program: /usr/bin/systemctl
mysql_service: mariadb
apache_log: /var/log/httpd/access_log
apache_log_dir: /var/log/httpd
26 changes: 26 additions & 0 deletions vars/Ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
is_debuntu: true
is_ubuntu: true
is_debian: false
is_redhat: false
is_fedora: false
dns_service: bind9
dns_user: bind
proxy: squid
proxy_user: proxy
apache_service: apache2
apache_user: apache
apache_config_dir: apache2/sites-available
apache_data: www-data
apache_log_dir: /var/log/apache2
smb_service: smbd
nmb_service: nmbd
kalite_program: /usr/local/bin/kalite
systemctl_program: /bin/systemctl
mysql_service: mysql
apache_log: /var/log/apache2/access.log
# cups lp module not available in raspbian, causes systemd-modueles-load to fail
# which in turn cause netfilter-persistent to fail, which is essential
cups_install: True
sshd_service: ssh
php_version: 7.0
postgresql_version: 9.5
11 changes: 11 additions & 0 deletions vars/default_vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# WARNING: DO NOT MODIFY THIS FILE.
# CHANGES WILL BE LOST IF YOU DO A GIT PULL OR FETCH.

admin_console_dir : "{{ admin_install_base }}/console"
cmdsrv_dir : "{{ admin_install_base }}/cmdsrv"
cmdsrv_pid_file : "{{ cmdsrv_dir }}/cmdsrv.pid"
cmdsrv_conf_file : "{{ cmdsrv_dir }}/cmdsrv.conf"
cmdsrv_dbname : "cmdsrv.0.2.db"
service_filelist : "{ iiab_config_dir }}/xsce.ini"
iiab_config_file : "{ iiab_config_dir }}/xsce.env"
phplib_dir : '{{ ansible_local["local_facts"]["phplib_dir"] }}'

0 comments on commit 5be4fdb

Please sign in to comment.