1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Merge pull request #339 from iiab/master

sync from iiab:master
This commit is contained in:
A Holt 2020-01-14 15:33:06 -05:00 committed by GitHub
commit 97b6724e73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 168 additions and 219 deletions

View file

@ -26,38 +26,31 @@
path: /etc/systemd/system/iptables.service path: /etc/systemd/system/iptables.service
state: absent 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) - name: Install package iptables-persistent (debuntu)
package: package:
name: iptables-persistent name: iptables-persistent
state: present state: present
when: is_debuntu | bool when: is_debuntu | bool
tags: #tags: download
- download
- name: Install package iptables-services (OS's other than debuntu) - name: Install package iptables-services (OS's other than debuntu)
package: package:
name: iptables-services name: iptables-services
state: present state: present
when: not is_debuntu when: not is_debuntu
tags: #tags: download
- download
- name: Install /etc/sysconfig/iptables-config from template - name: Install /etc/sysconfig/iptables-config from template
template: template:
src: iptables-config src: iptables-config
dest: /etc/sysconfig/iptables-config dest: /etc/sysconfig/iptables-config
owner: root # owner: root
group: root # group: root
mode: 0644 # mode: '0644'
- name: Install /etc/network/if-pre-up.d/iptables from template (debuntu) - name: Install /etc/network/if-pre-up.d/iptables from template (debuntu)
template: template:
src: iptables src: iptables
dest: /etc/network/if-pre-up.d/iptables dest: /etc/network/if-pre-up.d/iptables
mode: 0755 mode: '0755'
when: is_debuntu | bool when: is_debuntu | bool

View file

@ -132,17 +132,16 @@
with_items: with_items:
- hostapd_8188_i386 - 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: #tags: xo
- xo
- name: Put the substitute in place - name: Put the substitute in place
copy: copy:
src: "{{ downloads_dir }}/hostapd_8188_i386" src: "{{ downloads_dir }}/hostapd_8188_i386"
dest: /usr/sbin/hostapd dest: /usr/sbin/hostapd
backup: yes backup: yes
mode: 0775 # owner: root
owner: root # group: root
group: root mode: '0775'
when: wifi_id == "tplink_WM725M" and xo_model == "XO-1.5" when: wifi_id == "tplink_WM725M" and xo_model == "XO-1.5"
- name: Reboot system - name: Reboot system

View file

@ -11,4 +11,4 @@
debug: debug:
msg: "{{ msg.split('\n') }}" msg: "{{ msg.split('\n') }}"
tags: debug_info #tags: debug_info

View file

@ -1,7 +1,7 @@
- name: Install AWStats if awstats_install - name: Install AWStats if awstats_install
include_tasks: install.yml 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 - name: Enable AWStats
include_tasks: enable.yml include_tasks: enable.yml
when: awstats_install | bool or awstats_installed is defined when: awstats_install or awstats_installed is defined

View file

@ -1,8 +1,8 @@
- name: Install AzuraCast if azuracast_install - name: Install AzuraCast if azuracast_install
include_tasks: install.yml 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 # TODO figure out what to turn off for azuracast
#- name: Enable AzuraCast #- name: Enable AzuraCast
# include_tasks: enable.yml # include_tasks: enable.yml
# when: azuracast_install | bool or azuracast_installed is defined | bool # when: azuracast_install or azuracast_installed is defined | bool

View file

@ -66,7 +66,7 @@
- option: name - option: name
value: calibre-web value: calibre-web
- option: description - 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 - option: calibreweb_url1
value: "{{ calibreweb_url1 }}" value: "{{ calibreweb_url1 }}"
- option: calibreweb_url2 - option: calibreweb_url2

View file

@ -4,8 +4,7 @@
name: cups name: cups
state: present state: present
when: cups_install | bool when: cups_install | bool
tags: #tags: download
- download
- name: Install our own /etc/cups/cupsd.conf from template, to permit local LAN admin - name: Install our own /etc/cups/cupsd.conf from template, to permit local LAN admin
template: template:

View file

@ -5,7 +5,7 @@
- docker - docker
- python-docker-py - python-docker-py
when: docker_install | bool when: docker_install | bool
tags: download #tags: download
- name: put the systemd startup file in place - name: put the systemd startup file in place
template: src=docker.service template: src=docker.service

View file

@ -1,7 +1,7 @@
- name: Install DokuWiki - name: Install DokuWiki
include_tasks: install.yml 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 - name: Enable DokuWiki
include_tasks: enable.yml include_tasks: enable.yml
when: dokuwiki_install | bool or dokuwiki_installed is defined when: dokuwiki_install or dokuwiki_installed is defined

View file

@ -2,8 +2,7 @@
package: package:
name: ejabberd name: ejabberd
state: present state: present
tags: #tags: download
- download
#- name: Configure ejabberd #- name: Configure ejabberd
# template: # template:

View file

@ -3,8 +3,7 @@
state=present state=present
with_items: with_items:
- ejabberd-2.1.11 - ejabberd-2.1.11
tags: #tags: download
- download
when: not is_debuntu when: not is_debuntu
# need to use lineinfile and better regexp # need to use lineinfile and better regexp

View file

@ -60,7 +60,7 @@
- option: name - option: name
value: gitea value: gitea
- option: description - 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 - option: gitea_run_directory
value: "{{ gitea_run_directory }}" value: "{{ gitea_run_directory }}"
- option: gitea_url - option: gitea_url

View file

@ -4,16 +4,14 @@
systemd: systemd:
name: gitea name: gitea
state: stopped state: stopped
tags: #tags: pre-install
- pre-install
ignore_errors: yes ignore_errors: yes
- name: Ensure group gitea exists - name: Ensure group gitea exists
group: group:
name: gitea name: gitea
state: present state: present
tags: #tags: pre-install
- pre-install
- name: Create user gitea - name: Create user gitea
user: user:
@ -21,8 +19,7 @@
comment: Gitea daemon account comment: Gitea daemon account
groups: gitea groups: gitea
home: "{{ gitea_home }}" home: "{{ gitea_home }}"
tags: #tags: pre-install
- pre-install
- name: Create Gitea directory structure - name: Create Gitea directory structure
file: file:
@ -31,19 +28,17 @@
owner: gitea owner: gitea
group: gitea group: gitea
with_items: "{{ gitea_subdirectories }}" with_items: "{{ gitea_subdirectories }}"
tags: #tags: pre-install
- pre-install
- name: Make directories data, indexers, and log writable - name: Make directories data, indexers, and log writable
file: file:
path: "{{ gitea_root_directory }}/{{ item }}" path: "{{ gitea_root_directory }}/{{ item }}"
mode: 0750 mode: '0750'
with_items: with_items:
- data - data
- indexers - indexers
- log - log
tags: #tags: pre-install
- pre-install
# Download, verify, and link Gitea binary # Download, verify, and link Gitea binary
@ -56,27 +51,22 @@
get_url: get_url:
url: "{{ gitea_download_url }}" url: "{{ gitea_download_url }}"
dest: "{{ gitea_install_path }}" dest: "{{ gitea_install_path }}"
mode: 0775 mode: '0775'
tags: #tags: install
- install
when: internet_available | bool when: internet_available | bool
- name: Download Gitea GPG signature - name: Download Gitea GPG signature
get_url: get_url:
url: "{{ gitea_integrity_url }}" url: "{{ gitea_integrity_url }}"
dest: "{{ gitea_checksum_path }}" dest: "{{ gitea_checksum_path }}"
tags: #tags: never, verify
- never
- verify
when: internet_available | bool when: internet_available | bool
- name: Verify Gitea binary with GPG signature - name: Verify Gitea binary with GPG signature
shell: | shell: |
gpg --keyserver pgp.mit.edu --recv {{ gitea_gpg_key }} gpg --keyserver pgp.mit.edu --recv {{ gitea_gpg_key }}
gpg --verify {{ gitea_checksum_path }} {{ gitea_install_path }} gpg --verify {{ gitea_checksum_path }} {{ gitea_install_path }}
tags: #tags: never, verify
- never
- verify
ignore_errors: yes ignore_errors: yes
- name: Link Gitea - name: Link Gitea
@ -86,8 +76,7 @@
owner: gitea owner: gitea
group: gitea group: gitea
state: link state: link
tags: #tags: install
- install
# Configure Gitea # Configure Gitea
@ -102,9 +91,8 @@
state: directory state: directory
owner: root owner: root
group: gitea group: gitea
mode: 0770 mode: '0770'
tags: #tags: config
- config
- name: Create app.ini - name: Create app.ini
template: template:
@ -112,7 +100,7 @@
dest: /etc/gitea/app.ini dest: /etc/gitea/app.ini
owner: root owner: root
group: gitea group: gitea
mode: 0664 mode: '0664'
# Create systemd service & prepare Apache for http://box/gitea # Create systemd service & prepare Apache for http://box/gitea

