1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00

Merge pull request #1259 from holta/master

Modernize package installations by removing squash_actions from ansible.cfg
This commit is contained in:
A Holt 2018-10-28 15:04:23 -04:00 committed by GitHub
commit 878eeee3a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 347 additions and 439 deletions

View file

@ -1,5 +1,6 @@
# Future overrides of /etc/ansible/ansible.cfg belong in this file. # Future overrides of /etc/ansible/ansible.cfg belong in this file.
# Also used by https://github.com/iiab/iiab-admin-console # Also used by https://github.com/iiab/iiab-admin-console
[defaults] #[defaults]
squash_actions = apk, apt, dnf, homebrew, openbsd_pkg, pacman, pkgng, yum, zypper, package # Disallowed by Ansible 2.11+ -- see https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_2.7.html#using-a-loop-on-a-package-module-via-squash-actions
#squash_actions = apk, apt, dnf, homebrew, openbsd_pkg, pacman, pkgng, yum, zypper, package

View file

@ -58,10 +58,8 @@
# for rpi, without rtc, we need time as soon as possible # for rpi, without rtc, we need time as soon as possible
- name: Install chrony package - name: Install chrony package
package: package:
name: "{{ item }}" name: chrony
state: present state: present
with_items:
- chrony
tags: tags:
- download - download

View file

@ -1,8 +1,6 @@
- name: Install yum packages (redhat) - name: Install yum/dnf packages (redhat)
package: package:
name: "{{ item }}" name:
state: present
with_items:
- yum-utils - yum-utils
- createrepo - createrepo
- wpa_supplicant - wpa_supplicant
@ -12,6 +10,7 @@
- nss-mdns - nss-mdns
- avahi - avahi
- avahi-tools - avahi-tools
state: present
when: is_redhat when: is_redhat
- name: Download & install usbmount, missing from Debian Stretch (debian-9) - name: Download & install usbmount, missing from Debian Stretch (debian-9)
@ -20,22 +19,9 @@
#timeout: "{{ download_timeout }}" # Ansible's apt module doesn't support timeout parameter; that's ok as usbmount_0.0.14.1_all.deb is only 10KB #timeout: "{{ download_timeout }}" # Ansible's apt module doesn't support timeout parameter; that's ok as usbmount_0.0.14.1_all.deb is only 10KB
when: internet_available and is_debian_9 when: internet_available and is_debian_9
#- name: Download usbmount -- not in Debian Stretch (debian-9)
# get_url:
# url: "{{ iiab_download_url }}/usbmount_0.0.14.1_all.deb"
# dest: "{{ downloads_dir }}"
# timeout: "{{ download_timeout }}"
# when: internet_available and is_debian_9
#
#- name: Install usbmount (debian-9)
# command: apt install -y {{ downloads_dir }}/usbmount_0.0.14.1_all.deb
# when: is_debian_9
- name: Install packages (debuntu) - name: Install packages (debuntu)
package: package:
name: "{{ item }}" name:
state: present
with_items:
- inetutils-syslogd - inetutils-syslogd
- wpasupplicant - wpasupplicant
- libnss-mdns - libnss-mdns
@ -43,13 +29,12 @@
- avahi-discover - avahi-discover
- exfat-fuse - exfat-fuse
- exfat-utils - exfat-utils
state: present
when: is_debuntu when: is_debuntu
- name: Install common packages - name: Install common packages
package: package:
name: "{{ item }}" name:
state: present
with_items:
- acpid - acpid
- mlocate - mlocate
- rsync - rsync
@ -75,50 +60,14 @@
- gawk - gawk
- curl - curl
- pandoc - pandoc
- lynx - lynx # already installed by 1-prep's roles/iiab-admin/tasks/access.yml
- ntfs-3g - ntfs-3g
#- name: Install pip as a commonly required package management system
# command: curl https://bootstrap.pypa.io/get-pip.py -o {{ downloads_dir }}/get-pip.py
#- name: Run the install script for pip
# command: python {{ downloads_dir }}/get-pip.py
- name: Install common Python packages
package:
name: "{{ item }}"
state: present state: present
with_items:
- name: Install common Python packages {python-pip, python-setuptools, python-virtualenv}
package:
name:
- python-pip - python-pip
- python-setuptools - python-setuptools
- python-virtualenv - python-virtualenv
state: present
# instructions state to start with a fully updated system before starting, stop using
# ansible as a crutch for developers not following the directions and taking short-cuts
#- name: Update common packages (not Debian)
# package: name={{ item }}
# state=latest
# with_items:
# - NetworkManager
# - glibc # CVE-2015-7547
# - bash
# - iptables
# when: is_redhat
# Consensus decision to try to slim down https://github.com/iiab/iiab/issues/518 (per 2017-11-20 community/team call @ http://minutes.iiab.io)
#- name: Update common packages (debuntu)
# package: name={{ item }}
# state=latest
# with_items:
# - libc6
# - bash
# - iptables
# when: is_debuntu
#- name: If version of Network manager has changed, subsequent nmcli commands will fail,restart now
# service: name=NetworkManager
# state=restarted
# when: not installing
# the above should use a handler - all reboots should wait until all
# mods are preformed

