diff --git a/roles/2-common/tasks/iptables.yml b/roles/2-common/tasks/iptables.yml index 7a1729b77..7163c0a62 100644 --- a/roles/2-common/tasks/iptables.yml +++ b/roles/2-common/tasks/iptables.yml @@ -26,38 +26,31 @@ path: /etc/systemd/system/iptables.service state: absent -#- name: Remove iptables-xs.service file from /etc -# file: -# path: /etc/systemd/system/iptables-xs.service -# state: absent - - name: Install package iptables-persistent (debuntu) package: name: iptables-persistent state: present when: is_debuntu | bool - tags: - - download + #tags: download - name: Install package iptables-services (OS's other than debuntu) package: name: iptables-services state: present when: not is_debuntu - tags: - - download + #tags: download - name: Install /etc/sysconfig/iptables-config from template template: src: iptables-config dest: /etc/sysconfig/iptables-config - owner: root - group: root - mode: 0644 + # owner: root + # group: root + # mode: '0644' - name: Install /etc/network/if-pre-up.d/iptables from template (debuntu) template: src: iptables dest: /etc/network/if-pre-up.d/iptables - mode: 0755 + mode: '0755' when: is_debuntu | bool diff --git a/roles/2-common/tasks/xo.yml b/roles/2-common/tasks/xo.yml index 299f3d0db..185f22949 100644 --- a/roles/2-common/tasks/xo.yml +++ b/roles/2-common/tasks/xo.yml @@ -132,17 +132,16 @@ with_items: - hostapd_8188_i386 when: wifi_id == "tplink_WM725M" and xo_model == "XO-1.5" and internet_available - tags: - - xo + #tags: xo - name: Put the substitute in place copy: src: "{{ downloads_dir }}/hostapd_8188_i386" dest: /usr/sbin/hostapd backup: yes - mode: 0775 - owner: root - group: root + # owner: root + # group: root + mode: '0775' when: wifi_id == "tplink_WM725M" and xo_model == "XO-1.5" - name: Reboot system diff --git a/roles/all-vars/tasks/main.yml b/roles/all-vars/tasks/main.yml index 6ad04676b..19f42a49f 100644 --- a/roles/all-vars/tasks/main.yml +++ b/roles/all-vars/tasks/main.yml @@ -11,4 +11,4 @@ debug: msg: "{{ msg.split('\n') }}" - tags: debug_info + #tags: debug_info diff --git a/roles/awstats/tasks/main.yml b/roles/awstats/tasks/main.yml index b249b6a22..70c42ece4 100644 --- a/roles/awstats/tasks/main.yml +++ b/roles/awstats/tasks/main.yml @@ -1,7 +1,7 @@ - name: Install AWStats if awstats_install include_tasks: install.yml - when: awstats_install | bool and not awstats_installed is defined + when: awstats_install and not awstats_installed is defined - name: Enable AWStats include_tasks: enable.yml - when: awstats_install | bool or awstats_installed is defined + when: awstats_install or awstats_installed is defined diff --git a/roles/azuracast/tasks/main.yml b/roles/azuracast/tasks/main.yml index efa0fe446..6b3fb0d5f 100644 --- a/roles/azuracast/tasks/main.yml +++ b/roles/azuracast/tasks/main.yml @@ -1,8 +1,8 @@ - name: Install AzuraCast if azuracast_install include_tasks: install.yml - when: azuracast_install | bool and not azuracast_installed is defined | bool + when: azuracast_install and not azuracast_installed is defined | bool # TODO figure out what to turn off for azuracast #- name: Enable AzuraCast # include_tasks: enable.yml -# when: azuracast_install | bool or azuracast_installed is defined | bool +# when: azuracast_install or azuracast_installed is defined | bool diff --git a/roles/calibre-web/tasks/enable.yml b/roles/calibre-web/tasks/enable.yml index af38393c7..59d4db6cb 100644 --- a/roles/calibre-web/tasks/enable.yml +++ b/roles/calibre-web/tasks/enable.yml @@ -66,7 +66,7 @@ - option: name value: calibre-web - option: description - value: '"calibre-web is a web app providing a clean interface for browsing, reading and downloading e-books."' + value: '"Calibre-Web is a web app providing a clean interface for browsing, reading and downloading e-books."' - option: calibreweb_url1 value: "{{ calibreweb_url1 }}" - option: calibreweb_url2 diff --git a/roles/cups/tasks/main.yml b/roles/cups/tasks/main.yml index 03b6b5edf..46f5959a6 100644 --- a/roles/cups/tasks/main.yml +++ b/roles/cups/tasks/main.yml @@ -4,8 +4,7 @@ name: cups state: present when: cups_install | bool - tags: - - download + #tags: download - name: Install our own /etc/cups/cupsd.conf from template, to permit local LAN admin template: diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index d5dcb409b..4bb4fcfa6 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -5,7 +5,7 @@ - docker - python-docker-py when: docker_install | bool - tags: download + #tags: download - name: put the systemd startup file in place template: src=docker.service diff --git a/roles/dokuwiki/tasks/main.yml b/roles/dokuwiki/tasks/main.yml index ad5ba75a7..4ed805b2a 100644 --- a/roles/dokuwiki/tasks/main.yml +++ b/roles/dokuwiki/tasks/main.yml @@ -1,7 +1,7 @@ - name: Install DokuWiki include_tasks: install.yml - when: dokuwiki_install | bool and not dokuwiki_installed is defined + when: dokuwiki_install and not dokuwiki_installed is defined - name: Enable DokuWiki include_tasks: enable.yml - when: dokuwiki_install | bool or dokuwiki_installed is defined + when: dokuwiki_install or dokuwiki_installed is defined diff --git a/roles/ejabberd/tasks/main.yml b/roles/ejabberd/tasks/main.yml index 5818ac4e0..470216c8a 100644 --- a/roles/ejabberd/tasks/main.yml +++ b/roles/ejabberd/tasks/main.yml @@ -2,8 +2,7 @@ package: name: ejabberd state: present - tags: - - download + #tags: download #- name: Configure ejabberd # template: diff --git a/roles/ejabberd_xs/tasks/main.yml b/roles/ejabberd_xs/tasks/main.yml index e73ecf7eb..36a58d160 100644 --- a/roles/ejabberd_xs/tasks/main.yml +++ b/roles/ejabberd_xs/tasks/main.yml @@ -3,8 +3,7 @@ state=present with_items: - ejabberd-2.1.11 - tags: - - download + #tags: download when: not is_debuntu # need to use lineinfile and better regexp diff --git a/roles/gitea/tasks/enable.yml b/roles/gitea/tasks/enable.yml index 6e1dd8993..5b706a14e 100644 --- a/roles/gitea/tasks/enable.yml +++ b/roles/gitea/tasks/enable.yml @@ -60,7 +60,7 @@ - option: name value: gitea - option: description - value: '"Gitea: Git with a cup of tea"' + value: '"Gitea is like GitHub for more offline communities: Git with a cup of tea"' - option: gitea_run_directory value: "{{ gitea_run_directory }}" - option: gitea_url diff --git a/roles/gitea/tasks/install.yml b/roles/gitea/tasks/install.yml index 66d08e5a5..e06c1c68b 100644 --- a/roles/gitea/tasks/install.yml +++ b/roles/gitea/tasks/install.yml @@ -4,16 +4,14 @@ systemd: name: gitea state: stopped - tags: - - pre-install + #tags: pre-install ignore_errors: yes - name: Ensure group gitea exists group: name: gitea state: present - tags: - - pre-install + #tags: pre-install - name: Create user gitea user: @@ -21,8 +19,7 @@ comment: Gitea daemon account groups: gitea home: "{{ gitea_home }}" - tags: - - pre-install + #tags: pre-install - name: Create Gitea directory structure file: @@ -31,19 +28,17 @@ owner: gitea group: gitea with_items: "{{ gitea_subdirectories }}" - tags: - - pre-install + #tags: pre-install - name: Make directories data, indexers, and log writable file: path: "{{ gitea_root_directory }}/{{ item }}" - mode: 0750 + mode: '0750' with_items: - data - indexers - log - tags: - - pre-install + #tags: pre-install # Download, verify, and link Gitea binary @@ -56,27 +51,22 @@ get_url: url: "{{ gitea_download_url }}" dest: "{{ gitea_install_path }}" - mode: 0775 - tags: - - install + mode: '0775' + #tags: install when: internet_available | bool - name: Download Gitea GPG signature get_url: url: "{{ gitea_integrity_url }}" dest: "{{ gitea_checksum_path }}" - tags: - - never - - verify + #tags: never, verify when: internet_available | bool - name: Verify Gitea binary with GPG signature shell: | gpg --keyserver pgp.mit.edu --recv {{ gitea_gpg_key }} gpg --verify {{ gitea_checksum_path }} {{ gitea_install_path }} - tags: - - never - - verify + #tags: never, verify ignore_errors: yes - name: Link Gitea @@ -86,8 +76,7 @@ owner: gitea group: gitea state: link - tags: - - install + #tags: install # Configure Gitea @@ -102,9 +91,8 @@ state: directory owner: root group: gitea - mode: 0770 - tags: - - config + mode: '0770' + #tags: config - name: Create app.ini template: @@ -112,7 +100,7 @@ dest: /etc/gitea/app.ini owner: root group: gitea - mode: 0664 + mode: '0664' # Create systemd service & prepare Apache for http://box/gitea diff --git a/roles/httpd/tasks/install.yml b/roles/httpd/tasks/install.yml index 16b1afb94..eed2b7ded 100644 --- a/roles/httpd/tasks/install.yml +++ b/roles/httpd/tasks/install.yml @@ -8,8 +8,7 @@ - "php{{ php_version }}-curl" state: present when: is_debian | bool - tags: - - download + #tags: download - name: 'Install 2 packages: apache2, php (ubuntu)' package: @@ -20,8 +19,7 @@ - php state: present when: is_ubuntu | bool - tags: - - download + #tags: download # 2019-05-30: It's interesting that http://box.lan/admin and everything seems # to work even without php{{ php_version }}-sqlite3 as confirmed on Ubuntu @@ -52,8 +50,7 @@ - php-curl state: present when: is_redhat | bool - tags: - - download + #tags: download # remove symlinks for mpm-event, replace with mpm-prefork - name: Remove both mpm_event symlinks from /etc/apache2/mods-enabled (debuntu) diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index 1028f0096..fe2a8e047 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -1,18 +1,15 @@ - include_tasks: install.yml - tags: - - base + #tags: base - include_tasks: html.yml - tags: - - base + #tags: base # Partially fixes search @ http://box/modules/es-wikihow (on RPi anyway) see https://github.com/iiab/iiab/issues/829 - include_tasks: php-stem.yml - tags: - - base + #tags: base - name: Install /usr/bin/iiab-refresh-wiki-docs (scraper script) to create http://box/info offline documentation. (Script can be run manually and/or at the end of Stage 4 = roles/4-server-options/tasks/main.yml) template: src: refresh-wiki-docs.sh dest: /usr/bin/iiab-refresh-wiki-docs - mode: 0755 + mode: '0755' diff --git a/roles/idmgr/tasks/main.yml b/roles/idmgr/tasks/main.yml index b3e5465f3..464c32762 100644 --- a/roles/idmgr/tasks/main.yml +++ b/roles/idmgr/tasks/main.yml @@ -7,8 +7,7 @@ - xinetd - xs-rsync - incron - tags: - - download + #tags: download - name: Configure idmgr template: backup=yes diff --git a/roles/iiab-admin/tasks/access.yml b/roles/iiab-admin/tasks/access.yml index c09fd503f..776f420d7 100644 --- a/roles/iiab-admin/tasks/access.yml +++ b/roles/iiab-admin/tasks/access.yml @@ -4,5 +4,4 @@ - screen - lynx state: present - tags: - - download + #tags: download diff --git a/roles/iiab-admin/tasks/main.yml b/roles/iiab-admin/tasks/main.yml index ad72350a2..38a673a2b 100644 --- a/roles/iiab-admin/tasks/main.yml +++ b/roles/iiab-admin/tasks/main.yml @@ -1,11 +1,9 @@ - include_tasks: admin-user.yml - tags: - - base + #tags: base when: iiab_admin_user_install | bool - include_tasks: access.yml - tags: - - base + #tags: base - name: Add 'iiab-admin' variable values to {{ iiab_ini_file }} ini_file: @@ -25,7 +23,7 @@ template: src: sshpwd-profile-iiab.sh dest: /etc/profile.d/ - mode: 0644 + mode: '0644' - name: Is this LXDE-pi? stat: @@ -36,7 +34,7 @@ template: src: sshpwd-lxde-iiab.sh dest: /etc/xdg/lxsession/LXDE-pi/ - mode: 0755 + mode: '0755' when: lx.stat.isdir is defined and lx.stat.isdir and is_rpi and is_debuntu # 2019-03-07: This popup (/etc/xdg/lxsession/LXDE-pi/sshpwd-lxde-iiab.sh) does diff --git a/roles/kolibri/tasks/main.yml b/roles/kolibri/tasks/main.yml index 135287181..34b9d9c81 100644 --- a/roles/kolibri/tasks/main.yml +++ b/roles/kolibri/tasks/main.yml @@ -1,7 +1,7 @@ - name: Install Kolibri include_tasks: install.yml - when: kolibri_install | bool and not kolibri_installed is defined + when: kolibri_install and not kolibri_installed is defined - name: Enable Kolibri include_tasks: enable.yml - when: kolibri_install | bool or kolibri_installed is defined + when: kolibri_install or kolibri_installed is defined diff --git a/roles/lokole/tasks/main.yml b/roles/lokole/tasks/main.yml index 159a92485..cd33c7692 100644 --- a/roles/lokole/tasks/main.yml +++ b/roles/lokole/tasks/main.yml @@ -1,7 +1,7 @@ - name: Install Lokole {{ lokole_version }} if lokole_install include_tasks: install.yml - when: lokole_install | bool and not lokole_installed is defined + when: lokole_install and not lokole_installed is defined - name: Enable Lokole include_tasks: enable.yml - when: lokole_install | bool or lokole_installed is defined + when: lokole_install or lokole_installed is defined diff --git a/roles/mediawiki/tasks/enable.yml b/roles/mediawiki/tasks/enable.yml index 33efcd89d..5f531f697 100644 --- a/roles/mediawiki/tasks/enable.yml +++ b/roles/mediawiki/tasks/enable.yml @@ -45,7 +45,7 @@ - option: name value: mediawiki - option: description - value: '"mediawiki is a blog and web site management application."' + value: '"MediaWiki is a blog and web site management application, from the people who create Wikipedia."' - option: mediawiki_src value: "{{ mediawiki_src }}" - option: mediawiki_abs_path diff --git a/roles/mediawiki/tasks/main.yml b/roles/mediawiki/tasks/main.yml index d3565e63d..df4bbcc74 100644 --- a/roles/mediawiki/tasks/main.yml +++ b/roles/mediawiki/tasks/main.yml @@ -5,4 +5,3 @@ - name: Enable MediaWiki include_tasks: enable.yml when: mediawiki_install or mediawiki_installed is defined - # when: mediawiki_enabled | bool diff --git a/roles/mongodb/tasks/install.yml b/roles/mongodb/tasks/install.yml index a7959ce66..06ebf6eb6 100644 --- a/roles/mongodb/tasks/install.yml +++ b/roles/mongodb/tasks/install.yml @@ -7,8 +7,7 @@ - mongodb # 2019-01-31: this package does not exist on (cannot be installed on) Debian 10, SEE #1437 state: present when: internet_available and not is_rpi - tags: - - download + #tags: download # 2019-02-02: Sugarizer with Node.js 10.x requires MongoDB 2.6+ so # https://andyfelong.com/2017/08/mongodb-3-0-14-for-raspbian-stretch/ diff --git a/roles/monit/tasks/install.yml b/roles/monit/tasks/install.yml index 42a9e396f..ea3454853 100644 --- a/roles/monit/tasks/install.yml +++ b/roles/monit/tasks/install.yml @@ -2,16 +2,14 @@ package: name: monit state: present - tags: - - download + #tags: download - name: Install chkconfig package (debian-8) package: name: chkconfig state: present when: is_debian and ansible_distribution_major_version == "8" - tags: - - download + #tags: download - name: Install /etc/monitrc from template template: @@ -20,7 +18,7 @@ dest: /etc/monitrc owner: root group: root - mode: 0600 + mode: '0600' # - name: Install config file /etc/monit.d/watchdog from template (NEVER RUNS, WHY?) # template: @@ -29,7 +27,7 @@ # owner: root # group: root # force: yes -# mode: 0755 +# mode: '0755' # register: monit_config # when: False # IS THIS A BUG ? # until: monit_config | success diff --git a/roles/moodle/tasks/main.yml b/roles/moodle/tasks/main.yml index baadf93c4..9665f3d6d 100644 --- a/roles/moodle/tasks/main.yml +++ b/roles/moodle/tasks/main.yml @@ -1,7 +1,7 @@ - name: "Install Moodle" include_tasks: install.yml - when: moodle_install | bool and not moodle_installed is defined + when: moodle_install and not moodle_installed is defined - name: Enable Moodle include_tasks: enable.yml - when: moodle_install | bool or moodle_installed is defined + when: moodle_install or moodle_installed is defined diff --git a/roles/mosquitto/tasks/install.yml b/roles/mosquitto/tasks/install.yml index 890b4ec15..6d1d0f062 100644 --- a/roles/mosquitto/tasks/install.yml +++ b/roles/mosquitto/tasks/install.yml @@ -5,7 +5,7 @@ with_items: - mosquitto - mosquitto-clients - tags: download + #tags: download - name: Disable & Stop 'mosquitto' service systemd: @@ -17,7 +17,7 @@ file: path: /etc/mosquitto/passwd state: touch - mode: "u=rw,g=r,o=r" # 0644 + mode: "u=rw,g=r,o=r" # '0644' - name: Populate /etc/mosquitto/passwd with actual username/password shell: mosquitto_passwd -b /etc/mosquitto/passwd "{{ mosquitto_user }}" "{{ mosquitto_password }}" @@ -28,7 +28,7 @@ dest: /etc/mosquitto/conf.d/websockets.conf owner: root group: root - mode: 0755 + mode: '0755' - name: "Add 'mosquitto_installed: True' to {{ iiab_state_file }}" lineinfile: diff --git a/roles/mosquitto/tasks/main.yml b/roles/mosquitto/tasks/main.yml index b6654ef3b..61bcf25e9 100644 --- a/roles/mosquitto/tasks/main.yml +++ b/roles/mosquitto/tasks/main.yml @@ -1,5 +1,5 @@ - include_tasks: install.yml - when: mosquitto_install | bool and not mosquitto_installed is defined + when: mosquitto_install and not mosquitto_installed is defined - include_tasks: enable.yml - when: mosquitto_install | bool or mosquitto_installed is defined + when: mosquitto_install or mosquitto_installed is defined diff --git a/roles/munin/tasks/enable.yml b/roles/munin/tasks/enable.yml index 68293fa7c..81420cbcb 100644 --- a/roles/munin/tasks/enable.yml +++ b/roles/munin/tasks/enable.yml @@ -1,54 +1,54 @@ -- name: If MySQL is enabled, let Munin monitor it - copy: - src: "{{ item }}" - dest: /etc/munin/plugins/ - with_items: - - /usr/share/munin/plugins/mysql_ - - /usr/share/munin/plugins/mysql_bytes - - /usr/share/munin/plugins/mysql_innodb - - /usr/share/munin/plugins/mysql_isam_space_ - - /usr/share/munin/plugins/mysql_queries - - /usr/share/munin/plugins/mysql_slowqueries - - /usr/share/munin/plugins/mysql_threads - when: mysql_enabled | bool - -- name: Enable & Start munin-node systemd service +- name: Enable & Start 'munin-node' systemd service systemd: name: munin-node + daemon_reload: yes enabled: yes state: started when: munin_enabled | bool -- name: Disable munin-node service if not munin_enabled +- name: Disable 'munin-node' systemd service systemd: name: munin-node enabled: no state: stopped when: not munin_enabled -- name: Create symlink munin24.conf from sites-enabled to sites-available (debuntu) - file: - src: /etc/apache2/sites-available/munin24.conf - path: /etc/apache2/sites-enabled/munin24.conf - state: link - when: munin_enabled and not nginx_enabled +# Apache -- name: Remove symlink /etc/apache2/sites-enabled/munin24.conf if not munin_enabled (debuntu) - file: - path: /etc/apache2/sites-enabled/munin24.conf - state: absent - when: not munin_enabled or nginx_enabled +- name: Enable http://box/munin via Apache + command: a2ensite munin24.conf + when: apache_install and munin_enabled # and not nginx_enabled -- name: Install /etc/nginx/conf.d/munin24-nginx.conf, from templates +- name: Disable http://box/munin via Apache + command: a2dissite munin24.conf + when: apache_install and not munin_enabled # or nginx_enabled + +- name: Restart Apache systemd service ({{ apache_service }}) + systemd: + name: "{{ apache_service }}" # apache2 or httpd, as set in /opt/iiab/iiab/vars/.yml + state: restarted + when: apache_enabled | bool + +# NGINX + +- name: Enable http://box/munin via NGINX, by installing {{ nginx_config_dir }}/munin24-nginx.conf from template template: - src: "{{ item.src }}" - dest: "{{ item.dest }}" - owner: root - group: root - mode: 0644 - with_items: - - { src: 'munin24-nginx.conf.j2', dest: '/etc/nginx/conf.d/munin24-nginx.conf' } - when: munin_enabled | bool and nginx_enabled | bool + src: munin24-nginx.conf.j2 + dest: "{{ nginx_config_dir }}/munin24-nginx.conf" # /etc/nginx/conf.d + when: munin_enabled and nginx_enabled + +- name: Disable http://box/munin via NGINX, by installing {{ nginx_config_dir }}/munin24-nginx.conf + file: + path: "{{ nginx_config_dir }}/munin24-nginx.conf" # /etc/nginx/conf.d + state: absent + when: not munin_enabled + +- name: Restart 'nginx' systemd service + systemd: + name: nginx + state: restarted + when: nginx_enabled | bool + - name: Add 'munin' variable values to {{ iiab_ini_file }} ini_file: @@ -60,7 +60,7 @@ - option: name value: Munin - option: description - value: '"Munin is a networked resource monitoring tool that can help analyze resource trends and \"what just happened to kill our performance?\" problems."' + value: '"Munin is a networked resource monitoring tool that can help analyze resource trends and ''what just happened to kill our performance?'' problems."' - option: installed value: "{{ munin_install }}" - option: enabled diff --git a/roles/munin/tasks/install.yml b/roles/munin/tasks/install.yml index 5f228618d..03e32e423 100644 --- a/roles/munin/tasks/install.yml +++ b/roles/munin/tasks/install.yml @@ -7,8 +7,7 @@ - libcgi-fast-perl - libapache2-mod-fcgid state: present - tags: - - download + #tags: download when: is_debuntu | bool - name: "Install 2 packages: munin, munin-node (OS's other than debuntu)" @@ -17,17 +16,16 @@ - munin - munin-node state: present - tags: - - download + #tags: download when: not is_debuntu - name: Install /etc/munin/munin.conf and Apache's munin24.conf, from templates template: src: "{{ item.src }}" dest: "{{ item.dest }}" - owner: root - group: root - mode: 0644 + # owner: root + # group: root + # mode: 0644 with_items: - { src: 'munin.conf.j2', dest: '/etc/munin/munin.conf' } - { src: 'munin24.conf.j2', dest: '/etc/{{ apache_config_dir }}/munin24.conf' } @@ -37,8 +35,20 @@ path: /etc/munin/munin-htpasswd name: Admin password: changeme - create: yes - state: present + +- name: If MySQL is enabled, let Munin monitor it + copy: + src: "{{ item }}" + dest: /etc/munin/plugins/ + with_items: + - /usr/share/munin/plugins/mysql_ + - /usr/share/munin/plugins/mysql_bytes + - /usr/share/munin/plugins/mysql_innodb + - /usr/share/munin/plugins/mysql_isam_space_ + - /usr/share/munin/plugins/mysql_queries + - /usr/share/munin/plugins/mysql_slowqueries + - /usr/share/munin/plugins/mysql_threads + when: mysql_enabled | bool - name: "Add 'munin_installed: True' to {{ iiab_state_file }}" lineinfile: diff --git a/roles/munin/tasks/main.yml b/roles/munin/tasks/main.yml index 7a0857f42..860cc0cc3 100644 --- a/roles/munin/tasks/main.yml +++ b/roles/munin/tasks/main.yml @@ -1,7 +1,7 @@ - name: Install munin include_tasks: install.yml - when: munin_install | bool and not munin_installed is defined + when: munin_install and not munin_installed is defined - name: Enable munin include_tasks: enable.yml - when: munin_install | bool or munin_installed is defined + when: munin_install or munin_installed is defined diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index 2d678dcfa..48656e89f 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -14,8 +14,7 @@ - php{{ php_version }}-xmlrpc state: present when: is_debuntu | bool - tags: - - download + #tags: download - name: Install php{{ php_version }}-xml (ubuntu or debian 9+) package: @@ -45,18 +44,15 @@ - php-xmlrpc state: present when: not is_debuntu - tags: - - download + #tags: download - include_tasks: centos.yml when: ansible_distribution == "CentOS" - tags: - - download + #tags: download - include_tasks: fedora.yml when: ansible_distribution == "Fedora" - tags: - - download + #tags: download # 2019-07-03 @jvonau @holta: the next 50 lines (6 stanzas) double MariaDB's @@ -129,7 +125,7 @@ src: my.cnf.j2 dest: /root/.my.cnf owner: root - mode: 0600 + mode: '0600' when: mysql_enabled | bool # 'localhost' needs to be the last item for idempotency, see diff --git a/roles/network/tasks/computed_network.yml b/roles/network/tasks/computed_network.yml index 1277209e8..e3c7203f8 100644 --- a/roles/network/tasks/computed_network.yml +++ b/roles/network/tasks/computed_network.yml @@ -177,10 +177,8 @@ dest: "{{ iiab_env_file }}" regexp: '^IIAB_WAN_DEVICE=*' line: 'IIAB_WAN_DEVICE="{{ iiab_wan_iface }}"' - state: present when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml - tags: - - network + #tags: network - name: Record IIAB_LAN_DEVICE to {{ iiab_env_file }} lineinfile: @@ -189,8 +187,7 @@ line: 'IIAB_LAN_DEVICE="{{ iiab_lan_iface }}"' state: present when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml - tags: - - network + #tags: network - name: Add 'computed_network' variable values to {{ iiab_ini_file }} ini_file: diff --git a/roles/network/tasks/dansguardian.yml b/roles/network/tasks/dansguardian.yml index 7c303d695..9d4c9345e 100644 --- a/roles/network/tasks/dansguardian.yml +++ b/roles/network/tasks/dansguardian.yml @@ -2,8 +2,7 @@ package: name: dansguardian state: present - tags: - - download + #tags: download - name: Install /etc/dansguardian/dansguardian.conf from template (Fedora) template: diff --git a/roles/network/tasks/ifcfg_mods.yml b/roles/network/tasks/ifcfg_mods.yml index 98073f580..68f68a44d 100644 --- a/roles/network/tasks/ifcfg_mods.yml +++ b/roles/network/tasks/ifcfg_mods.yml @@ -84,8 +84,7 @@ src: network/wifi-slave.j2 dest: "/etc/sysconfig/network-scripts/ifcfg-{{ iiab_wireless_lan_iface }}" when: iiab_lan_iface == "br0" and iiab_wireless_lan_iface != "none" - tags: - - network + #tags: network - include_tasks: enable_wan.yml when: not installing and not iiab_demo_mode diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 431498f21..31e9ef1e4 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -48,7 +48,7 @@ - name: Configure wondershaper include_tasks: wondershaper.yml - when: wondershaper_install | bool or wondershaper_installed is defined + when: wondershaper_install or wondershaper_installed is defined #tags: network, wondershaper - name: (Re)Install named diff --git a/roles/network/tasks/restart.yml b/roles/network/tasks/restart.yml index 9a7c90dfc..9618a9960 100644 --- a/roles/network/tasks/restart.yml +++ b/roles/network/tasks/restart.yml @@ -15,13 +15,13 @@ name: "{{ proxy }}" state: stopped async: 120 - when: squid_install | bool or squid_installed is defined + when: squid_install or squid_installed is defined - name: Stop DansGuardian systemd: name: dansguardian state: stopped - when: dansguardian_install | bool or dansguardian_installed is defined + when: dansguardian_install or dansguardian_installed is defined - name: Restart DansGuardian service (dansguardian) except Ubuntu which needs reboot to activate systemd: diff --git a/roles/nginx/tasks/disable.yml.deprecated b/roles/nginx/tasks/disable.yml.deprecated index 8ff87f1ba..d2e8f7a06 100644 --- a/roles/nginx/tasks/disable.yml.deprecated +++ b/roles/nginx/tasks/disable.yml.deprecated @@ -1,14 +1,14 @@ #grep -r "not nginx_enabled" roles/ -#roles/calibre-web/tasks/main.yml: when: calibreweb_enabled | bool and not nginx_enabled | bool +#roles/calibre-web/tasks/main.yml: when: calibreweb_enabled and not nginx_enabled | bool #roles/calibre-web/tasks/main.yml: when: not nginx_enabled | bool -#roles/kolibri/tasks/main.yml: when: kolibri_enabled | bool and not nginx_enabled | bool +#roles/kolibri/tasks/main.yml: when: kolibri_enabled and not nginx_enabled | bool #roles/kolibri/tasks/main.yml: when: not nginx_enabled | bool -#roles/kiwix/tasks/kiwix_install.yml: when: kiwix_enabled | bool and not nginx_enabled | bool +#roles/kiwix/tasks/kiwix_install.yml: when: kiwix_enabled and not nginx_enabled | bool #roles/kiwix/tasks/kiwix_install.yml: when: not nginx_enabled | bool #roles/nginx/tasks/main.yml: when: not nginx_enabled | bool #roles/nginx/tasks/main.yml: when: not nginx_enabled | bool -#roles/sugarizer/tasks/install.yml: when: sugarizer_enabled | bool and not nginx_enabled | bool -#roles/sugarizer/tasks/install.yml: when: sugarizer_enabled | bool and not nginx_enabled | bool +#roles/sugarizer/tasks/install.yml: when: sugarizer_enabled and not nginx_enabled | bool +#roles/sugarizer/tasks/install.yml: when: sugarizer_enabled and not nginx_enabled | bool - name: Enable Gitea for Apache command: a2ensite gitea.conf diff --git a/roles/nodered/tasks/main.yml b/roles/nodered/tasks/main.yml index 3b5001416..6ee3d8abe 100644 --- a/roles/nodered/tasks/main.yml +++ b/roles/nodered/tasks/main.yml @@ -1,5 +1,5 @@ - include_tasks: install.yml - when: nodered_install | bool and not nodered_installed is defined + when: nodered_install and not nodered_installed is defined - include_tasks: enable.yml - when: nodered_install | bool or nodered_installed is defined + when: nodered_install or nodered_installed is defined diff --git a/roles/postgresql/tasks/main.yml b/roles/postgresql/tasks/main.yml index ac388b863..8d30dcc65 100644 --- a/roles/postgresql/tasks/main.yml +++ b/roles/postgresql/tasks/main.yml @@ -2,24 +2,21 @@ package: name: postgresql state: present - tags: - - download + #tags: download - name: Install postgresql-client (debuntu) package: name: postgresql-client state: present when: is_debuntu | bool - tags: - - download + #tags: download - name: Install postgresql-server (OS's other than debuntu) package: name: postgresql-server state: present when: not is_debuntu - tags: - - download + #tags: download - name: Install /etc/systemd/system/postgresql-iiab.service from template template: @@ -27,14 +24,14 @@ dest: /etc/systemd/system/postgresql-iiab.service owner: root group: root - mode: 0644 + mode: '0644' - name: Create PostgreSQL data dir /library/pgsql-iiab, owned by postgres:postgres file: path: /library/pgsql-iiab owner: postgres group: postgres - mode: 0700 + mode: '0700' state: directory - name: Make sure locale {{ postgresql_locale }} is enabled (debuntu) # en_US.UTF-8 @@ -72,7 +69,7 @@ dest: /library/pgsql-iiab/postgresql.conf owner: postgres group: postgres - mode: 0640 + mode: '0640' # Probably Not Nec! Given stanza below does the same. - name: 'Stop postgresql service: /etc/init.d/postgresql stop (debuntu)' diff --git a/roles/samba/tasks/main.yml b/roles/samba/tasks/main.yml index 05995fe18..7a6087a77 100755 --- a/roles/samba/tasks/main.yml +++ b/roles/samba/tasks/main.yml @@ -9,7 +9,7 @@ path: "{{ shared_dir }}" owner: "{{ smbuser }}" group: "{{ smbuser }}" - mode: 0777 + mode: '0777' state: directory # Install and configure samba server (requires ports 137, 138, 139, 445 open). @@ -21,9 +21,7 @@ - samba-common - cifs-utils state: present - tags: - - samba - - download + #tags: samba, download - name: Install /etc/samba/smb.conf from template template: @@ -41,8 +39,7 @@ name: "{{ smb_service }}" state: started enabled: yes - tags: - - samba + #tags: samba when: samba_enabled | bool - name: Enable & Start NetBIOS name server ({{ nmb_service }}) @@ -50,8 +47,7 @@ name: "{{ nmb_service }}" state: started enabled: yes - tags: - - samba + #tags: samba when: samba_enabled | bool - name: Disable Samba if not samba_enabled @@ -59,8 +55,7 @@ name: "{{ smb_service }}" state: stopped enabled: no - tags: - - samba + #tags: samba when: not samba_enabled - name: Disable NetBIOS name server ({{ nmb_service }}) if not samba_enabled @@ -68,8 +63,7 @@ name: "{{ nmb_service }}" state: stopped enabled: no - tags: - - samba + #tags: samba when: not samba_enabled - name: Add 'samba' variable values to {{ iiab_ini_file }} diff --git a/roles/sugar-stats/tasks/main.yml b/roles/sugar-stats/tasks/main.yml index 0a35fe760..71fb4b073 100644 --- a/roles/sugar-stats/tasks/main.yml +++ b/roles/sugar-stats/tasks/main.yml @@ -6,8 +6,7 @@ - active-document - restful-document - python-xappy - tags: - - download + #tags: download - name: Create sugar-stats directory tree file: path={{ item }} diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index fa9a0ddff..8eb963551 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -1,6 +1,6 @@ - name: Install 'sugarizer' if sugarizer_install and not Debian 10+ include_tasks: install.yml - when: not sugarizer_installed is defined and sugarizer_install | bool and not ((is_debian and not is_raspbian) and (not is_debian_8) and (not is_debian_9)) + when: not sugarizer_installed is defined and sugarizer_install and not ((is_debian and not is_raspbian) and (not is_debian_8) and (not is_debian_9)) - name: Enable 'sugarizer' if sugarizer_enabled include_tasks: enable.yml diff --git a/roles/teamviewer/tasks/install.yml b/roles/teamviewer/tasks/install.yml index 9f5ae1ad2..5410c926d 100644 --- a/roles/teamviewer/tasks/install.yml +++ b/roles/teamviewer/tasks/install.yml @@ -2,26 +2,22 @@ - name: Install Xfce group of packages shell: "yum groupinstall -y xfce" when: xo_model == "none" and internet_available and ansible_distribution_version <= "20" - tags: - - download + #tags: download - name: Install X11 group of packages shell: "yum groupinstall -y 'X Window system'" when: xo_model == "none" and internet_available and ansible_distribution_version <= "20" - tags: - - download + #tags: download - name: Install Xfce group of packages shell: yum groupinstall -y "Xfce Desktop" --exclude fedora-release\* when: xo_model == "none" and internet_available and ansible_distribution_version >= "21" - tags: - - download + #tags: download - name: Install X Windows on CentOS shell: yum groupinstall -y "Server with GUI" when: internet_available and ansible_distribution == "CentOS" - tags: - - download + #tags: download - name: Download TeamViewer software get_url: @@ -29,8 +25,7 @@ dest: "{{ yum_packages_dir }}/{{ teamviewer_rpm_file }}" timeout: "{{ download_timeout }}" when: internet_available | bool - tags: - - download + #tags: download # F22 has issues with yum localinstall exclude for now - name: Do the install of TeamViewer, pulling in any required dependencies diff --git a/roles/vnstat/tasks/main.yml b/roles/vnstat/tasks/main.yml index 60912b3b4..a26f19a2f 100644 --- a/roles/vnstat/tasks/main.yml +++ b/roles/vnstat/tasks/main.yml @@ -2,16 +2,15 @@ package: name: vnstat state: present - tags: - - download + #tags: download - name: Install /etc/vnstat.conf from template template: src: vnstat.conf.j2 dest: /etc/vnstat.conf - mode: 0744 - owner: root - group: root + # owner: root + # group: root + mode: '0744' - name: Create database for WAN to collect vnStat data shell: /usr/bin/vnstat -i {{ iiab_wan_iface }} @@ -23,6 +22,7 @@ - name: Enable & Start vnStat's systemd service systemd: name: vnstat + daemon_reload: yes enabled: yes state: started