View file

@ -8,8 +8,7 @@
- "php{{ php_version }}-curl" - "php{{ php_version }}-curl"
state: present state: present
when: is_debian | bool when: is_debian | bool
tags: #tags: download
- download
- name: 'Install 2 packages: apache2, php (ubuntu)' - name: 'Install 2 packages: apache2, php (ubuntu)'
package: package:
@ -20,8 +19,7 @@
- php - php
state: present state: present
when: is_ubuntu | bool when: is_ubuntu | bool
tags: #tags: download
- download
# 2019-05-30: It's interesting that http://box.lan/admin and everything seems # 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 # to work even without php{{ php_version }}-sqlite3 as confirmed on Ubuntu
@ -52,8 +50,7 @@
- php-curl - php-curl
state: present state: present
when: is_redhat | bool when: is_redhat | bool
tags: #tags: download
- download
# remove symlinks for mpm-event, replace with mpm-prefork # remove symlinks for mpm-event, replace with mpm-prefork
- name: Remove both mpm_event symlinks from /etc/apache2/mods-enabled (debuntu) - name: Remove both mpm_event symlinks from /etc/apache2/mods-enabled (debuntu)

View file

@ -1,18 +1,15 @@
- include_tasks: install.yml - include_tasks: install.yml
tags: #tags: base
- base
- include_tasks: html.yml - include_tasks: html.yml
tags: #tags: base
- base
# Partially fixes search @ http://box/modules/es-wikihow (on RPi anyway) see https://github.com/iiab/iiab/issues/829 # Partially fixes search @ http://box/modules/es-wikihow (on RPi anyway) see https://github.com/iiab/iiab/issues/829
- include_tasks: php-stem.yml - include_tasks: php-stem.yml
tags: #tags: base
- 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) - 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: template:
src: refresh-wiki-docs.sh src: refresh-wiki-docs.sh
dest: /usr/bin/iiab-refresh-wiki-docs dest: /usr/bin/iiab-refresh-wiki-docs
mode: 0755 mode: '0755'

View file

@ -7,8 +7,7 @@
- xinetd - xinetd
- xs-rsync - xs-rsync
- incron - incron
tags: #tags: download
- download
- name: Configure idmgr - name: Configure idmgr
template: backup=yes template: backup=yes

View file

@ -4,5 +4,4 @@
- screen - screen
- lynx - lynx
state: present state: present
tags: #tags: download
- download

View file

@ -1,11 +1,9 @@
- include_tasks: admin-user.yml - include_tasks: admin-user.yml
tags: #tags: base
- base
when: iiab_admin_user_install | bool when: iiab_admin_user_install | bool
- include_tasks: access.yml - include_tasks: access.yml
tags: #tags: base
- base
- name: Add 'iiab-admin' variable values to {{ iiab_ini_file }} - name: Add 'iiab-admin' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
@ -25,7 +23,7 @@
template: template:
src: sshpwd-profile-iiab.sh src: sshpwd-profile-iiab.sh
dest: /etc/profile.d/ dest: /etc/profile.d/
mode: 0644 mode: '0644'
- name: Is this LXDE-pi? - name: Is this LXDE-pi?
stat: stat:
@ -36,7 +34,7 @@
template: template:
src: sshpwd-lxde-iiab.sh src: sshpwd-lxde-iiab.sh
dest: /etc/xdg/lxsession/LXDE-pi/ 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 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 # 2019-03-07: This popup (/etc/xdg/lxsession/LXDE-pi/sshpwd-lxde-iiab.sh) does

View file

@ -1,7 +1,7 @@
- name: Install Kolibri - name: Install Kolibri
include_tasks: install.yml 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 - name: Enable Kolibri
include_tasks: enable.yml include_tasks: enable.yml
when: kolibri_install | bool or kolibri_installed is defined when: kolibri_install or kolibri_installed is defined

View file

@ -1,7 +1,7 @@
- name: Install Lokole {{ lokole_version }} if lokole_install - name: Install Lokole {{ lokole_version }} if lokole_install
include_tasks: install.yml 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 - name: Enable Lokole
include_tasks: enable.yml include_tasks: enable.yml
when: lokole_install | bool or lokole_installed is defined when: lokole_install or lokole_installed is defined

View file

@ -45,7 +45,7 @@
- option: name - option: name
value: mediawiki value: mediawiki
- option: description - 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 - option: mediawiki_src
value: "{{ mediawiki_src }}" value: "{{ mediawiki_src }}"
- option: mediawiki_abs_path - option: mediawiki_abs_path

View file

@ -5,4 +5,3 @@
- name: Enable MediaWiki - name: Enable MediaWiki
include_tasks: enable.yml include_tasks: enable.yml
when: mediawiki_install or mediawiki_installed is defined when: mediawiki_install or mediawiki_installed is defined
# when: mediawiki_enabled | bool

View file

@ -7,8 +7,7 @@
- mongodb # 2019-01-31: this package does not exist on (cannot be installed on) Debian 10, SEE #1437 - mongodb # 2019-01-31: this package does not exist on (cannot be installed on) Debian 10, SEE #1437
state: present state: present
when: internet_available and not is_rpi when: internet_available and not is_rpi
tags: #tags: download
- download
# 2019-02-02: Sugarizer with Node.js 10.x requires MongoDB 2.6+ so # 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/ # https://andyfelong.com/2017/08/mongodb-3-0-14-for-raspbian-stretch/

View file

@ -2,16 +2,14 @@
package: package:
name: monit name: monit
state: present state: present
tags: #tags: download
- download
- name: Install chkconfig package (debian-8) - name: Install chkconfig package (debian-8)
package: package:
name: chkconfig name: chkconfig
state: present state: present
when: is_debian and ansible_distribution_major_version == "8" when: is_debian and ansible_distribution_major_version == "8"
tags: #tags: download
- download
- name: Install /etc/monitrc from template - name: Install /etc/monitrc from template
template: template:
@ -20,7 +18,7 @@
dest: /etc/monitrc dest: /etc/monitrc
owner: root owner: root
group: root group: root
mode: 0600 mode: '0600'
# - name: Install config file /etc/monit.d/watchdog from template (NEVER RUNS, WHY?) # - name: Install config file /etc/monit.d/watchdog from template (NEVER RUNS, WHY?)
# template: # template:
@ -29,7 +27,7 @@
# owner: root # owner: root
# group: root # group: root
# force: yes # force: yes
# mode: 0755 # mode: '0755'
# register: monit_config # register: monit_config
# when: False # IS THIS A BUG ? # when: False # IS THIS A BUG ?
# until: monit_config | success # until: monit_config | success

View file

@ -1,7 +1,7 @@
- name: "Install Moodle" - name: "Install Moodle"
include_tasks: install.yml 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 - name: Enable Moodle
include_tasks: enable.yml include_tasks: enable.yml
when: moodle_install | bool or moodle_installed is defined when: moodle_install or moodle_installed is defined

View file

@ -5,7 +5,7 @@
with_items: with_items:
- mosquitto - mosquitto
- mosquitto-clients - mosquitto-clients
tags: download #tags: download
- name: Disable & Stop 'mosquitto' service - name: Disable & Stop 'mosquitto' service
systemd: systemd:
@ -17,7 +17,7 @@
file: file:
path: /etc/mosquitto/passwd path: /etc/mosquitto/passwd
state: touch 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 - name: Populate /etc/mosquitto/passwd with actual username/password
shell: mosquitto_passwd -b /etc/mosquitto/passwd "{{ mosquitto_user }}" "{{ mosquitto_password }}" shell: mosquitto_passwd -b /etc/mosquitto/passwd "{{ mosquitto_user }}" "{{ mosquitto_password }}"
@ -28,7 +28,7 @@
dest: /etc/mosquitto/conf.d/websockets.conf dest: /etc/mosquitto/conf.d/websockets.conf
owner: root owner: root
group: root group: root
mode: 0755 mode: '0755'
- name: "Add 'mosquitto_installed: True' to {{ iiab_state_file }}" - name: "Add 'mosquitto_installed: True' to {{ iiab_state_file }}"
lineinfile: lineinfile:

View file

@ -1,5 +1,5 @@
- include_tasks: install.yml - 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 - include_tasks: enable.yml
when: mosquitto_install | bool or mosquitto_installed is defined when: mosquitto_install or mosquitto_installed is defined

View file

@ -1,54 +1,54 @@
- name: If MySQL is enabled, let Munin monitor it - name: Enable & Start 'munin-node' systemd service
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
systemd: systemd:
name: munin-node name: munin-node
daemon_reload: yes
enabled: yes enabled: yes
state: started state: started
when: munin_enabled | bool when: munin_enabled | bool
- name: Disable munin-node service if not munin_enabled - name: Disable 'munin-node' systemd service
systemd: systemd:
name: munin-node name: munin-node
enabled: no enabled: no
state: stopped state: stopped
when: not munin_enabled when: not munin_enabled
- name: Create symlink munin24.conf from sites-enabled to sites-available (debuntu) # Apache
file:
src: /etc/apache2/sites-available/munin24.conf
path: /etc/apache2/sites-enabled/munin24.conf
state: link
when: munin_enabled and not nginx_enabled
- name: Remove symlink /etc/apache2/sites-enabled/munin24.conf if not munin_enabled (debuntu) - name: Enable http://box/munin via Apache
file: command: a2ensite munin24.conf
path: /etc/apache2/sites-enabled/munin24.conf when: apache_install and munin_enabled # and not nginx_enabled
state: absent
when: not munin_enabled or 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/<OS>.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: template:
src: "{{ item.src }}" src: munin24-nginx.conf.j2
dest: "{{ item.dest }}" dest: "{{ nginx_config_dir }}/munin24-nginx.conf" # /etc/nginx/conf.d
owner: root when: munin_enabled and nginx_enabled
group: root
mode: 0644 - name: Disable http://box/munin via NGINX, by installing {{ nginx_config_dir }}/munin24-nginx.conf
with_items: file:
- { src: 'munin24-nginx.conf.j2', dest: '/etc/nginx/conf.d/munin24-nginx.conf' } path: "{{ nginx_config_dir }}/munin24-nginx.conf" # /etc/nginx/conf.d
when: munin_enabled | bool and nginx_enabled | bool 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 }} - name: Add 'munin' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
@ -60,7 +60,7 @@
- option: name - option: name
value: Munin value: Munin
- option: description - 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 - option: installed
value: "{{ munin_install }}" value: "{{ munin_install }}"
- option: enabled - option: enabled

View file

@ -7,8 +7,7 @@
- libcgi-fast-perl - libcgi-fast-perl
- libapache2-mod-fcgid - libapache2-mod-fcgid
state: present state: present
tags: #tags: download
- download
when: is_debuntu | bool when: is_debuntu | bool
- name: "Install 2 packages: munin, munin-node (OS's other than debuntu)" - name: "Install 2 packages: munin, munin-node (OS's other than debuntu)"
@ -17,17 +16,16 @@
- munin - munin
- munin-node - munin-node
state: present state: present
tags: #tags: download
- download
when: not is_debuntu when: not is_debuntu
- name: Install /etc/munin/munin.conf and Apache's munin24.conf, from templates - name: Install /etc/munin/munin.conf and Apache's munin24.conf, from templates
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
owner: root # owner: root
group: root # group: root
mode: 0644 # mode: 0644
with_items: with_items:
- { src: 'munin.conf.j2', dest: '/etc/munin/munin.conf' } - { src: 'munin.conf.j2', dest: '/etc/munin/munin.conf' }
- { src: 'munin24.conf.j2', dest: '/etc/{{ apache_config_dir }}/munin24.conf' } - { src: 'munin24.conf.j2', dest: '/etc/{{ apache_config_dir }}/munin24.conf' }
@ -37,8 +35,20 @@
path: /etc/munin/munin-htpasswd path: /etc/munin/munin-htpasswd
name: Admin name: Admin
password: changeme 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 }}" - name: "Add 'munin_installed: True' to {{ iiab_state_file }}"
lineinfile: lineinfile:

View file

@ -1,7 +1,7 @@
- name: Install munin - name: Install munin
include_tasks: install.yml 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 - name: Enable munin
include_tasks: enable.yml include_tasks: enable.yml
when: munin_install | bool or munin_installed is defined when: munin_install or munin_installed is defined

View file

