mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge pull request #356 from jvonau/avoid-dups
sync from jvonau:avoid-dups
This commit is contained in:
commit
f68fdb6cb8
8 changed files with 39 additions and 42 deletions
|
@ -1,4 +1,4 @@
|
||||||
- name: Enable postgresql-iiab service when moodle_enabled
|
- name: Enable 'postgresql-iiab' systemd service, if moodle_enabled
|
||||||
systemd:
|
systemd:
|
||||||
name: postgresql-iiab
|
name: postgresql-iiab
|
||||||
state: started
|
state: started
|
||||||
|
@ -6,7 +6,7 @@
|
||||||
when: moodle_enabled
|
when: moodle_enabled
|
||||||
|
|
||||||
# if the only service using the backend db disable if not running
|
# if the only service using the backend db disable if not running
|
||||||
- name: Disable postgresql-iiab service when not moodle_enabled
|
- name: Disable 'postgresql-iiab' systemd service, if not moodle_enabled and not (pathagar_enabled is defined and pathagar_enabled)
|
||||||
systemd:
|
systemd:
|
||||||
name: postgresql-iiab
|
name: postgresql-iiab
|
||||||
state: stopped
|
state: stopped
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
command: a2dissite 022-moodle.conf
|
command: a2dissite 022-moodle.conf
|
||||||
when: apache_install and not moodle_enabled
|
when: apache_install and not moodle_enabled
|
||||||
|
|
||||||
- name: Restart Apache systemd service ({{ apache_service }})
|
- name: Restart '{{ apache_service }}' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ apache_service }}" # apache2 or httpd, as set in /opt/iiab/iiab/vars/<OS>.yml
|
name: "{{ apache_service }}" # apache2 or httpd, as set in /opt/iiab/iiab/vars/<OS>.yml
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
- name: Turn on enabled vars for PostgreSQL
|
- name: "Set PostgreSQL vars 'postgresql_install: True' and 'postgresql_enabled: True'"
|
||||||
set_fact:
|
set_fact:
|
||||||
postgresql_install: True
|
postgresql_install: True
|
||||||
postgresql_enabled: True
|
postgresql_enabled: True
|
||||||
|
|
||||||
- name: POSTGRESQL
|
- name: POSTGRESQL - run the 'postgresql' role
|
||||||
include_role:
|
include_role:
|
||||||
name: postgresql
|
name: postgresql
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
- php{{ php_version }}-xmlrpc
|
- php{{ php_version }}-xmlrpc
|
||||||
state: present
|
state: present
|
||||||
when: is_debuntu | bool
|
when: is_debuntu | bool
|
||||||
#tags: download
|
|
||||||
|
|
||||||
- name: Install php{{ php_version }}-xml (ubuntu or debian 9+)
|
- name: Install php{{ php_version }}-xml (ubuntu or debian 9+)
|
||||||
package:
|
package:
|
||||||
|
@ -44,15 +43,12 @@
|
||||||
- php-xmlrpc
|
- php-xmlrpc
|
||||||
state: present
|
state: present
|
||||||
when: not is_debuntu
|
when: not is_debuntu
|
||||||
#tags: download
|
|
||||||
|
|
||||||
- include_tasks: centos.yml
|
- include_tasks: centos.yml
|
||||||
when: ansible_distribution == "CentOS"
|
when: ansible_distribution == "CentOS"
|
||||||
#tags: download
|
|
||||||
|
|
||||||
- include_tasks: fedora.yml
|
- include_tasks: fedora.yml
|
||||||
when: ansible_distribution == "Fedora"
|
when: ansible_distribution == "Fedora"
|
||||||
#tags: 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
|
||||||
|
@ -68,7 +64,7 @@
|
||||||
- name: Copy pkg's /lib/systemd/system/mariadb.service to /etc/systemd/system/ to be customized (CREATES TIMESTAMPED BACKUPS OF /etc/systemd/system/mariadb.service e.g. IF OPERATOR CUSTOMIZED IT, EVEN DESPITE WARNING BELOW!)
|
- name: Copy pkg's /lib/systemd/system/mariadb.service to /etc/systemd/system/ to be customized (CREATES TIMESTAMPED BACKUPS OF /etc/systemd/system/mariadb.service e.g. IF OPERATOR CUSTOMIZED IT, EVEN DESPITE WARNING BELOW!)
|
||||||
copy:
|
copy:
|
||||||
force: yes
|
force: yes
|
||||||
backup: no
|
backup: yes
|
||||||
src: /lib/systemd/system/mariadb.service
|
src: /lib/systemd/system/mariadb.service
|
||||||
dest: /etc/systemd/system/
|
dest: /etc/systemd/system/
|
||||||
when: mariadb_unit_file.stat.exists
|
when: mariadb_unit_file.stat.exists
|
||||||
|
@ -178,6 +174,7 @@
|
||||||
state: stopped
|
state: stopped
|
||||||
when: not mysql_enabled
|
when: not mysql_enabled
|
||||||
|
|
||||||
|
|
||||||
- name: Add 'mysql' variable values to {{ iiab_ini_file }}
|
- name: Add 'mysql' variable values to {{ iiab_ini_file }}
|
||||||
ini_file:
|
ini_file:
|
||||||
path: "{{ iiab_ini_file }}"
|
path: "{{ iiab_ini_file }}"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# 2019-01-16: @jvonau's PR #1403 moved installation of Node.js (8.x for now) &
|
# 2019-01-16: @jvonau's PR #1403 moved installation of Node.js (8.x for now) &
|
||||||
# npm to roles/nodejs/tasks/main.yml
|
# npm to roles/nodejs/tasks/main.yml
|
||||||
|
|
||||||
- name: NODEJS
|
- name: NODEJS - run the 'nodejs' role
|
||||||
include_role:
|
include_role:
|
||||||
name: nodejs
|
name: nodejs
|
||||||
# 2020-01-04 no longer triggered by roles/nodered/meta/main.yml
|
# 2020-01-04 no longer triggered by roles/nodered/meta/main.yml
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
- name: Turn on enabled vars for PostgreSQL
|
- name: "Set PostgreSQL vars 'postgresql_install: True' and 'postgresql_enabled: True'"
|
||||||
set_fact:
|
set_fact:
|
||||||
postgresql_install: True
|
postgresql_install: True
|
||||||
postgresql_enabled: True
|
postgresql_enabled: True
|
||||||
|
|
||||||
- name: POSTGRESQL
|
- name: POSTGRESQL - run the 'postgresql' role
|
||||||
include_role:
|
include_role:
|
||||||
name: postgresql
|
name: postgresql
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
name: pathagar
|
name: pathagar
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Install Pathagar prerequisites (all OSs)
|
- name: "Install Pathagar prerequisites: python-virtualenv, python-pip, python-psycopg2"
|
||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
- python-pip
|
- python-pip
|
||||||
- python-psycopg2
|
- python-psycopg2
|
||||||
|
|
||||||
- name: Install Pathagar prerequisites (debuntu)
|
- name: "Install Pathagar prerequisites: libapache2-mod-wsgi, libxml2-dev, libxslt-dev (debuntu)"
|
||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
- libxslt-dev
|
- libxslt-dev
|
||||||
when: is_debuntu | bool
|
when: is_debuntu | bool
|
||||||
|
|
||||||
- name: Install Pathagar prerequisites (not debuntu)
|
- name: "Install Pathagar prerequisites: mod_wsgi, libxml2-devel, libxslt-devel (not debuntu)"
|
||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
|
@ -41,21 +41,21 @@
|
||||||
- libxslt-devel
|
- libxslt-devel
|
||||||
when: not is_debuntu
|
when: not is_debuntu
|
||||||
|
|
||||||
- name: Create destination folder
|
- name: "Create destination folder: {{ pathagar_src }}"
|
||||||
file:
|
file:
|
||||||
path: "{{ pathagar_src }}"
|
path: "{{ pathagar_src }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: root
|
# owner: root
|
||||||
group: root
|
# group: root
|
||||||
mode: 0755
|
# mode: '0755'
|
||||||
|
|
||||||
- name: Create books destination folder
|
- name: "Create books destination folder: {{ pathagar_media }}"
|
||||||
file:
|
file:
|
||||||
path: "{{ pathagar_media }}"
|
path: "{{ pathagar_media }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ apache_user }}"
|
owner: "{{ apache_user }}"
|
||||||
group: "{{ apache_user }}"
|
group: "{{ apache_user }}"
|
||||||
mode: 0755
|
mode: '0755'
|
||||||
|
|
||||||
- name: Determine if Pathagar has already been downloaded from git
|
- name: Determine if Pathagar has already been downloaded from git
|
||||||
stat:
|
stat:
|
||||||
|
@ -98,8 +98,8 @@
|
||||||
become: yes
|
become: yes
|
||||||
become_user: postgres
|
become_user: postgres
|
||||||
|
|
||||||
- name: Start postgresql-iiab
|
- name: Start 'postgresql-iiab' systemd service
|
||||||
service:
|
systemd:
|
||||||
name: postgresql-iiab
|
name: postgresql-iiab
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
|
@ -117,8 +117,8 @@
|
||||||
group: postgres
|
group: postgres
|
||||||
register: enable_pathagar_md5_access
|
register: enable_pathagar_md5_access
|
||||||
|
|
||||||
- name: Reload postgresql service
|
- name: Reload 'postgresql-iiab' systemd service
|
||||||
service:
|
systemd:
|
||||||
name: postgresql-iiab
|
name: postgresql-iiab
|
||||||
state: reloaded
|
state: reloaded
|
||||||
when: enable_pathagar_md5_access.changed
|
when: enable_pathagar_md5_access.changed
|
||||||
|
@ -137,9 +137,9 @@
|
||||||
template:
|
template:
|
||||||
src: prod_settings.py
|
src: prod_settings.py
|
||||||
dest: "{{ pathagar_src }}/prod_settings.py"
|
dest: "{{ pathagar_src }}/prod_settings.py"
|
||||||
owner: root
|
# owner: root
|
||||||
group: root
|
# group: root
|
||||||
mode: 0644
|
# mode: '0644'
|
||||||
|
|
||||||
- name: Create Pathagar initial db
|
- name: Create Pathagar initial db
|
||||||
django_manage:
|
django_manage:
|
||||||
|
@ -154,7 +154,7 @@
|
||||||
dest: "{{ pathagar_dir }}/auth.User.json"
|
dest: "{{ pathagar_dir }}/auth.User.json"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0600
|
mode: '0600'
|
||||||
|
|
||||||
- name: Load Pathagar admin user
|
- name: Load Pathagar admin user
|
||||||
django_manage:
|
django_manage:
|
||||||
|
@ -175,37 +175,37 @@
|
||||||
template:
|
template:
|
||||||
src: wsgi.py
|
src: wsgi.py
|
||||||
dest: "{{ pathagar_dir }}/wsgi.py"
|
dest: "{{ pathagar_dir }}/wsgi.py"
|
||||||
owner: root
|
# owner: root
|
||||||
group: root
|
# group: root
|
||||||
mode: 0644
|
# mode: '0644'
|
||||||
|
|
||||||
- name: Install httpd conf for Pathagar
|
- name: Install /etc/{{ apache_config_dir }}/pathagar.conf from template
|
||||||
template:
|
template:
|
||||||
src: pathagar.conf
|
src: pathagar.conf
|
||||||
backup: yes
|
backup: yes
|
||||||
dest: "/etc/{{ apache_config_dir }}/pathagar.conf"
|
dest: "/etc/{{ apache_config_dir }}/pathagar.conf"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|
||||||
- name: Enable Pathagar (debuntu)
|
- name: Enable Pathagar via Apache (debuntu)
|
||||||
file:
|
file:
|
||||||
path: /etc/apache2/sites-enabled/pathagar.conf
|
path: /etc/apache2/sites-enabled/pathagar.conf
|
||||||
src: /etc/apache2/sites-available/pathagar.conf
|
src: /etc/apache2/sites-available/pathagar.conf
|
||||||
state: link
|
state: link
|
||||||
when: pathagar_enabled and is_debuntu
|
when: pathagar_enabled and is_debuntu
|
||||||
|
|
||||||
- name: Disable Pathagar (debuntu)
|
- name: Disable Pathagar via Apache (debuntu)
|
||||||
file:
|
file:
|
||||||
path: /etc/apache2/sites-enabled/pathagar.conf
|
path: /etc/apache2/sites-enabled/pathagar.conf
|
||||||
state: absent
|
state: absent
|
||||||
when: not pathagar_enabled and is_debuntu
|
when: not pathagar_enabled and is_debuntu
|
||||||
|
|
||||||
- name: Reload Apache ({{ apache_service }})
|
- name: Reload '{{ apache_service }}' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ apache_service }}"
|
name: "{{ apache_service }}"
|
||||||
state: reloaded
|
state: reloaded
|
||||||
|
|
||||||
# if the only service using the backend db disable if not running
|
# if the only service using the backend db disable if not running
|
||||||
- name: Disable postgresql-iiab service when not pathagar_enabled
|
- name: Disable 'postgresql-iiab' systemd service, if not moodle_enabled and not pathagar_enabled
|
||||||
systemd:
|
systemd:
|
||||||
name: postgresql-iiab
|
name: postgresql-iiab
|
||||||
state: stopped
|
state: stopped
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
- name: NODEJS
|
- name: NODEJS - run the 'nodejs' role
|
||||||
include_role:
|
include_role:
|
||||||
name: nodejs
|
name: nodejs
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
when: not sugarizer_enabled
|
when: not sugarizer_enabled
|
||||||
|
|
||||||
# stops mongodb would of been called via meta/main.yml prior
|
# stops mongodb would of been called via meta/main.yml prior
|
||||||
- name: MONGODB
|
- name: Run mongodb/tasks/enable.yml to stop MongoDB, if not sugarizer_enabled
|
||||||
include_tasks: roles/mongodb/tasks/enable.yml
|
include_tasks: roles/mongodb/tasks/enable.yml
|
||||||
when: not sugarizer_enabled
|
when: not sugarizer_enabled
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
- name: MONGODB
|
- name: MONGODB - run the 'mongodb' role
|
||||||
include_role:
|
include_role:
|
||||||
name: mongodb
|
name: mongodb
|
||||||
|
|
||||||
- name: NODEJS
|
- name: NODEJS - run the 'nodejs' role
|
||||||
include_role:
|
include_role:
|
||||||
name: nodejs
|
name: nodejs
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue