mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
Merge pull request #1259 from holta/master
Modernize package installations by removing squash_actions from ansible.cfg
This commit is contained in:
commit
878eeee3a3
24 changed files with 347 additions and 439 deletions
|
@ -1,5 +1,6 @@
|
|||
# Future overrides of /etc/ansible/ansible.cfg belong in this file.
|
||||
# Also used by https://github.com/iiab/iiab-admin-console
|
||||
|
||||
[defaults]
|
||||
squash_actions = apk, apt, dnf, homebrew, openbsd_pkg, pacman, pkgng, yum, zypper, package
|
||||
#[defaults]
|
||||
# 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
|
||||
|
|
|
@ -58,10 +58,8 @@
|
|||
# for rpi, without rtc, we need time as soon as possible
|
||||
- name: Install chrony package
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
name: chrony
|
||||
state: present
|
||||
with_items:
|
||||
- chrony
|
||||
tags:
|
||||
- download
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
- name: Install yum packages (redhat)
|
||||
- name: Install yum/dnf packages (redhat)
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- yum-utils
|
||||
- createrepo
|
||||
- wpa_supplicant
|
||||
|
@ -12,6 +10,7 @@
|
|||
- nss-mdns
|
||||
- avahi
|
||||
- avahi-tools
|
||||
state: present
|
||||
when: is_redhat
|
||||
|
||||
- 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
|
||||
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)
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- inetutils-syslogd
|
||||
- wpasupplicant
|
||||
- libnss-mdns
|
||||
|
@ -43,13 +29,12 @@
|
|||
- avahi-discover
|
||||
- exfat-fuse
|
||||
- exfat-utils
|
||||
state: present
|
||||
when: is_debuntu
|
||||
|
||||
- name: Install common packages
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- acpid
|
||||
- mlocate
|
||||
- rsync
|
||||
|
@ -75,50 +60,14 @@
|
|||
- gawk
|
||||
- curl
|
||||
- pandoc
|
||||
- lynx
|
||||
- lynx # already installed by 1-prep's roles/iiab-admin/tasks/access.yml
|
||||
- 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
|
||||
with_items:
|
||||
|
||||
- name: Install common Python packages {python-pip, python-setuptools, python-virtualenv}
|
||||
package:
|
||||
name:
|
||||
- python-pip
|
||||
- python-setuptools
|
||||
- python-virtualenv
|
||||
|
||||
# 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
|
||||
state: present
|
||||
|
|
|
@ -1,21 +1,19 @@
|
|||
- name: Install AWStats package
|
||||
- name: Install packages {awstats, pwauth, openssl}
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- awstats
|
||||
- pwauth
|
||||
- openssl
|
||||
state: present
|
||||
tags:
|
||||
- download
|
||||
|
||||
- name: Install AWStats package (debuntu)
|
||||
- name: Install packages libapache2-mod-authnz-external and apache2-utils (debuntu)
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- libapache2-mod-authnz-external
|
||||
- apache2-utils
|
||||
state: present
|
||||
when: is_debuntu
|
||||
tags:
|
||||
- download
|
||||
|
@ -37,7 +35,7 @@
|
|||
- "{{ awstats_data_dir }}"
|
||||
- "{{ apache_log_dir }}"
|
||||
|
||||
- name: Install the Apache config for AWStats (debuntu)
|
||||
- name: Install Apache's awstats.conf from template (debuntu)
|
||||
template:
|
||||
src: apache.conf
|
||||
dest: "/etc/{{ apache_config_dir }}/awstats.conf"
|
||||
|
@ -46,7 +44,7 @@
|
|||
mode: 0644
|
||||
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:
|
||||
src: apache-awstats.conf
|
||||
dest: "/etc/{{ apache_config_dir }}/awstats.conf"
|
||||
|
@ -55,35 +53,35 @@
|
|||
mode: 0644
|
||||
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:
|
||||
src: logrotate.d.apache2
|
||||
dest: /etc/logrotate.d/apache2
|
||||
when: is_debuntu
|
||||
|
||||
- name: See if AWStats package installed a config file
|
||||
- name: Check if package installed /etc/awstats/awstats.conf
|
||||
stat:
|
||||
path: /etc/awstats/awstats.conf
|
||||
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
|
||||
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:
|
||||
src: /etc/apache2/sites-available/awstats.conf
|
||||
path: /etc/apache2/sites-enabled/awstats.conf
|
||||
state: link
|
||||
when: awstats_enabled and is_debuntu
|
||||
|
||||
- name: Disable AWStats (debuntu)
|
||||
- name: Remove symlink from sites-enabled, to disable AWStats (debuntu)
|
||||
file:
|
||||
path: /etc/apache2/sites-enabled/awstats.conf
|
||||
state: absent
|
||||
when: not awstats_enabled and is_debuntu
|
||||
|
||||
- name: Install the AWStats config
|
||||
- name: Install /etc/awstats/awstats.schoolserver.conf
|
||||
template:
|
||||
src: awstats.schoolserver.conf.j2
|
||||
dest: /etc/awstats/awstats.schoolserver.conf
|
||||
|
@ -92,10 +90,10 @@
|
|||
mode: 0644
|
||||
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:
|
||||
src: /etc/awstats/awstats.schoolserver.conf
|
||||
dest: /etc/awstats/awstats.conf
|
||||
path: /etc/awstats/awstats.conf
|
||||
state: link
|
||||
when: awstats_enabled
|
||||
|
||||
|
|
|
@ -5,13 +5,12 @@
|
|||
path: "/usr/bin/calibre"
|
||||
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:
|
||||
name: "{{ item }}"
|
||||
state: latest
|
||||
with_items:
|
||||
name:
|
||||
- calibre
|
||||
- calibre-bin
|
||||
state: latest
|
||||
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)
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
# administer this service by browsing to localhost:631
|
||||
- name: Get the CUPS package installed
|
||||
- name: Install cups package
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
name: cups
|
||||
state: present
|
||||
with_items:
|
||||
- cups
|
||||
when: cups_install
|
||||
tags:
|
||||
- download
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
- name: Install ejabberd packages
|
||||
- name: Install ejabberd package
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
name: ejabberd
|
||||
state: present
|
||||
with_items:
|
||||
- ejabberd
|
||||
tags:
|
||||
- download
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
- name: Install textmode remote access packages
|
||||
- name: Install textmode remote access packages {screen, lynx}
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- screen
|
||||
- lynx
|
||||
state: present
|
||||
tags:
|
||||
- download
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
- name: Install packages required by MediaWiki
|
||||
- name: Install packages php{{ php_version }}-intl and php{{ php_version }}-mbstring
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- "php{{ php_version }}-intl"
|
||||
- "php{{ php_version }}-mbstring"
|
||||
state: present
|
||||
#tags:
|
||||
# - download
|
||||
|
||||
|
@ -15,7 +14,6 @@
|
|||
timeout: "{{ download_timeout }}"
|
||||
#force: yes
|
||||
#backup: yes
|
||||
#register: mediawiki_download_output
|
||||
when: internet_available
|
||||
|
||||
- name: Unpack it to permanent location {{ mediawiki_abs_path }}
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
- name: Install MongoDB required packages
|
||||
- name: Install packages mongodb-server and mongodb
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- mongodb-server
|
||||
- mongodb
|
||||
state: present
|
||||
when: internet_available
|
||||
tags:
|
||||
- download
|
||||
|
@ -46,20 +45,6 @@
|
|||
state: stopped
|
||||
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 }}
|
||||
ini_file:
|
||||
dest: "{{ iiab_ini_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:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- python-psycopg2
|
||||
- php-pgsql
|
||||
state: present
|
||||
when: not is_debuntu
|
||||
|
||||
- name: Install Moodle required packages (debuntu)
|
||||
- name: Install python-psycopg2 and 4 php packages (debuntu)
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- python-psycopg2
|
||||
- php{{ php_version }}-pgsql
|
||||
- php{{ php_version }}-curl
|
||||
|
@ -20,6 +17,7 @@
|
|||
#- php{{ php_version }}-mbstring
|
||||
# mbstring is now included in php-cli
|
||||
- php{{ php_version }}-cli
|
||||
state: present
|
||||
when: is_debuntu
|
||||
|
||||
- name: php-zip name (debian-9 or ubuntu)
|
||||
|
@ -70,12 +68,12 @@
|
|||
mode: 0770
|
||||
state: directory
|
||||
|
||||
- name: Remove stock Moodle config file
|
||||
- name: Remove Apache's stock moodle.conf
|
||||
file:
|
||||
path: "/etc/{{ apache_config_dir }}/moodle.conf"
|
||||
state: absent
|
||||
|
||||
- name: Put Moodle config file in place
|
||||
- name: Install Apache's 022-moodle.conf from template
|
||||
template:
|
||||
src: 022-moodle.j2
|
||||
dest: "/etc/{{ apache_config_dir }}/022-moodle.conf"
|
||||
|
@ -84,14 +82,14 @@
|
|||
mode: 0644
|
||||
when: moodle_enabled
|
||||
|
||||
- name: Enable Moodle (debuntu)
|
||||
- name: Create symlink 022-moodle.conf from sites-enabled to sites-available (debuntu)
|
||||
file:
|
||||
src: /etc/apache2/sites-available/022-moodle.conf
|
||||
dest: /etc/apache2/sites-enabled/022-moodle.conf
|
||||
state: link
|
||||
when: moodle_enabled and is_debuntu
|
||||
|
||||
- name: Disable Moodle (debuntu)
|
||||
- name: Remove symlink 022-moodle.conf (debuntu)
|
||||
file:
|
||||
path: /etc/apache2/sites-enabled/022-moodle.conf
|
||||
state: absent
|
||||
|
@ -122,7 +120,7 @@
|
|||
become: yes
|
||||
become_user: postgres
|
||||
|
||||
- name: Put a startup install script in place
|
||||
- name: Put moodle_installer script in {{ moodle_base }}
|
||||
template:
|
||||
dest: "{{ moodle_base }}"
|
||||
src: moodle_installer
|
||||
|
@ -140,16 +138,16 @@
|
|||
name: "{{ apache_service }}"
|
||||
state: restarted
|
||||
|
||||
- name: See if config.php exists
|
||||
- name: See if {{ moodle_base }}/config.php exists
|
||||
stat:
|
||||
path: "{{ moodle_base }}/config.php"
|
||||
register: config
|
||||
|
||||
- name: Execute Moodle startup script
|
||||
- name: Execute moodle_installer script
|
||||
shell: '{{ moodle_base }}/moodle_installer'
|
||||
when: config.stat.exists is defined and not config.stat.exists
|
||||
|
||||
- name: Give Apache permission to read config file
|
||||
- name: Give Apache permission to read {{ moodle_base }}/config.php
|
||||
#command: chown -R {{ apache_user }} {{ moodle_base }}
|
||||
file:
|
||||
path: "{{ moodle_base }}/config.php"
|
||||
|
|
|
@ -1,29 +1,27 @@
|
|||
- name: Install Munin package (debuntu)
|
||||
- name: Install 5 package for Munin (debuntu)
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- munin
|
||||
- munin-node
|
||||
- munin-plugins-extra
|
||||
- libcgi-fast-perl
|
||||
- libapache2-mod-fcgid
|
||||
state: present
|
||||
tags:
|
||||
- download
|
||||
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:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- munin
|
||||
- munin-node
|
||||
state: present
|
||||
tags:
|
||||
- download
|
||||
when: not is_debuntu
|
||||
|
||||
- name: Copy Munin config file
|
||||
- name: Install /etc/munin/munin.conf and Apache's munin24.conf, from templates
|
||||
template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
|
@ -34,7 +32,7 @@
|
|||
- { src: 'munin.conf.j2', dest: '/etc/munin/munin.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:
|
||||
path: /etc/munin/munin-htpasswd
|
||||
name: Admin
|
||||
|
@ -49,21 +47,20 @@
|
|||
state: started
|
||||
when: munin_enabled
|
||||
|
||||
- name: Enable Apache lookup (debuntu)
|
||||
- name: Create symlink munin24.conf from sites-enabled to sites-available (debuntu)
|
||||
file:
|
||||
src: /etc/apache2/sites-available/munin24.conf
|
||||
dest: /etc/apache2/sites-enabled/munin24.conf
|
||||
path: /etc/apache2/sites-enabled/munin24.conf
|
||||
state: link
|
||||
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:
|
||||
src: /etc/apache2/sites-available/munin24.conf
|
||||
dest: /etc/apache2/sites-enabled/munin24.conf
|
||||
path: /etc/apache2/sites-enabled/munin24.conf
|
||||
state: absent
|
||||
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:
|
||||
name: munin-node
|
||||
enabled: no
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
- name: Install MySQL (debuntu)
|
||||
- name: Install MySQL (debuntu)
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- mariadb-server
|
||||
- mariadb-client
|
||||
- python-mysqldb
|
||||
|
@ -13,29 +11,28 @@
|
|||
- php{{ php_version }}-imap
|
||||
- php{{ php_version }}-ldap
|
||||
- php{{ php_version }}-odbc
|
||||
# - php{{ php_version }}-xml
|
||||
#- php{{ php_version }}-xml
|
||||
- php{{ php_version }}-xmlrpc
|
||||
state: present
|
||||
when: is_debuntu
|
||||
tags:
|
||||
- download
|
||||
|
||||
- name: php-xml (ubuntu or debian-9)
|
||||
- name: php-xml (ubuntu or debian-9)
|
||||
package:
|
||||
name: "php{{ php_version }}-xml"
|
||||
state: present
|
||||
when: is_ubuntu or is_debian_9
|
||||
|
||||
- name: php-xml (debian-8)
|
||||
- name: php-xml (debian-8)
|
||||
package:
|
||||
name: "php-xml-parser"
|
||||
state: present
|
||||
when: is_debian_8
|
||||
|
||||
- name: Install MySQL (OS's other than debuntu)
|
||||
- name: Install MySQL (OS's other than debuntu)
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- MySQL-python
|
||||
- mysql
|
||||
- php
|
||||
|
@ -47,27 +44,28 @@
|
|||
- php-odbc
|
||||
- php-xml
|
||||
- php-xmlrpc
|
||||
state: present
|
||||
when: not is_debuntu
|
||||
tags:
|
||||
- download
|
||||
|
||||
- include_tasks: centos.yml
|
||||
- include_tasks: centos.yml
|
||||
when: ansible_distribution == "CentOS"
|
||||
tags:
|
||||
- download
|
||||
|
||||
- include_tasks: fedora.yml
|
||||
- include_tasks: fedora.yml
|
||||
when: ansible_distribution == "Fedora"
|
||||
tags:
|
||||
- download
|
||||
|
||||
# Name of mysql service varies by OS so softcoded in 1-prep
|
||||
- name: Start the MySQL service
|
||||
- name: Start the MySQL service
|
||||
service:
|
||||
name: "{{ mysql_service }}"
|
||||
state: started
|
||||
|
||||
- name: Enable the MySQL service
|
||||
- name: Enable the MySQL service
|
||||
service:
|
||||
name: "{{ mysql_service }}"
|
||||
enabled: yes
|
||||
|
@ -76,7 +74,7 @@
|
|||
# 'localhost' needs to be the last item for idempotency, see
|
||||
# http://ansible.cc/docs/modules.html#mysql-user
|
||||
# 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:
|
||||
name: root
|
||||
host: "{{ item }}"
|
||||
|
@ -86,7 +84,7 @@
|
|||
- localhost
|
||||
when: mysql_enabled
|
||||
|
||||
- name: Copy .my.cnf file with root password credentials
|
||||
- name: Install .my.cnf file from template, with root password credentials
|
||||
template:
|
||||
src: my.cnf.j2
|
||||
dest: /root/.my.cnf
|
||||
|
@ -94,46 +92,46 @@
|
|||
mode: 0600
|
||||
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:
|
||||
name: root
|
||||
host: "{{ item }}"
|
||||
password: "{{ mysql_root_password }}"
|
||||
priv: "*.*:ALL,GRANT"
|
||||
with_items:
|
||||
# - "{{ iiab_hostname }}.{{ iiab_domain }}"
|
||||
#- "{{ iiab_hostname }}.{{ iiab_domain }}"
|
||||
- 127.0.0.1
|
||||
- ::1
|
||||
when: mysql_enabled
|
||||
|
||||
- name: Delete anonymous MySQL server user for {{ ansible_hostname }}
|
||||
- name: Delete anonymous MySQL server user for {{ ansible_hostname }}
|
||||
mysql_user:
|
||||
user: ""
|
||||
host: "{{ ansible_hostname }}"
|
||||
state: absent
|
||||
when: mysql_enabled
|
||||
|
||||
- name: Delete anonymous MySQL server user for localhost
|
||||
- name: Delete anonymous MySQL server user for localhost
|
||||
mysql_user:
|
||||
user: ""
|
||||
state: absent
|
||||
when: mysql_enabled
|
||||
|
||||
- name: Remove the MySQL test database
|
||||
- name: Remove the MySQL test database
|
||||
mysql_db:
|
||||
db: test
|
||||
state: absent
|
||||
when: mysql_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:
|
||||
name: "{{ mysql_service }}"
|
||||
enabled: no
|
||||
state: stopped
|
||||
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:
|
||||
dest: "{{ iiab_ini_file }}"
|
||||
section: mysql
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
- name: Install DansGuardian packages
|
||||
- name: Install dansguardian package
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
name: dansguardian
|
||||
state: present
|
||||
with_items:
|
||||
- dansguardian
|
||||
tags:
|
||||
- download
|
||||
|
||||
|
|
|
@ -1,21 +1,19 @@
|
|||
- name: Install named packages (if debuntu)
|
||||
- name: Install named packages {bind9, bind9utils} (if debuntu)
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- bind9
|
||||
- bind9utils
|
||||
state: present
|
||||
when: is_debuntu
|
||||
tags:
|
||||
- download
|
||||
|
||||
- name: Install named packages (if not debuntu)
|
||||
- name: Install named packages {bind, bind-utils} (if not debuntu)
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- bind
|
||||
- bind-utils
|
||||
state: present
|
||||
when: not is_debuntu
|
||||
tags:
|
||||
- download
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
- name: Install Squid packages
|
||||
- name: Install Squid packages {{ proxy }} and cadaver
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- "{{ proxy }}"
|
||||
- cadaver
|
||||
state: present
|
||||
tags:
|
||||
- download
|
||||
|
||||
|
|
|
@ -26,40 +26,39 @@
|
|||
tags:
|
||||
- download
|
||||
|
||||
- name: Ubuntu and Debian treat names differently (Debian)
|
||||
# Ubuntu and Debian treat names differently
|
||||
- name: Install 3 php packages (debian)
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- "libapache2-mod-php{{ php_version }}"
|
||||
- "php{{ php_version }}-mbstring"
|
||||
- "php{{ php_version }}-zip"
|
||||
state: present
|
||||
when: is_debian
|
||||
|
||||
- name: Ubuntu and Debian treat names differently (Ubuntu)
|
||||
# Ubuntu and Debian treat names differently
|
||||
- name: Install 4 php packages (ubuntu)
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- libapache2-mod-php
|
||||
- php-imagick
|
||||
- php-zip
|
||||
- php-mbstring
|
||||
state: present
|
||||
when: is_ubuntu
|
||||
|
||||
- name: Install list of packages (debuntu)
|
||||
- name: Install 5 more php packages (debuntu)
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- "php{{ php_version }}-gd"
|
||||
- "php{{ php_version }}-json"
|
||||
- "php{{ php_version }}-mysql"
|
||||
- "php{{ php_version }}-curl"
|
||||
- "php{{ php_version }}-intl"
|
||||
state: present
|
||||
when: is_debuntu
|
||||
|
||||
- name: In php7.2, php dropped mcrypt
|
||||
- name: In php7.2, php dropped mcrypt (debuntu but not ubuntu-18)
|
||||
package:
|
||||
name: "php{{ php_version }}-mcrypt"
|
||||
state: present
|
||||
|
@ -68,11 +67,9 @@
|
|||
# we need to install the rpm in order to get the dependencies
|
||||
# but we only need to do this the first time
|
||||
|
||||
- name: Install list of packages (redhat)
|
||||
- name: Install 7 php packages (redhat)
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- php
|
||||
- php-gd
|
||||
- php-json
|
||||
|
@ -80,8 +77,9 @@
|
|||
- php-curl
|
||||
- php-intl
|
||||
- php-mcrypt
|
||||
# centos does not have a package for php-imagick
|
||||
# - php-imagick
|
||||
# CentOS does not have a package for php-imagick
|
||||
#- php-imagick
|
||||
state: present
|
||||
when: is_redhat
|
||||
|
||||
- name: Copy it to permanent location /opt (OS's other than Fedora 18)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
nextcloud_required_ip: "{{ ansible_default_ipv4.network }}/{{ ansible_default_ipv4.netmask }}"
|
||||
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:
|
||||
src: nextcloud.conf.j2
|
||||
dest: "/etc/{{ apache_config_dir }}/nextcloud.conf"
|
||||
|
@ -13,20 +13,20 @@
|
|||
mode: 0644
|
||||
when: nextcloud_enabled
|
||||
|
||||
- name: Enable Nextcloud (debuntu)
|
||||
- name: Create symlink from sites-available to sites-enabled for http://box/nextcloud (debuntu)
|
||||
file:
|
||||
path: /etc/apache2/sites-enabled/nextcloud.conf
|
||||
src: /etc/apache2/sites-available/nextcloud.conf
|
||||
path: /etc/apache2/sites-enabled/nextcloud.conf
|
||||
state: link
|
||||
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:
|
||||
path: "/etc/{{ apache_config_dir }}/nextcloud.conf"
|
||||
state: absent
|
||||
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:
|
||||
name: "{{ apache_service }}"
|
||||
state: restarted
|
||||
|
@ -34,9 +34,11 @@
|
|||
# the install wizard does not succeed if already installed
|
||||
- name: Determine if Nextcloud is installed
|
||||
shell: >
|
||||
sudo -u {{ apache_user }} php
|
||||
'{{ nextcloud_prefix }}/nextcloud/occ' status |
|
||||
#sudo -u {{ apache_user }}
|
||||
php '{{ nextcloud_prefix }}/nextcloud/occ' status |
|
||||
gawk '/installed:/ { print $3 }'
|
||||
become: yes
|
||||
become_user: "{{ apache_user }}"
|
||||
register: returned
|
||||
|
||||
- name: Run Nextcloud initial install wizard
|
||||
|
@ -59,9 +61,11 @@
|
|||
|
||||
- name: Determine if Nextcloud user exists already
|
||||
shell: >
|
||||
sudo -u {{ apache_user }} php
|
||||
'{{ nextcloud_prefix }}/nextcloud/occ' user:list |
|
||||
#sudo -u {{ apache_user }}
|
||||
php '{{ nextcloud_prefix }}/nextcloud/occ' user:list |
|
||||
grep {{ nextcloud_user }} | wc | cut -d' ' -f1
|
||||
become: yes
|
||||
become_user: "{{ apache_user }}"
|
||||
register: returned_count
|
||||
|
||||
# nextcloud wants to make users rather than just mysql users and not done
|
||||
|
@ -74,8 +78,8 @@
|
|||
--group="users" {{ nextcloud_user }}'
|
||||
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:
|
||||
regexp: "overwrite.cli.url"
|
||||
state: absent
|
||||
dest: "{{ nextcloud_prefix }}/nextcloud/config/config.php"
|
||||
path: "{{ nextcloud_prefix }}/nextcloud/config/config.php"
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
- name: Install OpenVPN and Nmap packages
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- openvpn
|
||||
- nmap
|
||||
state: present
|
||||
tags:
|
||||
- download
|
||||
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
- name: Install PostgreSQL packages
|
||||
- name: Install postgresql package
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
name: postgresql
|
||||
state: present
|
||||
with_items:
|
||||
- postgresql
|
||||
tags:
|
||||
- download
|
||||
|
||||
- name: Install postgresql-client (debuntu)
|
||||
package:
|
||||
name: postgresql-client
|
||||
state: present
|
||||
when: is_debuntu
|
||||
tags:
|
||||
- download
|
||||
|
@ -17,6 +16,7 @@
|
|||
- name: Install postgresql-server (OS's other than debuntu)
|
||||
package:
|
||||
name: postgresql-server
|
||||
state: present
|
||||
when: not is_debuntu
|
||||
tags:
|
||||
- download
|
||||
|
|
|
@ -17,15 +17,14 @@
|
|||
state: directory
|
||||
|
||||
# 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:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- samba
|
||||
- samba-client
|
||||
- samba-common
|
||||
- cifs-utils
|
||||
state: present
|
||||
tags:
|
||||
- samba
|
||||
- download
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
- name: Wipe /library/www/html/sugarizer* if installing sugarizer-1.0
|
||||
shell: "rm -rf {{ doc_root }}/sugarizer*"
|
||||
args:
|
||||
warn: no
|
||||
when: sugarizer_version == "sugarizer-1.0"
|
||||
|
||||
# 1. DOWNLOAD+LINK /opt/iiab/sugarizer
|
||||
|
@ -86,13 +88,12 @@
|
|||
# where it upgrades /usr/bin/npm in place:
|
||||
# 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:
|
||||
name: "{{ item }}"
|
||||
state: latest
|
||||
with_items:
|
||||
name:
|
||||
- nodejs
|
||||
- npm
|
||||
state: latest
|
||||
when: internet_available and (is_ubuntu_18 or not is_debuntu)
|
||||
|
||||
# 4. RUN "npm install" TO POPULATE ~35MB /opt/iiab/sugarizer-server/node_modules
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
- name: Install packages transmission-daemon and transmission-cli
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
name:
|
||||
- transmission-daemon
|
||||
- transmission-cli
|
||||
state: present
|
||||
|
||||
- name: Create /library/transmission download directory
|
||||
file:
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
---
|
||||
- name: Install required packages
|
||||
- name: Install vnstat package
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
name: vnstat
|
||||
state: present
|
||||
with_items:
|
||||
- vnstat
|
||||
tags:
|
||||
- download
|
||||
|
||||
- name: Put the config file in place
|
||||
- name: Install /etc/vnstat.conf from template
|
||||
template:
|
||||
src: vnstat.conf.j2
|
||||
dest: /etc/vnstat.conf
|
||||
|
@ -23,7 +20,7 @@
|
|||
shell: /usr/bin/vnstat -i {{ iiab_lan_iface }}
|
||||
when: iiab_lan_iface is defined
|
||||
|
||||
- name: Start vnStat daemon via systemd
|
||||
- name: Enable & Start vnStat's systemd service
|
||||
service:
|
||||
name: vnstat
|
||||
enabled: yes
|
||||
|
|
Loading…
Reference in a new issue