@ -14,8 +14,7 @@
- php{{ php_version }}-xmlrpc - php{{ php_version }}-xmlrpc
state: present state: present
when: is_debuntu | bool when: is_debuntu | bool
tags: #tags: download
- download
- name: Install php{{ php_version }}-xml (ubuntu or debian 9+) - name: Install php{{ php_version }}-xml (ubuntu or debian 9+)
package: package:
@ -45,18 +44,15 @@
- php-xmlrpc - php-xmlrpc
state: present state: present
when: not is_debuntu when: not is_debuntu
tags: #tags: download
- download
- include_tasks: centos.yml - include_tasks: centos.yml
when: ansible_distribution == "CentOS" when: ansible_distribution == "CentOS"
tags: #tags: download
- download
- include_tasks: fedora.yml - include_tasks: fedora.yml
when: ansible_distribution == "Fedora" when: ansible_distribution == "Fedora"
tags: #tags: download
- download
# 2019-07-03 @jvonau @holta: the next 50 lines (6 stanzas) double MariaDB's # 2019-07-03 @jvonau @holta: the next 50 lines (6 stanzas) double MariaDB's
@ -129,7 +125,7 @@
src: my.cnf.j2 src: my.cnf.j2
dest: /root/.my.cnf dest: /root/.my.cnf
owner: root owner: root
mode: 0600 mode: '0600'
when: mysql_enabled | bool when: mysql_enabled | bool
# 'localhost' needs to be the last item for idempotency, see # 'localhost' needs to be the last item for idempotency, see

View file

@ -177,10 +177,8 @@
dest: "{{ iiab_env_file }}" dest: "{{ iiab_env_file }}"
regexp: '^IIAB_WAN_DEVICE=*' regexp: '^IIAB_WAN_DEVICE=*'
line: 'IIAB_WAN_DEVICE="{{ iiab_wan_iface }}"' 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 when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml
tags: #tags: network
- network
- name: Record IIAB_LAN_DEVICE to {{ iiab_env_file }} - name: Record IIAB_LAN_DEVICE to {{ iiab_env_file }}
lineinfile: lineinfile:
@ -189,8 +187,7 @@
line: 'IIAB_LAN_DEVICE="{{ iiab_lan_iface }}"' line: 'IIAB_LAN_DEVICE="{{ iiab_lan_iface }}"'
state: present state: present
when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml
tags: #tags: network
- network
- name: Add 'computed_network' variable values to {{ iiab_ini_file }} - name: Add 'computed_network' variable values to {{ iiab_ini_file }}
ini_file: ini_file:

View file

@ -2,8 +2,7 @@
package: package:
name: dansguardian name: dansguardian
state: present state: present
tags: #tags: download
- download
- name: Install /etc/dansguardian/dansguardian.conf from template (Fedora) - name: Install /etc/dansguardian/dansguardian.conf from template (Fedora)
template: template:

View file

@ -84,8 +84,7 @@
src: network/wifi-slave.j2 src: network/wifi-slave.j2
dest: "/etc/sysconfig/network-scripts/ifcfg-{{ iiab_wireless_lan_iface }}" dest: "/etc/sysconfig/network-scripts/ifcfg-{{ iiab_wireless_lan_iface }}"
when: iiab_lan_iface == "br0" and iiab_wireless_lan_iface != "none" when: iiab_lan_iface == "br0" and iiab_wireless_lan_iface != "none"
tags: #tags: network
- network
- include_tasks: enable_wan.yml - include_tasks: enable_wan.yml
when: not installing and not iiab_demo_mode when: not installing and not iiab_demo_mode

View file

@ -48,7 +48,7 @@
- name: Configure wondershaper - name: Configure wondershaper
include_tasks: wondershaper.yml include_tasks: wondershaper.yml
when: wondershaper_install | bool or wondershaper_installed is defined when: wondershaper_install or wondershaper_installed is defined
#tags: network, wondershaper #tags: network, wondershaper
- name: (Re)Install named - name: (Re)Install named

View file

@ -15,13 +15,13 @@
name: "{{ proxy }}" name: "{{ proxy }}"
state: stopped state: stopped
async: 120 async: 120
when: squid_install | bool or squid_installed is defined when: squid_install or squid_installed is defined
- name: Stop DansGuardian - name: Stop DansGuardian
systemd: systemd:
name: dansguardian name: dansguardian
state: stopped 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 - name: Restart DansGuardian service (dansguardian) except Ubuntu which needs reboot to activate
systemd: systemd:

View file

@ -1,14 +1,14 @@
#grep -r "not nginx_enabled" roles/ #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/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/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/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/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 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
- name: Enable Gitea for Apache - name: Enable Gitea for Apache
command: a2ensite gitea.conf command: a2ensite gitea.conf

View file

@ -1,5 +1,5 @@
- include_tasks: install.yml - 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 - include_tasks: enable.yml
when: nodered_install | bool or nodered_installed is defined when: nodered_install or nodered_installed is defined

View file

@ -2,24 +2,21 @@
package: package:
name: postgresql name: postgresql
state: present state: present
tags: #tags: download
- download
- name: Install postgresql-client (debuntu) - name: Install postgresql-client (debuntu)
package: package:
name: postgresql-client name: postgresql-client
state: present state: present
when: is_debuntu | bool when: is_debuntu | bool
tags: #tags: download
- download
- name: Install postgresql-server (OS's other than debuntu) - name: Install postgresql-server (OS's other than debuntu)
package: package:
name: postgresql-server name: postgresql-server
state: present state: present
when: not is_debuntu when: not is_debuntu
tags: #tags: download
- download
- name: Install /etc/systemd/system/postgresql-iiab.service from template - name: Install /etc/systemd/system/postgresql-iiab.service from template
template: template:
@ -27,14 +24,14 @@
dest: /etc/systemd/system/postgresql-iiab.service dest: /etc/systemd/system/postgresql-iiab.service
owner: root owner: root
group: root group: root
mode: 0644 mode: '0644'
- name: Create PostgreSQL data dir /library/pgsql-iiab, owned by postgres:postgres - name: Create PostgreSQL data dir /library/pgsql-iiab, owned by postgres:postgres
file: file:
path: /library/pgsql-iiab path: /library/pgsql-iiab
owner: postgres owner: postgres
group: postgres group: postgres
mode: 0700 mode: '0700'
state: directory state: directory
- name: Make sure locale {{ postgresql_locale }} is enabled (debuntu) # en_US.UTF-8 - name: Make sure locale {{ postgresql_locale }} is enabled (debuntu) # en_US.UTF-8
@ -72,7 +69,7 @@
dest: /library/pgsql-iiab/postgresql.conf dest: /library/pgsql-iiab/postgresql.conf
owner: postgres owner: postgres
group: postgres group: postgres
mode: 0640 mode: '0640'
# Probably Not Nec! Given stanza below does the same. # Probably Not Nec! Given stanza below does the same.
- name: 'Stop postgresql service: /etc/init.d/postgresql stop (debuntu)' - name: 'Stop postgresql service: /etc/init.d/postgresql stop (debuntu)'

View file

@ -9,7 +9,7 @@
path: "{{ shared_dir }}" path: "{{ shared_dir }}"
owner: "{{ smbuser }}" owner: "{{ smbuser }}"
group: "{{ smbuser }}" group: "{{ smbuser }}"
mode: 0777 mode: '0777'
state: directory state: directory
# Install and configure samba server (requires ports 137, 138, 139, 445 open). # Install and configure samba server (requires ports 137, 138, 139, 445 open).
@ -21,9 +21,7 @@
- samba-common - samba-common
- cifs-utils - cifs-utils
state: present state: present
tags: #tags: samba, download
- samba
- download
- name: Install /etc/samba/smb.conf from template - name: Install /etc/samba/smb.conf from template
template: template:
@ -41,8 +39,7 @@
name: "{{ smb_service }}" name: "{{ smb_service }}"
state: started state: started
enabled: yes enabled: yes
tags: #tags: samba
- samba
when: samba_enabled | bool when: samba_enabled | bool
- name: Enable & Start NetBIOS name server ({{ nmb_service }}) - name: Enable & Start NetBIOS name server ({{ nmb_service }})
@ -50,8 +47,7 @@
name: "{{ nmb_service }}" name: "{{ nmb_service }}"
state: started state: started
enabled: yes enabled: yes
tags: #tags: samba
- samba
when: samba_enabled | bool when: samba_enabled | bool
- name: Disable Samba if not samba_enabled - name: Disable Samba if not samba_enabled
@ -59,8 +55,7 @@
name: "{{ smb_service }}" name: "{{ smb_service }}"
state: stopped state: stopped
enabled: no enabled: no
tags: #tags: samba
- samba
when: not samba_enabled when: not samba_enabled
- name: Disable NetBIOS name server ({{ nmb_service }}) if not samba_enabled - name: Disable NetBIOS name server ({{ nmb_service }}) if not samba_enabled
@ -68,8 +63,7 @@
name: "{{ nmb_service }}" name: "{{ nmb_service }}"
state: stopped state: stopped
enabled: no enabled: no
tags: #tags: samba
- samba
when: not samba_enabled when: not samba_enabled
- name: Add 'samba' variable values to {{ iiab_ini_file }} - name: Add 'samba' variable values to {{ iiab_ini_file }}

