1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00

Merge pull request #176 from iiab/master

sync from iiab/iiab
This commit is contained in:
A Holt 2018-10-30 20:08:33 -04:00 committed by GitHub
commit 2892a43c4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 143 additions and 105 deletions

View file

@ -23,6 +23,9 @@
when: squid_install when: squid_install
tags: base, squid, network, domain tags: base, squid, network, domain
# NETWORK moved to the very end, after Stage 9 (9-LOCAL-ADDONS)
# It can also be run manually using: cd /opt/iiab/iiab; ./iiab-network
#
#- name: NETWORK #- name: NETWORK
# include_role: # include_role:
# name: network # name: network
@ -72,7 +75,7 @@
src: roles/1-prep/templates/iiab_env.py.j2 src: roles/1-prep/templates/iiab_env.py.j2
dest: /etc/iiab/iiab_env.py dest: /etc/iiab/iiab_env.py
- name: Run /usr/bin/iiab-refresh-wiki-docs (scraper script) to create http://box/info offline documentation (script was installed at the beginning of Stage 3 = roles/3-base-server/tasks/main.yml, which runs the HTTPD playbook = roles/httpd/tasks/main.yml) - name: Run /usr/bin/iiab-refresh-wiki-docs (scraper script) to create http://box/info offline documentation. (This script was installed at the beginning of Stage 3 = roles/3-base-server/tasks/main.yml, which ran Apache playbook = roles/httpd/tasks/main.yml)
command: /usr/bin/iiab-refresh-wiki-docs command: /usr/bin/iiab-refresh-wiki-docs
when: not nodocs when: not nodocs

View file

@ -1,37 +1,42 @@
# Assume we only get here if elgg_install: True # Assume we only get here if elgg_install: True
# Assume mysql is running # Assume MySQL is running
- name: Download current version from our site - name: Download {{ iiab_download_url }}/elgg-{{ elgg_version }}.zip to {{ downloads_dir }}
shell: wget {{ iiab_download_url }}/elgg-{{ elgg_version }}.zip -c -P {{ downloads_dir }} #shell: wget {{ iiab_download_url }}/elgg-{{ elgg_version }}.zip -c -P {{ downloads_dir }}
args: #args:
creates: "{{ downloads_dir }}/elgg-{{ elgg_version }}.zip" # creates: "{{ downloads_dir }}/elgg-{{ elgg_version }}.zip"
get_url:
url: "{{ iiab_download_url }}/elgg-{{ elgg_version }}.zip"
dest: "{{ downloads_dir }}"
timeout: "{{ download_timeout }}"
when: internet_available when: internet_available
- name: Determine if software is already expanded - name: Check for existence of /opt/elgg-{{ elgg_version }}/index.php
stat: stat:
path: "/opt/elgg-{{ elgg_version }}/index.php" path: "/opt/elgg-{{ elgg_version }}/index.php"
register: elgg register: elgg
# use unzip and shell until unarchive works again - name: Unpack (unarchive) .zip to /opt, if above index.php doesn't exist
# unarchive: dest=/opt/ #shell: "/usr/bin/unzip -o {{ downloads_dir }}/elgg-{{ elgg_version }}.zip -d /opt"
# src={{ downloads_dir }}/elgg-{{ elgg_version }}.zip unarchive:
#remote_src: yes
- name: Expand it to our location unless already done #src: "{{ iiab_download_url }}/elgg-{{ elgg_version }}.zip"
shell: "/usr/bin/unzip -o {{ downloads_dir }}/elgg-{{ elgg_version }}.zip -d /opt" src: "{{ downloads_dir }}/elgg-{{ elgg_version }}.zip"
dest: /opt
owner: "{{ apache_user }}"
group: "{{ apache_user }}"
when: elgg.stat.exists is defined and not elgg.stat.exists when: elgg.stat.exists is defined and not elgg.stat.exists
- name: Create a link to the versioned elgg-* folder - name: Create softlink from /opt/elgg to /opt/elgg-{{ elgg_version }}
file: file:
src: "./elgg-{{ elgg_version }}" src: "./elgg-{{ elgg_version }}"
dest: /opt/elgg path: /opt/elgg
owner: "{{ apache_user }}" owner: "{{ apache_user }}"
group: "{{ apache_user }}" group: "{{ apache_user }}"
state: link state: link
force: true force: true
# Use template to fix up settings in elgg-config/settings.php with our variables substituted. - name: 'Install /opt/elgg/elgg-config/settings.php from template (WARNING: overwrites manual settings!)'
# Note this will overwrite any manual settings.
- name: Substitute our parameters in /opt/elgg/elgg-config/settings.php
template: template:
src: "settings.php.j2" src: "settings.php.j2"
dest: "/opt/{{ elgg_xx }}/elgg-config/settings.php" dest: "/opt/{{ elgg_xx }}/elgg-config/settings.php"
@ -39,7 +44,7 @@
group: "{{ apache_user }}" group: "{{ apache_user }}"
# The name of this file changed from 1.9 to 1.10. # The name of this file changed from 1.9 to 1.10.
- name: Copy default .htaccess to the root directory of Elgg tree - name: Copy default .htaccess into /opt/{{ elgg_xx }}, root of Elgg tree
copy: copy:
src: "/opt/{{ elgg_xx }}/vendor/elgg/elgg/install/config/htaccess.dist" src: "/opt/{{ elgg_xx }}/vendor/elgg/elgg/install/config/htaccess.dist"
dest: "/opt/{{ elgg_xx }}/.htaccess" dest: "/opt/{{ elgg_xx }}/.htaccess"
@ -48,28 +53,22 @@
group: "{{ apache_user }}" group: "{{ apache_user }}"
#regexp='^#RewriteBase' #regexp='^#RewriteBase'
- name: Modify .htaccess to have RewriteBase as our directory - name: Change .htaccess to include RewriteBase for http://box/elgg
lineinfile: lineinfile:
backup: no backup: no
dest: "/opt/{{ elgg_xx }}/.htaccess" path: "/opt/{{ elgg_xx }}/.htaccess"
state: present state: present
insertafter: '^#RewriteBase' insertafter: '^#RewriteBase'
line: "RewriteBase {{ elgg_url }}/" line: "RewriteBase {{ elgg_url }}/"
- name: Change permissions on engine directory so Apache can write - name: Set /opt/elgg/engine directory permissions to 0755 so Apache can write there
file: file:
path: /opt/elgg/engine/ path: /opt/elgg/engine/
owner: "{{ apache_user }}" owner: "{{ apache_user }}"
mode: 0755 mode: 0755
state: directory state: directory
- name: Create an upload directory that Apache can write in or Elgg - name: Change /opt/elgg-{{ elgg_version }} ownership to {{ apache_user }}:{{ apache_user }} (likely not nec, as unarchive & all do this above)
file:
path: "{{ elgg_upload_path }}"
state: directory
owner: "{{ apache_user }}"
- name: Change ownership
file: file:
path: "/opt/elgg-{{ elgg_version }}" path: "/opt/elgg-{{ elgg_version }}"
owner: "{{ apache_user }}" owner: "{{ apache_user }}"
@ -77,12 +76,18 @@
recurse: yes recurse: yes
state: directory state: directory
- name: Create a MySQL database for Elgg - can be run more than once - name: Create upload directory {{ elgg_upload_path }} that Apache (and Elgg) can write to
file:
path: "{{ elgg_upload_path }}"
state: directory
owner: "{{ apache_user }}"
- name: Create Elgg's MySQL database {{ dbname }}, to be populated below - can be run more than once
mysql_db: mysql_db:
name: "{{ dbname }}" name: "{{ dbname }}"
register: create_elgg_database register: create_elgg_database
- name: Create a user to access the Elgg database - can be run more than once - name: Create user/password to access Elgg database - can be run more than once
mysql_user: mysql_user:
name: "{{ dbuser }}" name: "{{ dbuser }}"
host: "{{ item }}" host: "{{ item }}"
@ -93,7 +98,7 @@
- ::1 - ::1
- localhost - localhost
- name: Create file to load database - name: Create /tmp/elggdb.sql from template, to load database
template: template:
src: "elggdb.sql.j2" src: "elggdb.sql.j2"
dest: "/tmp/elggdb.sql" dest: "/tmp/elggdb.sql"
@ -102,42 +107,47 @@
# tar up a mysqldump of freshly installed database and use it in the install to avoid the startup # tar up a mysqldump of freshly installed database and use it in the install to avoid the startup
# form, which worries me a lot. (/var/lib/mysql/elggdb) # form, which worries me a lot. (/var/lib/mysql/elggdb)
- name: Load Elgg database dump - name: Populate Elgg's MySQL database {{ dbname }}, from /tmp/elggdb.sql
mysql_db: mysql_db:
name: "{{ dbname }}" name: "{{ dbname }}"
state: import state: import
target: /tmp/elggdb.sql target: /tmp/elggdb.sql
when: create_elgg_database.changed when: create_elgg_database.changed
- name: Remove database dump after load - name: Remove database dump /tmp/elggdb.sql
file: file:
name: /tmp/elggdb.sql name: /tmp/elggdb.sql
state: absent state: absent
- name: Install config file for Elgg in Apache - name: Install Apache's elgg.conf from template, for http://box/elgg
template: template:
src: elgg.conf src: elgg.conf
dest: "/etc/{{ apache_config_dir }}/elgg.conf" dest: "/etc/{{ apache_config_dir }}/elgg.conf"
- name: Enable Elgg for debuntu (will already be enabled above for redhat) - name: Create symlink elgg.conf from sites-enabled to sites-available (debuntu, not nec for redhat)
file: file:
src: /etc/apache2/sites-available/elgg.conf src: /etc/apache2/sites-available/elgg.conf
dest: /etc/apache2/sites-enabled/elgg.conf path: /etc/apache2/sites-enabled/elgg.conf
state: link state: link
when: elgg_enabled and is_debuntu when: elgg_enabled and is_debuntu
- name: Disable Elgg - remove config file for Elgg in Apache (debuntu) - name: Remove symlink elgg.conf from sites-enabled (debuntu)
file: file:
path: /etc/apache2/sites-enabled/elgg.conf path: /etc/apache2/sites-enabled/elgg.conf
state: absent state: absent
when: not elgg_enabled and is_debuntu when: not elgg_enabled and is_debuntu
- name: Disable Elgg - remove config file for Elgg in Apache (redhat) - name: Remove Apache's elgg.conf (redhat)
file: file:
dest: "/etc/{{ apache_config_dir }}/elgg.conf" dest: "/etc/{{ apache_config_dir }}/elgg.conf"
state: absent state: absent
when: not elgg_enabled and is_redhat when: not elgg_enabled and is_redhat
- name: Restart Apache, to enable/disable http://box/elgg
service:
name: "{{ apache_service }}"
state: restarted
- name: Add 'elgg' to list of services at {{ iiab_ini_file }} - name: Add 'elgg' to list of services at {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" dest: "{{ iiab_ini_file }}"
@ -153,8 +163,3 @@
value: /opt/elgg value: /opt/elgg
- option: enabled - option: enabled
value: "{{ elgg_enabled }}" value: "{{ elgg_enabled }}"
- name: Restart Apache, so it picks up the new aliases
service:
name: "{{ apache_service }}"
state: restarted

View file

@ -215,7 +215,7 @@
tags: tags:
- base - base
- name: Install /usr/bin/iiab-refresh-wiki-docs (scraper script) to create http://box/info offline documentation (will be run 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. (This script will run 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

View file

@ -7,7 +7,7 @@ nextcloud_force_install: False
nextcloud_url: /nextcloud nextcloud_url: /nextcloud
nextcloud_prefix: /opt nextcloud_prefix: /opt
nextcloud_data_dir: "{{ content_base }}/nextcloud/data" nextcloud_data_dir: "{{ content_base }}/nextcloud/data"
nextcloud_dl_url: https://download.nextcloud.com/server/releases/ nextcloud_dl_url: https://download.nextcloud.com/server/releases
nextcloud_orig_src_file: latest-14.tar.bz2 nextcloud_orig_src_file: latest-14.tar.bz2
nextcloud_src_file: nextcloud_{{ nextcloud_orig_src_file }} nextcloud_src_file: nextcloud_{{ nextcloud_orig_src_file }}

View file

@ -1,28 +1,29 @@
- name: See if Nextcloud version page exists - name: Check for existence of /opt/nextcloud/version.php
stat: stat:
path: "{{ nextcloud_prefix }}/nextcloud/version.php" path: "{{ nextcloud_prefix }}/nextcloud/version.php"
# path: "{{ nextcloud_prefix }}/nextcloud/index.php"
register: nextcloud_page register: nextcloud_page
- name: FORCE INSTALL OR REINSTALL OR UPGRADE IF /opt/nextcloud/version.php DOESN'T EXIST - name: FORCE INSTALL OR REINSTALL OR UPGRADE IF {{ nextcloud_prefix }}/nextcloud/version.php DOESN'T EXIST
set_fact: set_fact:
nextcloud_force_install: True nextcloud_force_install: True
when: not nextcloud_page.stat.exists when: not nextcloud_page.stat.exists
# - debug:
# var: nextcloud_force_install
# - debug: # - debug:
# msg: "nextcloud_force_install: {{ nextcloud_force_install }}" # msg: "nextcloud_force_install: {{ nextcloud_force_install }}"
- name: Download {{ nextcloud_dl_url }}/{{ nextcloud_orig_src_file }} to {{ downloads_dir }}/{{ nextcloud_src_file }}
- name: Download latest Nextcloud software to /opt/iiab/download/{{ nextcloud_src_file }}
get_url: get_url:
url: "{{ nextcloud_dl_url }}/{{ nextcloud_orig_src_file }}" url: "{{ nextcloud_dl_url }}/{{ nextcloud_orig_src_file }}"
dest: "{{ downloads_dir }}/{{ nextcloud_src_file }}" dest: "{{ downloads_dir }}/{{ nextcloud_src_file }}"
force: yes
#validate_certs: False # TEMPORARY ON/AFTER 2018-07-22 AS download.nextcloud.com CERT EXPIRED: https://github.com/iiab/iiab/issues/954
timeout: "{{ download_timeout }}" timeout: "{{ download_timeout }}"
#force: yes
#validate_certs: False # TEMPORARY ON/AFTER 2018-07-22 AS download.nextcloud.com CERT EXPIRED: https://github.com/iiab/iiab/issues/954
when: internet_available and nextcloud_force_install when: internet_available and nextcloud_force_install
async: 1800 #async: 1800
poll: 10 #poll: 10
tags: tags:
- download - download
@ -89,13 +90,13 @@
#creates: "{{ nextcloud_prefix }}/nextcloud/version.php" #creates: "{{ nextcloud_prefix }}/nextcloud/version.php"
when: nextcloud_force_install when: nextcloud_force_install
- name: In CentOS, the following config dir is symlink to /etc/nextcloud - name: Create dir /etc/nextcloud (centos) for a subsequent config dir that's symlinked to /etc/nextcloud ?
file: file:
path: /etc/nextcloud path: /etc/nextcloud
state: directory state: directory
when: is_centos when: is_centos
- name: Add autoconfig file (CentOS) - name: Install {{ nextcloud_prefix }}/nextcloud/config/autoconfig.php from template (centos)
template: template:
src: autoconfig.php.j2 src: autoconfig.php.j2
dest: "{{ nextcloud_prefix }}/nextcloud/config/autoconfig.php" dest: "{{ nextcloud_prefix }}/nextcloud/config/autoconfig.php"
@ -104,7 +105,7 @@
mode: 0640 mode: 0640
when: is_centos when: is_centos
- name: Make Apache owner - name: chown -R {{ apache_user }}:{{ apache_user }} {{ nextcloud_prefix }}/nextcloud
file: file:
path: "{{ nextcloud_prefix }}/nextcloud" path: "{{ nextcloud_prefix }}/nextcloud"
owner: "{{ apache_user }}" owner: "{{ apache_user }}"
@ -112,22 +113,20 @@
recurse: yes recurse: yes
state: directory state: directory
- name: Create data directory library - name: Create data directory {{ nextcloud_data_dir }} # /opt/nextcloud/data
file: file:
path: "{{ item }}" path: "{{ nextcloud_data_dir }}"
owner: "{{ apache_user }}" owner: "{{ apache_user }}"
group: "{{ apache_user }}" group: "{{ apache_user }}"
mode: 0750 mode: 0750
state: directory state: directory
with_items:
- "{{ nextcloud_data_dir }}"
- name: Create MySQL database {{ nextcloud_dbname }} for Nextcloud - name: 'Create MySQL database with name: {{ nextcloud_dbname }}'
mysql_db: mysql_db:
name: "{{ nextcloud_dbname }}" name: "{{ nextcloud_dbname }}"
when: mysql_enabled and nextcloud_enabled when: mysql_enabled and nextcloud_enabled
- name: Create username/password for Nextcloud database - name: Add username/password to the MySQL database (associated with trusted IP's like localhost)
mysql_user: mysql_user:
name: "{{ nextcloud_dbuser }}" name: "{{ nextcloud_dbuser }}"
host: "{{ item }}" host: "{{ item }}"
@ -140,17 +139,15 @@
- localhost - localhost
when: mysql_enabled and nextcloud_enabled when: mysql_enabled and nextcloud_enabled
# Appears unnec as nextcloud_enabled.yml (just below) does the same
#- name: Restart Apache
# service:
# name: "{{ apache_service }}"
# state: restarted
## when: nextcloud_enabled # taken care of by nextcloud_enabled.yml below
# when: not nextcloud_enabled
- name: Restart Apache, to enable/disable http://box/nextcloud # Enables or disable Nextcloud!
service:
name: "{{ apache_service }}"
state: restarted
# when: nextcloud_enabled # taken care of by nextcloud_enabled.yml below
when: not nextcloud_enabled
# Enable nextcloud by copying template to httpd config
# following enables and disables
- include_tasks: nextcloud_enabled.yml - include_tasks: nextcloud_enabled.yml
- name: Add 'nextcloud' to list of services at {{ iiab_ini_file }} - name: Add 'nextcloud' to list of services at {{ iiab_ini_file }}
@ -166,7 +163,11 @@
value: '"NextCloud is a local server-based facility for sharing files, photos, contacts, calendars, etc."' value: '"NextCloud is a local server-based facility for sharing files, photos, contacts, calendars, etc."'
- option: path - option: path
value: "{{ nextcloud_prefix }}/nextcloud" value: "{{ nextcloud_prefix }}/nextcloud"
- option: source - option: nextcloud_force_install
value: "{{ nextcloud_force_install }}"
- option: nextcloud_orig_src_file
value: "{{ nextcloud_orig_src_file }}"
- option: nextcloud_src_file
value: "{{ nextcloud_src_file }}" value: "{{ nextcloud_src_file }}"
- option: enabled - option: nextcloud_enabled
value: "{{ nextcloud_enabled }}" value: "{{ nextcloud_enabled }}"

View file

@ -13,20 +13,26 @@
mode: 0644 mode: 0644
when: nextcloud_enabled when: nextcloud_enabled
- name: Create symlink from sites-available to sites-enabled for http://box/nextcloud (debuntu) - name: Create symlink nextcloud.conf from sites-enabled to sites-available for http://box/nextcloud (debuntu)
file: file:
src: /etc/apache2/sites-available/nextcloud.conf src: "/etc/{{ apache_config_dir }}/nextcloud.conf"
path: /etc/apache2/sites-enabled/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 nextcloud.conf if not nextcloud_enabled (redhat) - name: Remove symlink nextcloud.conf from /etc/apache2/sites-enabled if not nextcloud_enabled (debuntu)
file:
path: /etc/apache2/sites-enabled/nextcloud.conf
state: absent
when: not nextcloud_enabled and is_debuntu
- name: Remove sites-available/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, enabling http://box/nextcloud - name: Restart Apache, enabling/disabling http://box/nextcloud
service: service:
name: "{{ apache_service }}" name: "{{ apache_service }}"
state: restarted state: restarted
@ -34,8 +40,7 @@
# 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 {{ nextcloud_prefix }}/nextcloud/occ status |
php '{{ nextcloud_prefix }}/nextcloud/occ' status |
gawk '/installed:/ { print $3 }' gawk '/installed:/ { print $3 }'
become: yes become: yes
become_user: "{{ apache_user }}" become_user: "{{ apache_user }}"
@ -44,39 +49,55 @@
- name: Run Nextcloud initial install wizard - name: Run Nextcloud initial install wizard
shell: > shell: >
cd {{ nextcloud_prefix }}/nextcloud; cd {{ nextcloud_prefix }}/nextcloud;
sudo -u {{ apache_user }} php occ maintenance:install php occ maintenance:install
--database "mysql" --database "mysql"
--database-name "{{ nextcloud_dbname }}" --database-name "{{ nextcloud_dbname }}"
--database-user "{{ nextcloud_dbuser }}" --database-user "{{ nextcloud_dbuser }}"
--database-pass "{{ nextcloud_dbpassword }}" --database-pass "{{ nextcloud_dbpassword }}"
--admin-user "{{ nextcloud_admin_user }}" --admin-user "{{ nextcloud_admin_user }}"
--admin-pass "{{ nextcloud_admin_password }}" --admin-pass "{{ nextcloud_admin_password }}"
become: yes
become_user: "{{ apache_user }}"
when: nextcloud_enabled and returned.stdout == "false" when: nextcloud_enabled and returned.stdout == "false"
- name: Allow access from all hosts and ips - name: Allow access from all hosts and ips
command: php '{{ nextcloud_prefix }}/nextcloud/occ' config:system:set trusted_domains 1 --value=* command: php {{ nextcloud_prefix }}/nextcloud/occ config:system:set trusted_domains 1 --value=*
become: true become: yes
become_user: "{{ apache_user }}" become_user: "{{ apache_user }}"
when: nextcloud_enabled and returned.stdout == "false" when: nextcloud_enabled and returned.stdout == "false"
- name: Determine if Nextcloud user exists already # Code below was NEVER RUNNING as of 2018-10-29, as "wc | cut -d' ' -f1" ALWAYS
shell: > # returns null (rather than the intended returned_count !) This line could
#sudo -u {{ apache_user }} # be replaced by ALTERNATIVE 1 or ALTERNATIVE 2 below IF it truly needs fixing.
php '{{ nextcloud_prefix }}/nextcloud/occ' user:list | #
grep {{ nextcloud_user }} | wc | cut -d' ' -f1 # Or perhaps default user/password nextcloud/nextcloudmysql (from variables
become: yes # nextcloud_user/nextcloud_user_password) is just not needed in the end...
become_user: "{{ apache_user }}" #
register: returned_count # NOTE: COMMENTS (FOLLOWING '#' SIGN) WITHIN A SHELL COMMAND CAUSE IT TO *FAIL*
#
# nextcloud wants to make users rather than just mysql users and not done #- name: Determine if Nextcloud user exists already
- name: Create the default user # shell: >
shell: > # php {{ nextcloud_prefix }}/nextcloud/occ user:list |
su -s /bin/sh {{ apache_user }} -c # grep {{ nextcloud_user }} | wc | cut -d' ' -f1 # USELESS
'OC_PASS={{ nextcloud_user_password }}; # #grep {{ nextcloud_user }} | wc -l # ALTERNATIVE 1
php {{ nextcloud_prefix }}/nextcloud/occ user:add # #grep {{ nextcloud_user }} | wc | awk '{print $1}' # ALTERNATIVE 2
--password-from-env --display-name={{ nextcloud_user }} # become: yes
--group="users" {{ nextcloud_user }}' # become_user: "{{ apache_user }}"
when: nextcloud_enabled and returned_count == "0" # register: returned_count
#
# debug:
# var: returned_count
#
## nextcloud wants to make users rather than just mysql users and not done
#- name: Create the default user
# shell: >
# OC_PASS={{ nextcloud_user_password }};
# php {{ nextcloud_prefix }}/nextcloud/occ user:add
# --password-from-env --display-name={{ nextcloud_user }}
# --group="users" {{ nextcloud_user }}
# become: yes
# become_user: "{{ apache_user }}"
# when: nextcloud_enabled and returned_count == "0"
- name: Remove overwrite.cli.url line (Rewrite URL) from /opt/nextcloud/config/config.php - name: Remove overwrite.cli.url line (Rewrite URL) from /opt/nextcloud/config/config.php
lineinfile: lineinfile:

View file

@ -48,15 +48,21 @@
when: is_debuntu when: is_debuntu
- name: Initialize the postgres db (debuntu) - name: Initialize the postgres db (debuntu)
command: su - postgres -c "/usr/lib/postgresql/{{ postgresql_version }}/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-iiab" #command: su - postgres -c "/usr/lib/postgresql/{{ postgresql_version }}/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-iiab"
command: /usr/lib/postgresql/{{ postgresql_version }}/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-iiab
args: args:
creates: /library/pgsql-iiab/pg_hba.conf creates: /library/pgsql-iiab/pg_hba.conf
become: yes
become_user: postgres
when: is_debuntu when: is_debuntu
- name: Initialize the postgres db (OS's other than debuntu) - name: Initialize the postgres db (OS's other than debuntu)
command: su - postgres -c "/usr/bin/initdb -E 'UTF-8' --lc-collate={{ postgresql_locale }} --lc-ctype={{ postgresql_locale }} -D /library/pgsql-iiab" #command: su - postgres -c "/usr/bin/initdb -E 'UTF-8' --lc-collate={{ postgresql_locale }} --lc-ctype={{ postgresql_locale }} -D /library/pgsql-iiab"
command: /usr/bin/initdb -E 'UTF-8' --lc-collate={{ postgresql_locale }} --lc-ctype={{ postgresql_locale }} -D /library/pgsql-iiab
args: args:
creates: /library/pgsql-iiab/pg_hba.conf creates: /library/pgsql-iiab/pg_hba.conf
become: yes
become_user: postgres
when: not is_debuntu when: not is_debuntu
- name: Configure PostgreSQL - name: Configure PostgreSQL

View file

@ -59,6 +59,8 @@
- name: Set up Node.js 8.x apt sources (debuntu, but avoid ubuntu-18) - name: Set up Node.js 8.x apt sources (debuntu, but avoid ubuntu-18)
shell: curl -sL https://deb.nodesource.com/setup_8.x | bash - shell: curl -sL https://deb.nodesource.com/setup_8.x | bash -
args:
warn: no
when: internet_available and is_debuntu and not is_ubuntu_18 when: internet_available and is_debuntu and not is_ubuntu_18
- name: Install latest Node.js which includes /usr/bin/npm (debuntu, but avoid ubuntu-18) - name: Install latest Node.js which includes /usr/bin/npm (debuntu, but avoid ubuntu-18)