View file

@ -1,21 +1,19 @@
- name: Install AWStats package - name: Install packages {awstats, pwauth, openssl}
package: package:
name: "{{ item }}" name:
state: present
with_items:
- awstats - awstats
- pwauth - pwauth
- openssl - openssl
state: present
tags: tags:
- download - download
- name: Install AWStats package (debuntu) - name: Install packages libapache2-mod-authnz-external and apache2-utils (debuntu)
package: package:
name: "{{ item }}" name:
state: present
with_items:
- libapache2-mod-authnz-external - libapache2-mod-authnz-external
- apache2-utils - apache2-utils
state: present
when: is_debuntu when: is_debuntu
tags: tags:
- download - download
@ -37,7 +35,7 @@
- "{{ awstats_data_dir }}" - "{{ awstats_data_dir }}"
- "{{ apache_log_dir }}" - "{{ apache_log_dir }}"
- name: Install the Apache config for AWStats (debuntu) - name: Install Apache's awstats.conf from template (debuntu)
template: template:
src: apache.conf src: apache.conf
dest: "/etc/{{ apache_config_dir }}/awstats.conf" dest: "/etc/{{ apache_config_dir }}/awstats.conf"
@ -46,7 +44,7 @@
mode: 0644 mode: 0644
when: awstats_enabled and is_debuntu when: awstats_enabled and is_debuntu
- name: Install the Apache config for AWStats (OS's other than debuntu) - name: Install Apache's awstats.conf from template (OS's other than debuntu)
template: template:
src: apache-awstats.conf src: apache-awstats.conf
dest: "/etc/{{ apache_config_dir }}/awstats.conf" dest: "/etc/{{ apache_config_dir }}/awstats.conf"
@ -55,35 +53,35 @@
mode: 0644 mode: 0644
when: awstats_enabled and not is_debuntu when: awstats_enabled and not is_debuntu
- name: Make sure logrotate does not make logs unreadable (debuntu) - name: Ensure logrotate doesn't make logs unreadable (debuntu)
template: template:
src: logrotate.d.apache2 src: logrotate.d.apache2
dest: /etc/logrotate.d/apache2 dest: /etc/logrotate.d/apache2
when: is_debuntu when: is_debuntu
- name: See if AWStats package installed a config file - name: Check if package installed /etc/awstats/awstats.conf
stat: stat:
path: /etc/awstats/awstats.conf path: /etc/awstats/awstats.conf
register: awstats register: awstats
- name: If there was a config file installed by package, move it aside - name: If so, move it aside to /etc/awstats/awstats.conf.dist
command: mv /etc/awstats/awstats.conf /etc/awstats/awstats.conf.dist command: mv /etc/awstats/awstats.conf /etc/awstats/awstats.conf.dist
when: awstats.stat.islnk is defined and not awstats.stat.islnk when: awstats.stat.islnk is defined and not awstats.stat.islnk
- name: Enable AWStats (debuntu) - name: Create symlink awstats.conf from sites-enabled to sites-available (debuntu)
file: file:
src: /etc/apache2/sites-available/awstats.conf src: /etc/apache2/sites-available/awstats.conf
path: /etc/apache2/sites-enabled/awstats.conf path: /etc/apache2/sites-enabled/awstats.conf
state: link state: link
when: awstats_enabled and is_debuntu when: awstats_enabled and is_debuntu
- name: Disable AWStats (debuntu) - name: Remove symlink from sites-enabled, to disable AWStats (debuntu)
file: file:
path: /etc/apache2/sites-enabled/awstats.conf path: /etc/apache2/sites-enabled/awstats.conf
state: absent state: absent
when: not awstats_enabled and is_debuntu when: not awstats_enabled and is_debuntu
- name: Install the AWStats config - name: Install /etc/awstats/awstats.schoolserver.conf
template: template:
src: awstats.schoolserver.conf.j2 src: awstats.schoolserver.conf.j2
dest: /etc/awstats/awstats.schoolserver.conf dest: /etc/awstats/awstats.schoolserver.conf
@ -92,10 +90,10 @@
mode: 0644 mode: 0644
when: awstats_enabled when: awstats_enabled
- name: Create a symbolic link to use when access is by IP address - name: Create a symlink /etc/awstats/awstats.conf for access by IP address
file: file:
src: /etc/awstats/awstats.schoolserver.conf src: /etc/awstats/awstats.schoolserver.conf
dest: /etc/awstats/awstats.conf path: /etc/awstats/awstats.conf
state: link state: link
when: awstats_enabled when: awstats_enabled

View file

@ -5,13 +5,12 @@
path: "/usr/bin/calibre" path: "/usr/bin/calibre"
register: calib_executable register: calib_executable
- name: Install Calibre via OS's package installer (IF /usr/bin/calibre MISSING) - name: Install latest packages calibre and calibre-bin, via OS's package installer (IF not rpi AND /usr/bin/calibre MISSING)
package: package:
name: "{{ item }}" name:
state: latest
with_items:
- calibre - calibre
- calibre-bin - calibre-bin
state: latest
when: internet_available and not is_rpi and (not calib_executable.stat.exists) when: internet_available and not is_rpi and (not calib_executable.stat.exists)
- name: Install Calibre .debs IF calibre_via_debs (AND /usr/bin/calibre WAS MISSING) - name: Install Calibre .debs IF calibre_via_debs (AND /usr/bin/calibre WAS MISSING)

View file

@ -1,10 +1,8 @@
# administer this service by browsing to localhost:631 # administer this service by browsing to localhost:631
- name: Get the CUPS package installed - name: Install cups package
package: package:
name: "{{ item }}" name: cups
state: present state: present
with_items:
- cups
when: cups_install when: cups_install
tags: tags:
- download - download

View file

@ -1,9 +1,7 @@
- name: Install ejabberd packages - name: Install ejabberd package
package: package:
name: "{{ item }}" name: ejabberd
state: present state: present
with_items:
- ejabberd
tags: tags:
- download - download

View file

@ -1,9 +1,8 @@
- name: Install textmode remote access packages - name: Install textmode remote access packages {screen, lynx}
package: package:
name: "{{ item }}" name:
state: present
with_items:
- screen - screen
- lynx - lynx
state: present
tags: tags:
- download - download

View file

@ -1,10 +1,9 @@
- name: Install packages required by MediaWiki - name: Install packages php{{ php_version }}-intl and php{{ php_version }}-mbstring
package: package:
name: "{{ item }}" name:
state: present
with_items:
- "php{{ php_version }}-intl" - "php{{ php_version }}-intl"
- "php{{ php_version }}-mbstring" - "php{{ php_version }}-mbstring"
state: present
#tags: #tags:
# - download # - download
@ -15,7 +14,6 @@
timeout: "{{ download_timeout }}" timeout: "{{ download_timeout }}"
#force: yes #force: yes
#backup: yes #backup: yes
#register: mediawiki_download_output
when: internet_available when: internet_available
- name: Unpack it to permanent location {{ mediawiki_abs_path }} - name: Unpack it to permanent location {{ mediawiki_abs_path }}

View file

@ -1,10 +1,9 @@
- name: Install MongoDB required packages - name: Install packages mongodb-server and mongodb
package: package:
name: "{{ item }}" name:
state: present
with_items:
- mongodb-server - mongodb-server
- mongodb - mongodb
state: present
when: internet_available when: internet_available
tags: tags:
- download - download
@ -46,20 +45,6 @@
state: stopped state: stopped
when: not mongodb_enabled when: not mongodb_enabled
#- name: Restart service if enabled
# service:
# name: mongodb
# enabled: yes
# state: restarted
# when: mongodb_enabled
#- name: Stop service if not enabled
# service:
# name: mongodb
# enabled: no
# state: stopped
# when: not mongodb_enabled
- name: Add 'mongodb' to list of services at {{ iiab_ini_file }} - name: Add 'mongodb' to list of services at {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" dest: "{{ iiab_ini_file }}"

View file

@ -1,17 +1,14 @@
- name: Install Moodle required packages (OS's other than debuntu) - name: Install packages python-psycopg2 and php-pgsql (OS's other than debuntu)
package: package:
name: "{{ item }}" name:
state: present
with_items:
- python-psycopg2 - python-psycopg2
- php-pgsql - php-pgsql
state: present
when: not is_debuntu when: not is_debuntu
- name: Install Moodle required packages (debuntu) - name: Install python-psycopg2 and 4 php packages (debuntu)
package: package:
name: "{{ item }}" name:
state: present
with_items:
- python-psycopg2 - python-psycopg2
- php{{ php_version }}-pgsql - php{{ php_version }}-pgsql
- php{{ php_version }}-curl - php{{ php_version }}-curl
@ -20,6 +17,7 @@
#- php{{ php_version }}-mbstring #- php{{ php_version }}-mbstring
# mbstring is now included in php-cli # mbstring is now included in php-cli
- php{{ php_version }}-cli - php{{ php_version }}-cli
state: present
when: is_debuntu when: is_debuntu
- name: php-zip name (debian-9 or ubuntu) - name: php-zip name (debian-9 or ubuntu)
@ -70,12 +68,12 @@
mode: 0770 mode: 0770
state: directory state: directory
- name: Remove stock Moodle config file - name: Remove Apache's stock moodle.conf
file: file:
path: "/etc/{{ apache_config_dir }}/moodle.conf" path: "/etc/{{ apache_config_dir }}/moodle.conf"
state: absent state: absent
- name: Put Moodle config file in place - name: Install Apache's 022-moodle.conf from template
template: template:
src: 022-moodle.j2 src: 022-moodle.j2
dest: "/etc/{{ apache_config_dir }}/022-moodle.conf" dest: "/etc/{{ apache_config_dir }}/022-moodle.conf"
@ -84,14 +82,14 @@
mode: 0644 mode: 0644
when: moodle_enabled when: moodle_enabled
- name: Enable Moodle (debuntu) - name: Create symlink 022-moodle.conf from sites-enabled to sites-available (debuntu)
file: file:
src: /etc/apache2/sites-available/022-moodle.conf src: /etc/apache2/sites-available/022-moodle.conf
dest: /etc/apache2/sites-enabled/022-moodle.conf dest: /etc/apache2/sites-enabled/022-moodle.conf
state: link state: link
when: moodle_enabled and is_debuntu when: moodle_enabled and is_debuntu
- name: Disable Moodle (debuntu) - name: Remove symlink 022-moodle.conf (debuntu)
file: file:
path: /etc/apache2/sites-enabled/022-moodle.conf path: /etc/apache2/sites-enabled/022-moodle.conf
state: absent state: absent
@ -122,7 +120,7 @@
become: yes become: yes
become_user: postgres become_user: postgres
- name: Put a startup install script in place - name: Put moodle_installer script in {{ moodle_base }}
template: template:
dest: "{{ moodle_base }}" dest: "{{ moodle_base }}"
src: moodle_installer src: moodle_installer
@ -140,16 +138,16 @@
name: "{{ apache_service }}" name: "{{ apache_service }}"
state: restarted state: restarted
- name: See if config.php exists - name: See if {{ moodle_base }}/config.php exists
stat: stat:
path: "{{ moodle_base }}/config.php" path: "{{ moodle_base }}/config.php"
register: config register: config
- name: Execute Moodle startup script - name: Execute moodle_installer script
shell: '{{ moodle_base }}/moodle_installer' shell: '{{ moodle_base }}/moodle_installer'
when: config.stat.exists is defined and not config.stat.exists when: config.stat.exists is defined and not config.stat.exists
- name: Give Apache permission to read config file - name: Give Apache permission to read {{ moodle_base }}/config.php
#command: chown -R {{ apache_user }} {{ moodle_base }} #command: chown -R {{ apache_user }} {{ moodle_base }}
file: file:
path: "{{ moodle_base }}/config.php" path: "{{ moodle_base }}/config.php"

View file

@ -1,29 +1,27 @@
- name: Install Munin package (debuntu) - name: Install 5 package for Munin (debuntu)
package: package:
name: "{{ item }}" name:
state: present
with_items:
- munin - munin
- munin-node - munin-node
- munin-plugins-extra - munin-plugins-extra
- libcgi-fast-perl - libcgi-fast-perl
- libapache2-mod-fcgid - libapache2-mod-fcgid
state: present
tags: tags:
- download - download
when: is_debuntu when: is_debuntu
- name: Install Munin package (OS's other than debuntu) - name: Install packages munin and munin-node (OS's other than debuntu)
package: package:
name: "{{ item }}" name:
state: present
with_items:
- munin - munin
- munin-node - munin-node
state: present
tags: tags:
- download - download
when: not is_debuntu when: not is_debuntu
- name: Copy Munin config file - 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 }}"
@ -34,7 +32,7 @@
- { 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' }
- name: Create admin user - name: Establish username/password Admin/changeme in /etc/munin/munin-htpasswd
htpasswd: htpasswd:
path: /etc/munin/munin-htpasswd path: /etc/munin/munin-htpasswd
name: Admin name: Admin
@ -49,21 +47,20 @@
state: started state: started
when: munin_enabled when: munin_enabled
- name: Enable Apache lookup (debuntu) - name: Create symlink munin24.conf from sites-enabled to sites-available (debuntu)
file: file:
src: /etc/apache2/sites-available/munin24.conf src: /etc/apache2/sites-available/munin24.conf
dest: /etc/apache2/sites-enabled/munin24.conf path: /etc/apache2/sites-enabled/munin24.conf
state: link state: link
when: munin_enabled and is_debuntu when: munin_enabled and is_debuntu
- name: Disable Apache lookup (debuntu) - name: Remove symlink munin24.conf in sites-enabled if not munin_enabled (debuntu)
file: file:
src: /etc/apache2/sites-available/munin24.conf path: /etc/apache2/sites-enabled/munin24.conf
dest: /etc/apache2/sites-enabled/munin24.conf
state: absent state: absent
when: not munin_enabled and is_debuntu when: not munin_enabled and is_debuntu
- name: Disable munin-node service when it becomes disabled - name: Disable munin-node service if not munin_enabled
service: service:
name: munin-node name: munin-node
enabled: no enabled: no

View file

@ -1,8 +1,6 @@
- name: Install MySQL (debuntu) - name: Install MySQL (debuntu)
package: package:
name: "{{ item }}" name:
state: present
with_items:
- mariadb-server - mariadb-server
- mariadb-client - mariadb-client
- python-mysqldb - python-mysqldb
@ -13,29 +11,28 @@
- php{{ php_version }}-imap - php{{ php_version }}-imap
- php{{ php_version }}-ldap - php{{ php_version }}-ldap
- php{{ php_version }}-odbc - php{{ php_version }}-odbc
# - php{{ php_version }}-xml #- php{{ php_version }}-xml
- php{{ php_version }}-xmlrpc - php{{ php_version }}-xmlrpc
state: present
when: is_debuntu when: is_debuntu
tags: tags:
- download - download
- name: php-xml (ubuntu or debian-9) - name: php-xml (ubuntu or debian-9)
package: package:
name: "php{{ php_version }}-xml" name: "php{{ php_version }}-xml"
state: present state: present
when: is_ubuntu or is_debian_9 when: is_ubuntu or is_debian_9
- name: php-xml (debian-8) - name: php-xml (debian-8)
package: package:
name: "php-xml-parser" name: "php-xml-parser"
state: present state: present
when: is_debian_8 when: is_debian_8
- name: Install MySQL (OS's other than debuntu) - name: Install MySQL (OS's other than debuntu)
package: package:
name: "{{ item }}" name:
state: present
with_items:
- MySQL-python - MySQL-python
- mysql - mysql
- php - php
@ -47,27 +44,28 @@
- php-odbc - php-odbc
- php-xml - php-xml
- php-xmlrpc - php-xmlrpc
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
# Name of mysql service varies by OS so softcoded in 1-prep # Name of mysql service varies by OS so softcoded in 1-prep
- name: Start the MySQL service - name: Start the MySQL service
service: service:
name: "{{ mysql_service }}" name: "{{ mysql_service }}"
state: started state: started
- name: Enable the MySQL service - name: Enable the MySQL service
service: service:
name: "{{ mysql_service }}" name: "{{ mysql_service }}"
enabled: yes enabled: yes
@ -76,7 +74,7 @@
# 'localhost' needs to be the last item for idempotency, see # 'localhost' needs to be the last item for idempotency, see
# http://ansible.cc/docs/modules.html#mysql-user # http://ansible.cc/docs/modules.html#mysql-user
# unfortunately it still doesn't work # unfortunately it still doesn't work
- name: Update MySQL root password for localhost root accounts - name: Update MySQL root password for localhost root accounts
mysql_user: mysql_user:
name: root name: root
host: "{{ item }}" host: "{{ item }}"
@ -86,7 +84,7 @@
- localhost - localhost
when: mysql_enabled when: mysql_enabled
- name: Copy .my.cnf file with root password credentials - name: Install .my.cnf file from template, with root password credentials
template: template:
src: my.cnf.j2 src: my.cnf.j2
dest: /root/.my.cnf dest: /root/.my.cnf
@ -94,46 +92,46 @@
mode: 0600 mode: 0600
when: mysql_enabled when: mysql_enabled
- name: Update MySQL root password for all remaining root accounts - name: Update MySQL root password for all remaining root accounts
mysql_user: mysql_user:
name: root name: root
host: "{{ item }}" host: "{{ item }}"
password: "{{ mysql_root_password }}" password: "{{ mysql_root_password }}"
priv: "*.*:ALL,GRANT" priv: "*.*:ALL,GRANT"
with_items: with_items:
# - "{{ iiab_hostname }}.{{ iiab_domain }}" #- "{{ iiab_hostname }}.{{ iiab_domain }}"
- 127.0.0.1 - 127.0.0.1
- ::1 - ::1
when: mysql_enabled when: mysql_enabled
- name: Delete anonymous MySQL server user for {{ ansible_hostname }} - name: Delete anonymous MySQL server user for {{ ansible_hostname }}
mysql_user: mysql_user:
user: "" user: ""
host: "{{ ansible_hostname }}" host: "{{ ansible_hostname }}"
state: absent state: absent
when: mysql_enabled when: mysql_enabled
- name: Delete anonymous MySQL server user for localhost - name: Delete anonymous MySQL server user for localhost
mysql_user: mysql_user:
user: "" user: ""
state: absent state: absent
when: mysql_enabled when: mysql_enabled
- name: Remove the MySQL test database - name: Remove the MySQL test database
mysql_db: mysql_db:
db: test db: test
state: absent state: absent
when: mysql_enabled when: mysql_enabled
# we had to start mysql in order to configure it, now turn if off if not enabled # we had to start mysql in order to configure it, now turn if off if not enabled
- name: Provisionally Disable the MySQL service - name: Provisionally Disable the MySQL service
service: service:
name: "{{ mysql_service }}" name: "{{ mysql_service }}"
enabled: no enabled: no
state: stopped state: stopped
when: not mysql_enabled when: not mysql_enabled
- name: Add 'mysql' to list of services at {{ iiab_ini_file }} - name: Add 'mysql' to list of services at {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" dest: "{{ iiab_ini_file }}"
section: mysql section: mysql

View file

@ -1,9 +1,7 @@
- name: Install DansGuardian packages - name: Install dansguardian package
package: package:
name: "{{ item }}" name: dansguardian
state: present state: present
with_items:
- dansguardian
tags: tags:
- download - download

View file

@ -1,21 +1,19 @@
- name: Install named packages (if debuntu) - name: Install named packages {bind9, bind9utils} (if debuntu)
package: package:
name: "{{ item }}" name:
state: present
with_items:
- bind9 - bind9
- bind9utils - bind9utils
state: present
when: is_debuntu when: is_debuntu
tags: tags:
- download - download
- name: Install named packages (if not debuntu) - name: Install named packages {bind, bind-utils} (if not debuntu)
package: package:
name: "{{ item }}" name:
state: present
with_items:
- bind - bind
- bind-utils - bind-utils
state: present
when: not is_debuntu when: not is_debuntu
tags: tags:
- download - download

View file

@ -1,10 +1,9 @@
- name: Install Squid packages - name: Install Squid packages {{ proxy }} and cadaver
package: package:
name: "{{ item }}" name:
state: present
with_items:
- "{{ proxy }}" - "{{ proxy }}"
- cadaver - cadaver
state: present
tags: tags:
- download - download

View file

@ -26,40 +26,39 @@
tags: tags:
- download - download
- name: Ubuntu and Debian treat names differently (Debian) # Ubuntu and Debian treat names differently
- name: Install 3 php packages (debian)
package: package:
name: "{{ item }}" name:
state: present
with_items:
- "libapache2-mod-php{{ php_version }}" - "libapache2-mod-php{{ php_version }}"
- "php{{ php_version }}-mbstring" - "php{{ php_version }}-mbstring"
- "php{{ php_version }}-zip" - "php{{ php_version }}-zip"
state: present
when: is_debian when: is_debian
- name: Ubuntu and Debian treat names differently (Ubuntu) # Ubuntu and Debian treat names differently
- name: Install 4 php packages (ubuntu)
package: package:
name: "{{ item }}" name:
state: present
with_items:
- libapache2-mod-php - libapache2-mod-php
- php-imagick - php-imagick
- php-zip - php-zip
- php-mbstring - php-mbstring
state: present
when: is_ubuntu when: is_ubuntu
- name: Install list of packages (debuntu) - name: Install 5 more php packages (debuntu)
package: package:
name: "{{ item }}" name:
state: present
with_items:
- "php{{ php_version }}-gd" - "php{{ php_version }}-gd"
- "php{{ php_version }}-json" - "php{{ php_version }}-json"
- "php{{ php_version }}-mysql" - "php{{ php_version }}-mysql"
- "php{{ php_version }}-curl" - "php{{ php_version }}-curl"
- "php{{ php_version }}-intl" - "php{{ php_version }}-intl"
state: present
when: is_debuntu when: is_debuntu
- name: In php7.2, php dropped mcrypt - name: In php7.2, php dropped mcrypt (debuntu but not ubuntu-18)
package: package:
name: "php{{ php_version }}-mcrypt" name: "php{{ php_version }}-mcrypt"
state: present state: present
@ -68,11 +67,9 @@
# we need to install the rpm in order to get the dependencies # we need to install the rpm in order to get the dependencies
# but we only need to do this the first time # but we only need to do this the first time
- name: Install list of packages (redhat) - name: Install 7 php packages (redhat)
package: package:
name: "{{ item }}" name:
state: present
with_items:
- php - php
- php-gd - php-gd
- php-json - php-json
@ -80,8 +77,9 @@
- php-curl - php-curl
- php-intl - php-intl
- php-mcrypt - php-mcrypt
# centos does not have a package for php-imagick # CentOS does not have a package for php-imagick
# - php-imagick #- php-imagick
state: present
when: is_redhat when: is_redhat
- name: Copy it to permanent location /opt (OS's other than Fedora 18) - name: Copy it to permanent location /opt (OS's other than Fedora 18)

View file

@ -4,7 +4,7 @@
nextcloud_required_ip: "{{ ansible_default_ipv4.network }}/{{ ansible_default_ipv4.netmask }}" nextcloud_required_ip: "{{ ansible_default_ipv4.network }}/{{ ansible_default_ipv4.netmask }}"
when: ansible_default_ipv4.network is defined when: ansible_default_ipv4.network is defined
- name: Enable Nextcloud by copying template to httpd config - name: Install Apache's nextcloud.conf from template, for http://box/nextcloud
template: template:
src: nextcloud.conf.j2 src: nextcloud.conf.j2
dest: "/etc/{{ apache_config_dir }}/nextcloud.conf" dest: "/etc/{{ apache_config_dir }}/nextcloud.conf"
@ -13,20 +13,20 @@
mode: 0644 mode: 0644
when: nextcloud_enabled when: nextcloud_enabled
- name: Enable Nextcloud (debuntu) - name: Create symlink from sites-available to sites-enabled for http://box/nextcloud (debuntu)
file: file:
path: /etc/apache2/sites-enabled/nextcloud.conf
src: /etc/apache2/sites-available/nextcloud.conf src: /etc/apache2/sites-available/nextcloud.conf
path: /etc/apache2/sites-enabled/nextcloud.conf
state: link state: link
when: nextcloud_enabled and is_debuntu when: nextcloud_enabled and is_debuntu
- name: Remove the config file if not nextcloud_enabled (redhat) - name: Remove nextcloud.conf if not nextcloud_enabled (redhat)
file: file:
path: "/etc/{{ apache_config_dir }}/nextcloud.conf" path: "/etc/{{ apache_config_dir }}/nextcloud.conf"
state: absent state: absent
when: not nextcloud_enabled and is_redhat when: not nextcloud_enabled and is_redhat
- name: Restart Apache, so it picks up the new aliases - name: Restart Apache, enabling http://box/nextcloud
service: service:
name: "{{ apache_service }}" name: "{{ apache_service }}"
state: restarted state: restarted
@ -34,9 +34,11 @@
# the install wizard does not succeed if already installed # the install wizard does not succeed if already installed
- name: Determine if Nextcloud is installed - name: Determine if Nextcloud is installed
shell: > shell: >
sudo -u {{ apache_user }} php #sudo -u {{ apache_user }}
'{{ nextcloud_prefix }}/nextcloud/occ' status | php '{{ nextcloud_prefix }}/nextcloud/occ' status |
gawk '/installed:/ { print $3 }' gawk '/installed:/ { print $3 }'
become: yes
become_user: "{{ apache_user }}"
register: returned register: returned
- name: Run Nextcloud initial install wizard - name: Run Nextcloud initial install wizard
@ -59,9 +61,11 @@
- name: Determine if Nextcloud user exists already - name: Determine if Nextcloud user exists already
shell: > shell: >
sudo -u {{ apache_user }} php #sudo -u {{ apache_user }}
'{{ nextcloud_prefix }}/nextcloud/occ' user:list | php '{{ nextcloud_prefix }}/nextcloud/occ' user:list |
grep {{ nextcloud_user }} | wc | cut -d' ' -f1 grep {{ nextcloud_user }} | wc | cut -d' ' -f1
become: yes
become_user: "{{ apache_user }}"
register: returned_count register: returned_count
# nextcloud wants to make users rather than just mysql users and not done # nextcloud wants to make users rather than just mysql users and not done
@ -74,8 +78,8 @@
--group="users" {{ nextcloud_user }}' --group="users" {{ nextcloud_user }}'
when: nextcloud_enabled and returned_count == "0" when: nextcloud_enabled and returned_count == "0"
- name: Remove Rewrite URL - name: Remove overwrite.cli.url line (Rewrite URL) from /opt/nextcloud/config/config.php
lineinfile: lineinfile:
regexp: "overwrite.cli.url" regexp: "overwrite.cli.url"
state: absent state: absent
dest: "{{ nextcloud_prefix }}/nextcloud/config/config.php" path: "{{ nextcloud_prefix }}/nextcloud/config/config.php"

View file

@ -1,10 +1,9 @@
- name: Install OpenVPN and Nmap packages - name: Install OpenVPN and Nmap packages
package: package:
name: "{{ item }}" name:
state: present
with_items:
- openvpn - openvpn
- nmap - nmap
state: present
tags: tags:
- download - download

View file

@ -1,15 +1,14 @@
- name: Install PostgreSQL packages - name: Install postgresql package
package: package:
name: "{{ item }}" name: postgresql
state: present state: present
with_items:
- postgresql
tags: tags:
- download - download
- name: Install postgresql-client (debuntu) - name: Install postgresql-client (debuntu)
package: package:
name: postgresql-client name: postgresql-client
state: present
when: is_debuntu when: is_debuntu
tags: tags:
- download - download
@ -17,6 +16,7 @@
- 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
when: not is_debuntu when: not is_debuntu
tags: tags:
- download - download

View file

@ -17,15 +17,14 @@
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).
- name: Ensure Samba-related packages are installed - name: Install packages {samba, samba-client, samba-common, cifs-client}
package: package:
name: "{{ item }}" name:
state: present
with_items:
- samba - samba
- samba-client - samba-client
- samba-common - samba-common
- cifs-utils - cifs-utils
state: present
tags: tags:
- samba - samba
- download - download

View file

@ -2,6 +2,8 @@
- name: Wipe /library/www/html/sugarizer* if installing sugarizer-1.0 - name: Wipe /library/www/html/sugarizer* if installing sugarizer-1.0
shell: "rm -rf {{ doc_root }}/sugarizer*" shell: "rm -rf {{ doc_root }}/sugarizer*"
args:
warn: no
when: sugarizer_version == "sugarizer-1.0" when: sugarizer_version == "sugarizer-1.0"
# 1. DOWNLOAD+LINK /opt/iiab/sugarizer # 1. DOWNLOAD+LINK /opt/iiab/sugarizer
@ -86,13 +88,12 @@
# where it upgrades /usr/bin/npm in place: # where it upgrades /usr/bin/npm in place:
# https://askubuntu.com/questions/1036278/npm-is-incorrect-version-on-latest-ubuntu-18-04-installation # https://askubuntu.com/questions/1036278/npm-is-incorrect-version-on-latest-ubuntu-18-04-installation
- name: Install Node.js and npm (ubuntu-18 or not debuntu) - name: Install latest packages nodejs and npm (ubuntu-18 or not debuntu)
package: package:
name: "{{ item }}" name:
state: latest
with_items:
- nodejs - nodejs
- npm - npm
state: latest
when: internet_available and (is_ubuntu_18 or not is_debuntu) when: internet_available and (is_ubuntu_18 or not is_debuntu)
# 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules # 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules

View file

@ -1,10 +1,9 @@
- name: Install packages transmission-daemon and transmission-cli - name: Install packages transmission-daemon and transmission-cli
package: package:
name: "{{ item }}" name:
state: present
with_items:
- transmission-daemon - transmission-daemon
- transmission-cli - transmission-cli
state: present
- name: Create /library/transmission download directory - name: Create /library/transmission download directory
file: file:

View file

@ -1,14 +1,11 @@
--- - name: Install vnstat package
- name: Install required packages
package: package:
name: "{{ item }}" name: vnstat
state: present state: present
with_items:
- vnstat
tags: tags:
- download - download
- name: Put the config file in place - 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
@ -23,7 +20,7 @@
shell: /usr/bin/vnstat -i {{ iiab_lan_iface }} shell: /usr/bin/vnstat -i {{ iiab_lan_iface }}
when: iiab_lan_iface is defined when: iiab_lan_iface is defined
- name: Start vnStat daemon via systemd - name: Enable & Start vnStat's systemd service
service: service:
name: vnstat name: vnstat
enabled: yes enabled: yes