View file

@ -6,8 +6,7 @@
- active-document - active-document
- restful-document - restful-document
- python-xappy - python-xappy
tags: #tags: download
- download
- name: Create sugar-stats directory tree - name: Create sugar-stats directory tree
file: path={{ item }} file: path={{ item }}

View file

@ -1,6 +1,6 @@
- name: Install 'sugarizer' if sugarizer_install and not Debian 10+ - name: Install 'sugarizer' if sugarizer_install and not Debian 10+
include_tasks: install.yml 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 - name: Enable 'sugarizer' if sugarizer_enabled
include_tasks: enable.yml include_tasks: enable.yml

View file

@ -2,26 +2,22 @@
- name: Install Xfce group of packages - name: Install Xfce group of packages
shell: "yum groupinstall -y xfce" shell: "yum groupinstall -y xfce"
when: xo_model == "none" and internet_available and ansible_distribution_version <= "20" when: xo_model == "none" and internet_available and ansible_distribution_version <= "20"
tags: #tags: download
- download
- name: Install X11 group of packages - name: Install X11 group of packages
shell: "yum groupinstall -y 'X Window system'" shell: "yum groupinstall -y 'X Window system'"
when: xo_model == "none" and internet_available and ansible_distribution_version <= "20" when: xo_model == "none" and internet_available and ansible_distribution_version <= "20"
tags: #tags: download
- download
- name: Install Xfce group of packages - name: Install Xfce group of packages
shell: yum groupinstall -y "Xfce Desktop" --exclude fedora-release\* shell: yum groupinstall -y "Xfce Desktop" --exclude fedora-release\*
when: xo_model == "none" and internet_available and ansible_distribution_version >= "21" when: xo_model == "none" and internet_available and ansible_distribution_version >= "21"
tags: #tags: download
- download
- name: Install X Windows on CentOS - 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" when: internet_available and ansible_distribution == "CentOS"
tags: #tags: download
- download
- name: Download TeamViewer software - name: Download TeamViewer software
get_url: get_url:
@ -29,8 +25,7 @@
dest: "{{ yum_packages_dir }}/{{ teamviewer_rpm_file }}" dest: "{{ yum_packages_dir }}/{{ teamviewer_rpm_file }}"
timeout: "{{ download_timeout }}" timeout: "{{ download_timeout }}"
when: internet_available | bool when: internet_available | bool
tags: #tags: download
- download
# F22 has issues with yum localinstall exclude for now # F22 has issues with yum localinstall exclude for now
- name: Do the install of TeamViewer, pulling in any required dependencies - name: Do the install of TeamViewer, pulling in any required dependencies

View file

@ -2,16 +2,15 @@
package: package:
name: vnstat name: vnstat
state: present state: present
tags: #tags: download
- download
- name: Install /etc/vnstat.conf from template - name: Install /etc/vnstat.conf from template
template: template:
src: vnstat.conf.j2 src: vnstat.conf.j2
dest: /etc/vnstat.conf dest: /etc/vnstat.conf
mode: 0744 # owner: root
owner: root # group: root
group: root mode: '0744'
- name: Create database for WAN to collect vnStat data - name: Create database for WAN to collect vnStat data
shell: /usr/bin/vnstat -i {{ iiab_wan_iface }} shell: /usr/bin/vnstat -i {{ iiab_wan_iface }}
@ -23,6 +22,7 @@
- name: Enable & Start vnStat's systemd service - name: Enable & Start vnStat's systemd service
systemd: systemd:
name: vnstat name: vnstat
daemon_reload: yes
enabled: yes enabled: yes
state: started state: started