From 3abb27bbedf923d540665f25ba510fc6c56eaaf8 Mon Sep 17 00:00:00 2001 From: Arky Date: Thu, 19 Oct 2017 13:33:02 +0700 Subject: [PATCH] Misc Fixes: Clean up whitespace warnings --- roles/1-prep/tasks/detected_network.yml | 2 +- roles/1-prep/tasks/main.yml | 2 +- roles/2-common/tasks/packages.yml | 6 ++-- roles/2-common/tasks/xo.yml | 4 +-- roles/9-local-addons/meta/main.yml | 1 - roles/activity-server/tasks/main.yml | 31 ++++++++++----------- roles/authserver/tasks/main.yml | 2 +- roles/awstats/tasks/install.yml | 11 ++++---- roles/awstats/tasks/main.yml | 2 +- roles/calibre/tasks/main.yml | 2 +- roles/cups/tasks/main.yml | 2 +- roles/dokuwiki/tasks/install.yml | 5 ++-- roles/ejabberd/tasks/main.yml | 2 +- roles/idmgr/tasks/main.yml | 2 +- roles/iiab-admin/tasks/admin-user.yml | 17 ++++++----- roles/mongodb/tasks/main.yml | 2 +- roles/monit/tasks/main.yml | 4 +-- roles/moodle/tasks/main.yml | 8 +++--- roles/mysql/tasks/main.yml | 3 +- roles/network/tasks/avahi.yml | 2 +- roles/network/tasks/debian.yml | 10 +++---- roles/network/tasks/enable_services.yml | 2 +- roles/network/tasks/ifcfg_mods.yml | 3 +- roles/network/tasks/iptables.yml | 4 +-- roles/network/tasks/main.yml | 2 +- roles/network/tasks/named.yml | 8 +++--- roles/network/tasks/redetect.yml | 21 +++++++------- roles/network/tasks/rpi_debian.yml | 16 +++++------ roles/nextcloud/tasks/F18.yml | 2 +- roles/nextcloud/tasks/main.yml | 3 +- roles/nextcloud/tasks/nextcloud_enabled.yml | 4 +-- roles/openvpn/tasks/main.yml | 2 +- roles/owncloud/tasks/main.yml | 8 +++--- roles/owncloud/tasks/owncloud_enabled.yml | 1 - roles/pathagar/tasks/main.yml | 2 +- roles/phpmyadmin/tasks/main.yml | 2 +- roles/samba/tasks/main.yml | 11 ++++---- roles/sshd/tasks/main.yml | 2 +- roles/sugar-stats/tasks/main.yml | 6 ++-- roles/sugarizer/tasks/main.yml | 10 +++---- roles/teamviewer/tasks/install.yml | 9 +++--- roles/usb-lib/tasks/main.yml | 8 +++--- roles/vnstat/tasks/main.yml | 8 +++--- roles/wordpress/tasks/install.yml | 2 +- 44 files changed, 121 insertions(+), 135 deletions(-) diff --git a/roles/1-prep/tasks/detected_network.yml b/roles/1-prep/tasks/detected_network.yml index b3637d5ba..502f3dc1c 100644 --- a/roles/1-prep/tasks/detected_network.yml +++ b/roles/1-prep/tasks/detected_network.yml @@ -76,7 +76,7 @@ wifi1: "{{ item|trim }}" discovered_wireless_iface: "{{ item|trim }}" when: item|trim != "" and item|trim != discovered_wan_iface - with_items: + with_items: - "{{ wireless_list1.stdout_lines }}" # WIRELESS -- Sigh... Not all drivers update /proc/net/wireless correctly diff --git a/roles/1-prep/tasks/main.yml b/roles/1-prep/tasks/main.yml index b4eae678d..dc9672c67 100644 --- a/roles/1-prep/tasks/main.yml +++ b/roles/1-prep/tasks/main.yml @@ -21,7 +21,7 @@ state=present when: is_debuntu -- name: Test for UUID file +- name: Test for UUID file stat: path=/etc/iiab/uuid register: uuid_file diff --git a/roles/2-common/tasks/packages.yml b/roles/2-common/tasks/packages.yml index 3e2a88611..24cb7e844 100644 --- a/roles/2-common/tasks/packages.yml +++ b/roles/2-common/tasks/packages.yml @@ -3,7 +3,7 @@ when: ansible_distribution == "Fedora" and ansible_machine == "armv7l" and ansible_distribution_version|int >= 22 - name: install yum from Fedora 23 for arm!!! - shell: dnf install -y https://kojipkgs.fedoraproject.org//packages/yum/3.4.3/506.fc23/noarch/yum-3.4.3-506.fc23.noarch.rpm python-dnf + shell: dnf install -y https://kojipkgs.fedoraproject.org//packages/yum/3.4.3/506.fc23/noarch/yum-3.4.3-506.fc23.noarch.rpm python-dnf when: ansible_distribution == "Fedora" and ansible_machine == "armv7l" and ansible_distribution_version|int >= 22 - name: install yum if it has been dropped from our distribution -- Fedora 22 uses dnf!!! @@ -97,7 +97,7 @@ - python-pip - python-setuptools - python-virtualenv - + - name: Update common packages (not debian package: name={{ item }} state=latest @@ -124,7 +124,7 @@ # service: name=NetworkManager # state=restarted # when: not installing -# the above should use a handler - all reboots should wait until all +# the above should use a handler - all reboots should wait until all # mods are preformed - name: Install optional exFAT packages for CentOS diff --git a/roles/2-common/tasks/xo.yml b/roles/2-common/tasks/xo.yml index e0c86b5e0..ee9b4f852 100644 --- a/roles/2-common/tasks/xo.yml +++ b/roles/2-common/tasks/xo.yml @@ -112,7 +112,7 @@ get_url: url="{{ iiab_download_url }}/{{ item }}" dest={{ downloads_dir}}/{{ item }} with_items: - hostapd_8188_i386 - when: wifi_id == "tplink_WM725M" and xo_model == "XO-1.5" and internet_available + when: wifi_id == "tplink_WM725M" and xo_model == "XO-1.5" and internet_available tags: - xo @@ -131,5 +131,3 @@ ignore_errors: yes async: 300 poll: 120 - - diff --git a/roles/9-local-addons/meta/main.yml b/roles/9-local-addons/meta/main.yml index c88edbe27..74ae9e11f 100644 --- a/roles/9-local-addons/meta/main.yml +++ b/roles/9-local-addons/meta/main.yml @@ -1,3 +1,2 @@ # Add your role to this list and then uncomment dependencies. Adding a tag is handy for testing. #dependencies: - \ No newline at end of file diff --git a/roles/activity-server/tasks/main.yml b/roles/activity-server/tasks/main.yml index 10ef22a70..55b4d4b15 100644 --- a/roles/activity-server/tasks/main.yml +++ b/roles/activity-server/tasks/main.yml @@ -12,29 +12,29 @@ - /library/xs-activity-server/lang_templates - /library/xs-activity-server/www.0 - /library/xs-activity-server/tmp - + # Wish synchronize worked, but it doesn't - -- name: Copy language templates + +- name: Copy language templates command: rsync -a {{iiab_dir}}/roles/activity-server/files/lang_templates /library/xs-activity-server/ - -- name: Copy default index files + +- name: Copy default index files copy: src={{ item }} dest=/library/xs-activity-server/www.0 mode=0755 owner=root group=root with_fileglob: - - www.0/index.html.* - + - www.0/index.html.* + - name: Point www to www.0 as default file: src=/library/xs-activity-server/www.0 - dest=/library/xs-activity-server/www + dest=/library/xs-activity-server/www owner=root group=admin - state=link - -- name: Chown language templates + state=link + +- name: Chown language templates file: path=/library/xs-activity-server/lang_templates mode=0644 owner=root @@ -49,8 +49,8 @@ mode=0755 owner=root group=root - state=directory - + state=directory + - name: Install Python module copy: src=xs_activities/__init__.py dest=/usr/lib/python2.7/site-packages/xs_activities @@ -58,7 +58,7 @@ owner=root group=root -- name: Copy scripts to /usr/bin +- name: Copy scripts to /usr/bin copy: src={{ item }} dest=/usr/bin mode=0755 @@ -105,7 +105,7 @@ # For it only supports client's language code # TODO: Upload Activity via web interface -# and figure out what to do with olpc_activities.service +# and figure out what to do with olpc_activities.service # short term addition of link for upload-activity server # ln -sf /usr/share/xs-config/cfg/html/top/en/cntr_upl_activity.php {{ doc_root }}/upload_activity.php @@ -130,4 +130,3 @@ value: /activities - option: enabled value: "{{ xo_services_enabled }}" - diff --git a/roles/authserver/tasks/main.yml b/roles/authserver/tasks/main.yml index 45a8e4303..11e34c91f 100644 --- a/roles/authserver/tasks/main.yml +++ b/roles/authserver/tasks/main.yml @@ -4,7 +4,7 @@ - name: Install xs-authserver from pypi pip: name=xs-authserver - when: internet_available + when: internet_available - name: install gunicorn package: name=python-gunicorn diff --git a/roles/awstats/tasks/install.yml b/roles/awstats/tasks/install.yml index d495a5fd4..6610d9dc2 100644 --- a/roles/awstats/tasks/install.yml +++ b/roles/awstats/tasks/install.yml @@ -1,5 +1,5 @@ - name: Install awstats package - package: name={{ item }} + package: name={{ item }} state=present with_items: - awstats @@ -9,7 +9,7 @@ - download - name: Install awstats package - package: name={{ item }} + package: name={{ item }} state=present with_items: - libapache2-mod-authnz-external @@ -33,7 +33,7 @@ - "{{ awstats_data_dir }}" - "{{ apache_log_dir }}" -- name: Install the Apache config for Advanced Web Statistics +- name: Install the Apache config for Advanced Web Statistics template: src=apache.conf dest=/etc/{{ apache_config_dir }}/awstats.conf owner=root @@ -41,7 +41,7 @@ mode=0644 when: awstats_enabled and is_debuntu -- name: Install the Apache config for Advanced Web Statistics +- name: Install the Apache config for Advanced Web Statistics template: src=apache-awstats.conf dest=/etc/{{ apache_config_dir }}/awstats.conf owner=root @@ -74,7 +74,7 @@ state=absent when: not awstats_enabled and is_debuntu -- name: Install the awstats config for Advanced Web Statistics +- name: Install the awstats config for Advanced Web Statistics template: src=awstats.schoolserver.conf.j2 dest=/etc/awstats/awstats.schoolserver.conf owner=root @@ -95,4 +95,3 @@ - name: On first enabling of awstats, summarize httpd logs up to now shell: /usr/bin/perl /usr/lib/cgi-bin/awstats.pl -config=schoolserver -update when: awstats_enabled and is_debuntu - diff --git a/roles/awstats/tasks/main.yml b/roles/awstats/tasks/main.yml index b60e7367e..7326d9670 100644 --- a/roles/awstats/tasks/main.yml +++ b/roles/awstats/tasks/main.yml @@ -1,6 +1,6 @@ - include: install.yml when: awstats_install - + - name: Add awstats to service list ini_file: dest='{{ service_filelist }}' section=awstats diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index 19892b95a..193a24db5 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -10,7 +10,7 @@ shell: "{{ downloads_dir }}/calibre-installer.py >> /dev/null" args: creates: /usr/bin/calibre-uninstall - when: calibre_install and ansible_distribution == 'CentOS' + when: calibre_install and ansible_distribution == 'CentOS' - name: Install Calibre rpms # the fedora rpm arm version, though older, takes care of dependencies, and exists diff --git a/roles/cups/tasks/main.yml b/roles/cups/tasks/main.yml index dc62c98e7..61abe61a5 100644 --- a/roles/cups/tasks/main.yml +++ b/roles/cups/tasks/main.yml @@ -7,7 +7,7 @@ when: cups_install tags: - download - + - name: Put our own config file in place, to permit local lan admin template: dest=/etc/cups/cupsd.conf src=cupsd.conf diff --git a/roles/dokuwiki/tasks/install.yml b/roles/dokuwiki/tasks/install.yml index e7d588ab5..82eaadf3e 100644 --- a/roles/dokuwiki/tasks/install.yml +++ b/roles/dokuwiki/tasks/install.yml @@ -1,6 +1,6 @@ - name: Get the Dokuwiki software get_url: url="{{ iiab_download_url }}/{{ dokuwiki_version }}.tgz" dest={{ downloads_dir}}/ - when: internet_available + when: internet_available - name: Copy it to permanent location /library unarchive: src={{ downloads_dir }}/{{ dokuwiki_version }}.tgz dest=/library creates=/library/{{ dokuwiki_version }}/VERSION @@ -17,7 +17,7 @@ src=/etc/apache2/sites-available/dokuwiki.conf state=link when: dokuwiki_enabled and is_debuntu - + - name: disable the dokuwiki file: path=/etc/apache2/sites-enabled/dokuwiki.conf state=absent @@ -29,4 +29,3 @@ - name: Restart apache, so it picks up the new aliases service: name={{ apache_service }} state=restarted - diff --git a/roles/ejabberd/tasks/main.yml b/roles/ejabberd/tasks/main.yml index 68e5dbd43..b0341521a 100644 --- a/roles/ejabberd/tasks/main.yml +++ b/roles/ejabberd/tasks/main.yml @@ -26,7 +26,7 @@ register: ejabberd_config - name: Put the startup script in place - debian - template: src='ejabberd-xs.init' + template: src='ejabberd-xs.init' dest='/etc/init.d/ejabberd-xs' when: is_debuntu diff --git a/roles/idmgr/tasks/main.yml b/roles/idmgr/tasks/main.yml index a738d231d..1140ca947 100644 --- a/roles/idmgr/tasks/main.yml +++ b/roles/idmgr/tasks/main.yml @@ -33,7 +33,7 @@ command: /etc/sysconfig/olpc-scripts/setup.d/xs-rsync creates=/etc/xinetd.d/xs-rsyncd -- name: Copy idmgr init script +- name: Copy idmgr init script command: /bin/cp /etc/init.d/idmgr /usr/libexec/idmgr.init creates=/usr/libexec/idmgr.init diff --git a/roles/iiab-admin/tasks/admin-user.yml b/roles/iiab-admin/tasks/admin-user.yml index 13501c681..c08af46bc 100644 --- a/roles/iiab-admin/tasks/admin-user.yml +++ b/roles/iiab-admin/tasks/admin-user.yml @@ -1,8 +1,8 @@ - name: Create iiab-admin user and password - user: name={{ iiab_admin_user }} + user: name={{ iiab_admin_user }} password={{ iiab_admin_passw_hash }} update_password=on_create - + - name: Create a wheel group group: name=wheel state=present @@ -14,7 +14,7 @@ - name: Add user to wheel group user: name={{ iiab_admin_user }} groups=wheel,sudo - + - name: Create root .ssh file: path=/root/.ssh mode=0700 @@ -29,7 +29,7 @@ owner=root group=root mode=0600 - + # backup=yes - name: edit the sudoers file--first make it editable @@ -42,15 +42,14 @@ dest=/etc/sudoers - name: lets wheel sudo without password - lineinfile: + lineinfile: line: "%wheel ALL= NOPASSWD: ALL" dest: /etc/sudoers - name: remove the line which requires tty - lineinfile: regexp=requiretty - state=absent + lineinfile: regexp=requiretty + state=absent dest=/etc/sudoers - + - name: end editing the sudoers file-- protect it again shell: chmod 0440 /etc/sudoers - diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index 25844896a..a93e15cb1 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -4,7 +4,7 @@ with_items: - mongodb-server - mongodb - when: internet_available + when: internet_available tags: - download diff --git a/roles/monit/tasks/main.yml b/roles/monit/tasks/main.yml index 3fb6690b0..26a3c2a7f 100644 --- a/roles/monit/tasks/main.yml +++ b/roles/monit/tasks/main.yml @@ -11,7 +11,7 @@ tags: - download -- name: Update main config file +- name: Update main config file template: backup=yes src=monitrc dest=/etc/monitrc @@ -29,7 +29,7 @@ with_items: watchdog register: monit_config when: false - until: monit_config | success + until: monit_config | success retries: 5 delay: 1 diff --git a/roles/moodle/tasks/main.yml b/roles/moodle/tasks/main.yml index c8cebcf01..f13ef2be0 100644 --- a/roles/moodle/tasks/main.yml +++ b/roles/moodle/tasks/main.yml @@ -16,9 +16,9 @@ - php{{ php_version }}-curl # - php{{ php_version }}-zip - php{{ php_version }}-gd -# - php{{ php_version }}-mbstring +# - php{{ php_version }}-mbstring # mbstring is now included in php-cli - - php{{ php_version }}-cli + - php{{ php_version }}-cli when: is_debuntu - name: php-zip debian 8-9 changed name @@ -54,7 +54,7 @@ mode=0755 state=directory -- name: Create a moodle data dir with apache permission to write +- name: Create a moodle data dir with apache permission to write file: path={{ moodle_data }} owner={{ apache_user }} group={{ apache_user }} @@ -127,7 +127,7 @@ - name: Execute moodle startup script shell: '{{ moodle_base }}/moodle_installer' when: config.stat.exists is defined and not config.stat.exists - + - name: Give apache permission to read config file # command: chown -R {{ apache_user }} {{ moodle_base }} file: path={{ moodle_base }}/config.php diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index 65d963fff..10b65e6b8 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -26,7 +26,7 @@ package: name=php-xml-parser state=present when: is_debian_8 - - name: Install MySQL + - name: Install MySQL package: name={{ item }} state=present with_items: @@ -118,4 +118,3 @@ value: '"mySQL is a widely used database service on the Internet which runs on many platforms, and is often offered and available at hosting Internet Service Providers"' - option: enabled value: "{{ mysql_enabled }}" - diff --git a/roles/network/tasks/avahi.yml b/roles/network/tasks/avahi.yml index 821bd711f..f23e61977 100644 --- a/roles/network/tasks/avahi.yml +++ b/roles/network/tasks/avahi.yml @@ -39,7 +39,7 @@ register: avahi_ver ignore_errors: True changed_when: false - + - name: Grab a clean copy of ssh.service copy: src='/usr/share/doc/{{ avahi_ver.stdout }}/ssh.service' dest='/etc/avahi/services/' diff --git a/roles/network/tasks/debian.yml b/roles/network/tasks/debian.yml index 67cd1722d..a8ef6ce9c 100644 --- a/roles/network/tasks/debian.yml +++ b/roles/network/tasks/debian.yml @@ -1,15 +1,15 @@ # debian.yml -# Start out making simplifying assumptions +# Start out making simplifying assumptions # 1. we are dealing with a rpi3 # 2. Gui inputs define the config -- auto config is more difficult # a. gui_desired_network_role # b. hostapd_enabled -# c. gui_static_wan_ip +# c. gui_static_wan_ip # 3. In appliance mode: wan (and wlan0) is either static or dhcp under br0, and hostapd off # 4. In lan_controller: wan is off, eth0 and wlan0 under br0 # 5. In gateway: eth0 is wan, and wlan0 is under br0 (only one adapter under br0) # 6. As a slight concess to auto config, if eth1 exists, make it wan, and force gateway - + - name: in upgrade from earlier 6.2, delete the resolvconf package: name=resolvconf state=absent @@ -33,7 +33,7 @@ template: dest=/etc/network/interfaces src=network/interfaces.j2 -- name: Copy the bridge script +- name: Copy the bridge script template: dest=/etc/network/interfaces.d/iiab src=network/iiab.j2 register: interface @@ -54,7 +54,7 @@ - name: restart the networking service service: name=networking state=restarted when: interface.changed - + - name: start up hostapd again service: name=hostapd state=started when: interface.changed diff --git a/roles/network/tasks/enable_services.yml b/roles/network/tasks/enable_services.yml index 18075b6dd..60dc795af 100644 --- a/roles/network/tasks/enable_services.yml +++ b/roles/network/tasks/enable_services.yml @@ -99,7 +99,7 @@ enabled=no when: not wondershaper_enabled and wondershaper_install -# check-LAN should be iptables.yml remove later +# check-LAN should be iptables.yml remove later - name: Grab clean copy of iiab-gen-iptables template: src={{ item.0 }} dest={{ item.1 }} diff --git a/roles/network/tasks/ifcfg_mods.yml b/roles/network/tasks/ifcfg_mods.yml index 8b5fa01a1..8add78ffd 100644 --- a/roles/network/tasks/ifcfg_mods.yml +++ b/roles/network/tasks/ifcfg_mods.yml @@ -86,7 +86,7 @@ ignore_errors: True when: iiab_lan_iface != "none" and not installing and not iiab_demo_mode -# we could do the DEVICE name stuff for a cleaner looking nmcli +# we could do the DEVICE name stuff for a cleaner looking nmcli - name: Enabling ifcfg slaves shell: nmcli conn up id "System {{ item|trim }}" ignore_errors: True @@ -95,4 +95,3 @@ - "{{ lan_list_result.stdout_lines }}" # testpoint confirm with 'nmcli c show' 'brctl show' - diff --git a/roles/network/tasks/iptables.yml b/roles/network/tasks/iptables.yml index 4d2bbc078..e9eac5e28 100644 --- a/roles/network/tasks/iptables.yml +++ b/roles/network/tasks/iptables.yml @@ -19,11 +19,11 @@ when: not installing and not is_debuntu - name: Remove iptables.service file from /etc - file: path=/etc/systemd/system/iptables.service + file: path=/etc/systemd/system/iptables.service state=absent - name: Remove iptables-xs.service file from /etc - file: path=/etc/systemd/system/iptables-xs.service + file: path=/etc/systemd/system/iptables-xs.service state=absent - name: Install iptables service package diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 972fe4fde..5e93f5c3f 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -107,7 +107,7 @@ - include: computed_services.yml tags: - network - + - include: enable_services.yml tags: - network diff --git a/roles/network/tasks/named.yml b/roles/network/tasks/named.yml index aad1ed974..a152719aa 100644 --- a/roles/network/tasks/named.yml +++ b/roles/network/tasks/named.yml @@ -68,7 +68,7 @@ template: src=named/{{ dns_service }}.service dest=/etc/systemd/system/{{ dns_service }}.service mode=0644 - + - name: The dns-jail redirect requires the named.blackhole,disabling recursion # in named-iiab.conf, and the redirection of 404 error documents to / template: src=named/dns-jail.conf dest=/etc/{{ apache_config_dir }}/ @@ -77,16 +77,16 @@ - name: Separate enabling required for debian file: src=/etc/{{ apache_config_dir }}/dns-jail.conf path=/etc/{{ apache_service }}/sites-enabled/dns-jail.conf - state=link + state=link when: is_debuntu and dns_jail_enabled - name: Separate enabling/disabling required for debian file: src=/etc/{{ apache_config_dir }}/dns-jail.conf path=/etc/{{ apache_service }}/sites-enabled/dns-jail.conf - state=absent + state=absent when: is_debuntu and not dns_jail_enabled - name: Separate enabling/disabling required for non debian file: path=/etc/{{ apache_config_dir }}/dns-jail.conf - state=absent + state=absent when: not is_debuntu and not dns_jail_enabled diff --git a/roles/network/tasks/redetect.yml b/roles/network/tasks/redetect.yml index 0c3ea1321..afb3138d5 100644 --- a/roles/network/tasks/redetect.yml +++ b/roles/network/tasks/redetect.yml @@ -1,16 +1,16 @@ # The preferred method of disabling the LAN would be to set iiab_lan_enabled: # False before getting here but we are here... -# Well if we got here something changed with the gateway and ifcfg-WAN maybe -# no longer accurate. Note if DEVICE= is any ifcfg files the listed DEVICE -# becomes bound to the NAME in the ifcfg file. With the LAN files out of the +# Well if we got here something changed with the gateway and ifcfg-WAN maybe +# no longer accurate. Note if DEVICE= is any ifcfg files the listed DEVICE +# becomes bound to the NAME in the ifcfg file. With the LAN files out of the # way we can try the interfaces one by one starting with device_gw. # Setting up three way conditions with the results # skipped|changed|failed -# failure results in blowing away the ifcfg-WAN so lets make sure... +# failure results in blowing away the ifcfg-WAN so lets make sure... -# We only got here by way of no detected gateway, lets see if we can pick-up -# transient change like cable issues. +# We only got here by way of no detected gateway, lets see if we can pick-up +# transient change like cable issues. - name: BAD DHCP defaults set_fact: @@ -21,7 +21,7 @@ service: name=dhcpd state=stopped ### clear all connections first -# We should have the LAN torndown at this point. +# We should have the LAN torndown at this point. - name: No ifcfg-WAN known debug: msg="NO WAN known" @@ -34,7 +34,7 @@ - name: Trying wifi first shell: nmcli conn up id {{ ap_name.stdout }} - register: try_wifi + register: try_wifi ignore_errors: yes when: ap_name is defined and ap_named.changed @@ -45,7 +45,7 @@ # We have the DEVICE? - name: Now setting iiab_wan_iface based on wifi - set_fact: + set_fact: iiab_wan_iface: "{{ dhcp_wifi_results.stdout }}" dhcp_good: True when: dhcp_wifi_results.stdout is defined and dhcp_wifi_results.stdout != "" @@ -103,7 +103,7 @@ # We have the DEVICE? - name: Now setting iiab_wan_iface via nmcli - set_fact: + set_fact: iiab_wan_iface: "{{ dhcp_1BY1_results.stdout }}" dhcp_good: True when: dhcp_1BY1_results.stdout is defined and dhcp_1BY1_results.stdout != "" and not has_WAN @@ -138,4 +138,3 @@ set_fact: iiab_lan_iface: "none" when: dhcp_good and adapter_count.stdout|int == "1" - diff --git a/roles/network/tasks/rpi_debian.yml b/roles/network/tasks/rpi_debian.yml index 49cfc20ae..62f627690 100644 --- a/roles/network/tasks/rpi_debian.yml +++ b/roles/network/tasks/rpi_debian.yml @@ -1,15 +1,15 @@ # rpi_debian.yml -# Start out making simplifying assumptions +# Start out making simplifying assumptions # 1. we are dealing with a rpi3 # 2. Gui inputs define the config -- auto config is more difficult # a. gui_desired_network_role # b. hostapd_enabled -# c. gui_static_wan_ip +# c. gui_static_wan_ip # 3. In appliance mode: wan (and wlan0) is either static or dhcp under br0, and hostapd off # 4. In lan_controller: wan is off, eth0 and wlan0 under br0 # 5. In gateway: eth0 is wan, and wlan0 is under br0 (only one adapter under br0) # 6. As a slight concess to auto config, if eth1 exists, make it wan, and force gateway - + - name: Raspbian stock has openresolv which is not available in debian, off it package: name=openresolv state=absent @@ -27,7 +27,7 @@ gui_desired_network_role: "LanController" when: not gui_desired_network_role is defined -- name: Rewrite the /etc/network/interfaces file which we corrupted +- name: Rewrite the /etc/network/interfaces file which we corrupted template: dest=/etc/network/interfaces src=network/interfaces.j2 @@ -35,7 +35,7 @@ template: dest=/etc/dhcpcd.conf src=network/dhcpcd.conf -- name: Copy the network config script +- name: Copy the network config script template: dest=/etc/network/interfaces.d/iiab src=network/iiab.j2 register: interface @@ -53,12 +53,12 @@ ignore_errors: True when: interface.changed -- name: and remove the device +- name: and remove the device command: brctl delbr br0 ignore_errors: True when: interface.changed -- name: reset the eth0 interface +- name: reset the eth0 interface command: ifdown eth0 ignore_errors: True when: interface.changed @@ -66,7 +66,7 @@ - name: restart the networking service service: name=networking state=restarted when: interface.changed - + - name: start up hostapd again service: name=hostapd state=started when: interface.changed diff --git a/roles/nextcloud/tasks/F18.yml b/roles/nextcloud/tasks/F18.yml index 7c5a8be68..a29aea723 100644 --- a/roles/nextcloud/tasks/F18.yml +++ b/roles/nextcloud/tasks/F18.yml @@ -5,7 +5,7 @@ # but we use the tar file to get the latest version; really only benefits the xo4 on fedora 18 - name: Get the nextcloud software get_url: url="{{ nextcloud_dl_url }}"/{{ nextcloud_src_file }} dest={{ downloads_dir }}/{{ nextcloud_src_file }} - when: internet_available + when: internet_available - name: Copy it to permanent location /opt unarchive: src={{ downloads_dir }}/{{ nextcloud_src_file }} dest=/opt/ diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml index de2114ca7..6536e7da5 100644 --- a/roles/nextcloud/tasks/main.yml +++ b/roles/nextcloud/tasks/main.yml @@ -10,7 +10,7 @@ - name: Get the nextcloud software get_url: url={{ nextcloud_dl_url }}/{{ nextcloud_src_file }} dest={{ downloads_dir }}/{{ nextcloud_src_file }} - when: internet_available + when: internet_available async: 900 poll: 15 tags: @@ -138,4 +138,3 @@ value: "{{ nextcloud_src_file }}" - option: enabled value: "{{ nextcloud_enabled }}" - diff --git a/roles/nextcloud/tasks/nextcloud_enabled.yml b/roles/nextcloud/tasks/nextcloud_enabled.yml index 523ced972..cc9c26b2c 100644 --- a/roles/nextcloud/tasks/nextcloud_enabled.yml +++ b/roles/nextcloud/tasks/nextcloud_enabled.yml @@ -29,8 +29,8 @@ # the install wizard does not succeed if already installed - name: Determine if nextcloud is installed shell: > - sudo -u {{ apache_user }} php - '{{ nextcloud_prefix }}/nextcloud/occ' status | + sudo -u {{ apache_user }} php + '{{ nextcloud_prefix }}/nextcloud/occ' status | gawk '/installed:/ { print $3 }' register: returned diff --git a/roles/openvpn/tasks/main.yml b/roles/openvpn/tasks/main.yml index 3ec22116f..8f974abbf 100644 --- a/roles/openvpn/tasks/main.yml +++ b/roles/openvpn/tasks/main.yml @@ -16,7 +16,7 @@ group=root mode=0755 -- name: Create the directory for scripts +- name: Create the directory for scripts file: dest=/etc/openvpn/scripts state=directory owner=root diff --git a/roles/owncloud/tasks/main.yml b/roles/owncloud/tasks/main.yml index 9b56a568d..5a220771b 100644 --- a/roles/owncloud/tasks/main.yml +++ b/roles/owncloud/tasks/main.yml @@ -11,7 +11,7 @@ register: owncloud_page - name: Install owncloud package - package: name={{ item }} + package: name={{ item }} state=present with_items: - curl @@ -40,19 +40,19 @@ - name: Get the owncloud software get_url: url={{ iiab_download_url }}/{{ owncloud_src_file }} dest={{ downloads_dir }}/{{ owncloud_src_file }} - when: internet_available + when: internet_available async: 300 poll: 5 - name: Copy it to permanent location /opt - unarchive: src={{ downloads_dir }}/{{ owncloud_src_file }} + unarchive: src={{ downloads_dir }}/{{ owncloud_src_file }} dest={{ owncloud_prefix }} creates={{ owncloud_prefix }}/owncloud/version.php when: not is_F18 # ansible 1.4.1 does not have "creates" - name: Copy it to permanent location /opt - unarchive: src={{ downloads_dir }}/{{ owncloud_src_file }} + unarchive: src={{ downloads_dir }}/{{ owncloud_src_file }} dest={{ owncloud_prefix }} when: is_F18 diff --git a/roles/owncloud/tasks/owncloud_enabled.yml b/roles/owncloud/tasks/owncloud_enabled.yml index f3ee392b2..b7a47c05a 100644 --- a/roles/owncloud/tasks/owncloud_enabled.yml +++ b/roles/owncloud/tasks/owncloud_enabled.yml @@ -33,4 +33,3 @@ lineinfile: regexp='overwrite.cli.url' state=absent dest="{{ owncloud_prefix }}/owncloud/config/config.php" - diff --git a/roles/pathagar/tasks/main.yml b/roles/pathagar/tasks/main.yml index de8411b33..3ee3308e8 100644 --- a/roles/pathagar/tasks/main.yml +++ b/roles/pathagar/tasks/main.yml @@ -1,5 +1,5 @@ - name: Remove if exist pathagar rpm version - package: name=pathagar + package: name=pathagar state=absent - name: Install pathagar pre requisites (both fedora and debian) diff --git a/roles/phpmyadmin/tasks/main.yml b/roles/phpmyadmin/tasks/main.yml index fc7e6e317..bd7616799 100644 --- a/roles/phpmyadmin/tasks/main.yml +++ b/roles/phpmyadmin/tasks/main.yml @@ -1,6 +1,6 @@ - name: Get the phpmyadmin software get_url: url="{{ iiab_download_url }}/{{ phpMyAdmin }}" dest="{{ downloads_dir}}/phpMyAdmin.zip" - when: internet_available + when: internet_available - name: Copy it to permanent location /opt unarchive: src={{ downloads_dir }}/phpMyAdmin.zip dest=/opt/ diff --git a/roles/samba/tasks/main.yml b/roles/samba/tasks/main.yml index 06ab47a02..7a0ef3fc3 100755 --- a/roles/samba/tasks/main.yml +++ b/roles/samba/tasks/main.yml @@ -10,7 +10,7 @@ # Install and configure samba server (requires ports 137, 138, 139, 445 open). - name: Ensure Samba-related packages are installed. - package: name={{ item }} + package: name={{ item }} state=present with_items: - samba @@ -26,25 +26,25 @@ - name: Ensure Samba is running and set to start on boot. service: name={{ smb_service }} state=started enabled=yes - tags: + tags: - samba when : samba_enabled - name: netbios name server is running and set to start on boot. service: name={{ nmb_service }} state=started enabled=yes - tags: + tags: - samba when : samba_enabled - name: Disable Samba if that is wanted service: name={{ smb_service }} state=stopped enabled=no - tags: + tags: - samba when : not samba_enabled - name: Disable Samba name server if that is wanted service: name={{ nmb_service }} state=stopped enabled=no - tags: + tags: - samba when : not samba_enabled @@ -60,4 +60,3 @@ value: '"Samba is a Microsoft compatible remote file access system - generalized to CIFS --common internet file system"' - option: enabled value: "{{ samba_enabled }}" - diff --git a/roles/sshd/tasks/main.yml b/roles/sshd/tasks/main.yml index b2092ced6..560774ff3 100644 --- a/roles/sshd/tasks/main.yml +++ b/roles/sshd/tasks/main.yml @@ -1,4 +1,4 @@ -- name: Disable root login with password +- name: Disable root login with password lineinfile: dest=/etc/ssh/sshd_config regexp='^PermitRootLogin' line='PermitRootLogin without-password' diff --git a/roles/sugar-stats/tasks/main.yml b/roles/sugar-stats/tasks/main.yml index d972a146b..c42d6ef7f 100644 --- a/roles/sugar-stats/tasks/main.yml +++ b/roles/sugar-stats/tasks/main.yml @@ -32,13 +32,13 @@ service: name=sugar-stats-server enabled=yes when: sugar_stats_enabled - + - name: Disable sugar-stats service service: name=sugar-stats-server enabled=no when: not sugar_stats_enabled - -- include: statistics-consolidation.yml + +- include: statistics-consolidation.yml - name: Add sugar-stats to service list ini_file: dest='{{ service_filelist }}' diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index bc41f0977..507c6afed 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -1,7 +1,7 @@ - name: Download the latest stable version of sugarizer from location under our control get_url: url={{ iiab_download_url }}/{{ sugarizer_version }}.tar.gz dest={{ downloads_dir }}/{{ sugarizer_version }}.tar.gz - + #fixme - name: Untar it to target location command: tar xzf {{ downloads_dir }}/{{ sugarizer_version }}.tar.gz -C {{ sugarizer_location }} @@ -41,7 +41,7 @@ npm_exists: True when: npm.stat.exists is defined and npm.stat.exists -- name: Create systemd files and copy our ini file +- name: Create systemd files and copy our ini file template: src={{ item.src }} dest={{ item.dest }} owner=root @@ -60,14 +60,14 @@ - name: Create the express framework for node.js - ALL less F18 shell: npm install args: - chdir: "{{ sugarizer_location }}/sugarizer/server" + chdir: "{{ sugarizer_location }}/sugarizer/server" creates: "{{ sugarizer_location }}/sugarizer/server/node_modules" when: not is_F18 and not npm_exists - name: Create the express framework for node.js - F18 shell: npm install args: - chdir: "{{ sugarizer_location }}/sugarizer/server" + chdir: "{{ sugarizer_location }}/sugarizer/server" when: is_F18 and not npm_exists - name: enable services - All @@ -95,6 +95,6 @@ - option: name value: Sugarizer - option: description - value: '"The Sugar Learning Platform is a leading learning platform that began in the famous One Laptop Per Child project. Sugarizer is a web implementation of that platform"' + value: '"The Sugar Learning Platform is a leading learning platform that began in the famous One Laptop Per Child project. Sugarizer is a web implementation of that platform"' - option: enabled value: "{{ sugarizer_enabled }}" diff --git a/roles/teamviewer/tasks/install.yml b/roles/teamviewer/tasks/install.yml index 9e8a6d325..93ef6f234 100644 --- a/roles/teamviewer/tasks/install.yml +++ b/roles/teamviewer/tasks/install.yml @@ -18,21 +18,21 @@ - download - name: Install X Windows on CentOS - shell: yum groupinstall -y "Server with GUI" + shell: yum groupinstall -y "Server with GUI" when: internet_available and ansible_distribution == "CentOS" tags: - download -- name: Get the teamviewer software +- name: Get the teamviewer software get_url: url="{{ teamviewer_url }}/{{ teamviewer_rpm_file }}" dest="{{ yum_packages_dir }}/{{ teamviewer_rpm_file }}" - when: internet_available + when: internet_available tags: - download # F22 has issues with yum localinstall exclude for now - name: Do the install of teamviewer, pulling in any required dependencies shell: "yum localinstall -y {{ yum_packages_dir }}/{{ teamviewer_rpm_file }}" - when: teamviewer_install and internet_available + when: teamviewer_install and internet_available and xo_model == "none" and ansible_distribution_version <= "21" - name: making local copy available @@ -45,4 +45,3 @@ with_items: - teamviewer* when: teamviewer_install and xo_model == "none" and ansible_distribution_version >= "22" - diff --git a/roles/usb-lib/tasks/main.yml b/roles/usb-lib/tasks/main.yml index f82cb1f2c..3d4aee182 100644 --- a/roles/usb-lib/tasks/main.yml +++ b/roles/usb-lib/tasks/main.yml @@ -34,24 +34,24 @@ - name: Add apache config for content directory template: src=content_dir.conf dest=/etc/{{ apache_config_dir }} - when: usb_lib_enabled + when: usb_lib_enabled - name: create the link to enable for debian file: src=/etc/{{ apache_config_dir }}/content_dir.conf dest=/etc/apache2/sites-enabled/content_dir.conf state=link when: is_debuntu - + - name: remove the link that enables in debian file: src=/etc/{{ apache_config_dir }}/content_dir.conf dest=/etc/apache2/sites-enabled/content_dir.conf state=absent when: is_debuntu and not usb_lib_enabled - + - name: remove apache config for content directory file: name=/etc/{{ apache_config_dir }}/content_dir.conf state=absent - when: not usb_lib_enabled + when: not usb_lib_enabled - name: Add usb-lib to service list ini_file: dest='{{ service_filelist }}' diff --git a/roles/vnstat/tasks/main.yml b/roles/vnstat/tasks/main.yml index 7a37a67cc..2cfce0b0c 100644 --- a/roles/vnstat/tasks/main.yml +++ b/roles/vnstat/tasks/main.yml @@ -8,10 +8,10 @@ - download - name: put the config file in place - template: src=vnstat.conf.j2 - dest=/etc/vnstat.conf - mode=0744 - owner=root + template: src=vnstat.conf.j2 + dest=/etc/vnstat.conf + mode=0744 + owner=root group=root - name: create database for wan to collect vnstat data diff --git a/roles/wordpress/tasks/install.yml b/roles/wordpress/tasks/install.yml index 2e162b872..37471e929 100644 --- a/roles/wordpress/tasks/install.yml +++ b/roles/wordpress/tasks/install.yml @@ -1,7 +1,7 @@ - name: Get the WordPress software get_url: url="{{ wordpress_download_base_url }}/{{ wordpress_src }}" dest={{ downloads_dir}}/ register: wp_download_output - when: internet_available + when: internet_available - name: Copy it to permanent location /library unarchive: src={{ wp_download_output.dest }} dest=/library