1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00

Merge pull request #497 from holta/master

Ansible output and code more readable
This commit is contained in:
A Holt 2017-11-08 02:17:38 -05:00 committed by GitHub
commit e77c2078c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 35 additions and 36 deletions

View file

@ -19,7 +19,7 @@ if [ ! -f $PLAYBOOK ]; then
exit 1
fi
if [ $OS = "raspbian" ]; then
if [ $OS == "raspbian" ]; then
echo "Found Raspbian"
ABORT=`uname -a | grep $OLD_RPI_KERN | wc -l`
if [ "$ABORT" == 1 ]; then
@ -41,16 +41,16 @@ STAGE=""
if [ ! -f /etc/iiab/iiab.env ]; then
mkdir -p /etc/iiab
./scripts/ansible
# ./scripts/ansible # needs discussion
else
OLD=`grep XSCE /etc/iiab/iiab.env | wc -l`
if [ "$OLD" != 0 ] || [ "$1" = "--reinstall" ]; then
if [ "$OLD" != 0 ] || [ "$1" == "--reinstall" ]; then
echo "Found old XSCE install - re-installing from scratch"
rm /etc/iiab/iiab.env
# check ansible version here and force ansible upgrade if needed
else
source /etc/iiab/iiab.env
if [ "$1" = "--debug" ]; then
if [ "$1" == "--debug" ]; then
echo "Entering debug mode"
sed -i -e 's/^STAGE=.*/STAGE=2/' /etc/iiab/iiab.env
elif [ ! $STAGE == 9 ]; then

View file

@ -1,8 +1,8 @@
- name: Creat filesytem layout
- name: Create filesytem layout
include_tasks: roles/2-common/tasks/fl.yml
when: first_run
- name: turn the crank for systemd
- name: Turn the crank for systemd
shell: hostnamectl set-hostname "{{ iiab_hostname }}.{{ iiab_domain }}"
when: is_debuntu
@ -36,7 +36,7 @@
- network
- domain
- name: Configuring squid
- name: Configuring Squid
include_tasks: roles/network/tasks/squid.yml
when: squid_install
tags:

View file

@ -56,7 +56,7 @@
when: usb_lib_install
tags: usb-lib
- name: Put a Python interface to iiab.env
- name: Create a Python interface to iiab.env
template: src=roles/1-prep/templates/iiab_env.py.j2
dest=/etc/iiab/iiab_env.py

View file

@ -19,7 +19,7 @@
# extra_args="--disable-pip-version-check"
when: internet_available and is_debuntu
- name: Install KA Lite with pip (OS's other than debuntu)
- name: Install KA Lite with pip (debuntu)
pip: name=ka-lite-static
version={{ kalite_version }}
virtualenv={{ kalite_venv }}

View file

@ -1,4 +1,4 @@
- name: Install MySQL for Debian/Debuntu
- name: Install MySQL (debuntu)
package: name={{ item }}
state=present
with_items:
@ -26,7 +26,7 @@
package: name=php-xml-parser state=present
when: is_debian_8
- name: Install MySQL for non-Debian/Debuntu
- name: Install MySQL (OS's other than debuntu)
package: name={{ item }}
state=present
with_items:

View file

@ -60,7 +60,7 @@
enabled=yes
when: dnsmasq_enabled and dnsmasq_install
- name: Enable dansguardian
- name: Enable DansGuardian
service: name=dansguardian
enabled=yes
when: dansguardian_enabled and dansguardian_install

View file

@ -6,19 +6,19 @@
mode=0644
when: discovered_wireless_iface is defined
- name: Disable the Access Point Hostapd program
- name: Disable the Access Point 'hostapd' service
service: enabled=no
name=hostapd.service
when: not iiab_wireless_lan_iface is defined or iiab_network_mode == "Appliance" or not hostapd_enabled
- name: Use custom systemd unit file to start hostapd
- name: Use custom systemd unit file to start 'hostapd' service
template: src=hostapd/hostapd.service.j2
dest=/etc/systemd/system/hostapd.service
owner=root
group=root
mode=0644
- name: Enable the Access Point Hostapd program
- name: Enable the Access Point 'hostapd' service
service: enabled=yes
name=hostapd.service
when: iiab_wireless_lan_iface is defined and iiab_network_mode != "Appliance" and hostapd_enabled

View file

@ -17,7 +17,7 @@
state=stopped
when: dansguardian_install
- name: Restart DansGuardian - execpt Ubuntu which needs reboot to activate
- name: Restart DansGuardian - except Ubuntu which needs reboot to activate
service: name=dansguardian
state=restarted
when: dansguardian_enabled and dansguardian_install and ( not is_ubuntu and iiab_stage|int < 4 )
@ -42,18 +42,18 @@
creates=/etc/sysconfig/olpc-scripts/setup.d/installed/gateway
when: iiab_network_mode == "Gateway"
- name: Waiting {{ hostapd_wait }} seconds for network to stablize
- name: Waiting {{ hostapd_wait }} seconds for network to stabilize
shell: sleep {{ hostapd_wait }}
- name: Run iptables
command: /usr/bin/iiab-gen-iptables
- name: Checking if wifi slave is active
- name: Checking if WiFi slave is active
shell: brctl show br0 | grep {{ iiab_wireless_lan_iface }} | wc -l
when: iiab_wireless_lan_iface is defined and iiab_lan_iface == "br0" and hostapd_enabled
register: wifi_slave
- name: Restart hostapd if wifi slave is inactive
- name: Restart hostapd if WiFi slave is inactive
service: name=hostapd.service
state=restarted
when: wifi_slave.stdout is defined and hostapd_enabled and wifi_slave.stdout == 0

View file

@ -66,14 +66,14 @@
ignore_errors: True
when: interface.changed
- name: start up dhcpcd again
- name: Start up dhcpcd again
service: name=dhcpcd state=started
# now pick up denyinterfaces
- name: restart dhcpcd
- name: Restart dhcpcd
service: name=dhcpcd state=restarted
- name: restart the networking service
- name: Restart the networking service
service: name=networking state=restarted
#create lan br0 if lan_controller or gateway

View file

@ -1,4 +1,4 @@
# Generated by XSCE
# Generated by IIAB
NETWORKING=yes
NETWORKING_IPV6=no
IPV6FORWARDING=no

View file

@ -122,7 +122,7 @@
# following enables and disables
- include_tasks: nextcloud_enabled.yml
- name: Add Nextcloud to service list
- name: Add 'nextcloud' to service list
ini_file: dest='{{ service_filelist }}'
section=nextcloud
option='{{ item.option }}'

View file

@ -1,17 +1,17 @@
- name: Get the WordPress software
get_url: url="{{ wordpress_download_base_url }}/{{ wordpress_src }}" dest={{ downloads_dir }}/
get_url: url="{{ wordpress_download_base_url }}/{{ wordpress_src }}" dest={{ downloads_dir }}/
register: wp_download_output
when: internet_available
- name: Copy it to permanent location /library
unarchive: src={{ wp_download_output.dest }} dest=/library
unarchive: src={{ wp_download_output.dest }} dest=/library
when: internet_available
- name: Rename /library/wordpress* to /library/wordpress
shell: if [ ! -d {{ wp_abs_path }} ]; then mv {{ wp_abs_path }}* {{ wp_abs_path }}; fi
# First pass at permissions and ownership
- name: Make apache owner and group
- name: Make Apache owner and group
file: path={{ wp_abs_path }}
recurse=yes
owner=root
@ -19,7 +19,7 @@
mode=0664
state=directory
- name: Make directories 775 so apache can traverse and write
- name: Make directories 775 so Apache can traverse and write
command: "/usr/bin/find {{ wp_abs_path }} -type d -exec chmod 775 {} +"
- name: Copy wp salt values
@ -45,15 +45,15 @@
file: path=/tmp/get-iiab-wp-salts
state=absent
- name: mysql database needs to be running if we are trying to create a new db
- name: MySQL database needs to be running if we are trying to create a new db
service: state=started
name='{{ mysql_service }}'
- name: Create mysql wordpress database
- name: Create MySQL wordpress database
mysql_db: name={{ wp_db_name }}
state=present
- name: Create mysql wordpress database user
- name: Create MySQL wordpress database user
mysql_user: name={{ wp_db_user }}
password={{ wp_db_user_password }}
priv={{ wp_db_name }}.*:ALL,GRANT
@ -70,22 +70,21 @@
template: src=wordpress.conf.j2
dest=/etc/{{ apache_config_dir }}/wordpress.conf
- name: Enable httpd conf file if we are disabled
- name: Enable httpd conf file if we are disabled (debuntu)
file: path=/etc/apache2/sites-enabled/wordpress.conf
src=/etc/apache2/sites-available/wordpress.conf
state=link
when: wordpress_enabled and is_debuntu
- name: Remove httpd conf file if we are disabled
- name: Remove httpd conf file if we are disabled (OS's other than debuntu)
file: path=/etc/apache2/sites-enabled/wordpress.conf
state=absent
when: not wordpress_enabled and is_debuntu
- name: Restart apache, so it picks up the new aliases
- name: Restart Apache, so it picks up the new aliases
service: name={{ apache_service }} state=restarted
- name: Add wordpress to service list
- name: Add 'wordpress' to service list
ini_file: dest='{{ service_filelist }}'
section=wordpress
option='{{ item.option }}'