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

cleaner Ansible messaging

This commit is contained in:
A Holt 2017-10-27 10:16:05 -04:00 committed by GitHub
parent 01a98b1f15
commit b1ec762ffb

View file

@ -1,5 +1,5 @@
--- ---
- name: Install moodle required packages - name: Install Moodle required packages
package: name={{ item }} package: name={{ item }}
state=present state=present
with_items: with_items:
@ -7,7 +7,7 @@
- php-pgsql - php-pgsql
when: not is_debuntu when: not is_debuntu
- name: Install moodle required packages - name: Install Moodle required packages
package: name={{ item }} package: name={{ item }}
state=present state=present
with_items: with_items:
@ -29,11 +29,11 @@
package: name=php-pclzip package: name=php-pclzip
when: is_debian_8 when: is_debian_8
- name: Determine if moodle is already downloaded - name: Determine if Moodle is already downloaded
stat: path={{ moodle_base }}/config-dist.php stat: path={{ moodle_base }}/config-dist.php
register: moodle register: moodle
- name: Download the latest moodle repo - name: Download the latest Moodle repo
git: repo={{ moodle_repo_url }} git: repo={{ moodle_repo_url }}
dest={{ moodle_base }} dest={{ moodle_base }}
depth=1 depth=1
@ -42,30 +42,30 @@
# ignore_errors: yes # ignore_errors: yes
when: internet_available and moodle.stat.exists is defined and not moodle.stat.exists when: internet_available and moodle.stat.exists is defined and not moodle.stat.exists
- name: Prepare the downloaded directory so apache can install config file - name: Prepare the downloaded directory so Apache can install config file
file: path={{ moodle_base }} file: path={{ moodle_base }}
owner={{ apache_user }} owner={{ apache_user }}
recurse=yes recurse=yes
state=directory state=directory
- name: Give apache permission to write moodle data directory - name: Give Apache permission to write Moodle data directory
file: path={{ content_base }}/dbdata/moodle file: path={{ content_base }}/dbdata/moodle
owner={{ apache_user }} owner={{ apache_user }}
mode=0755 mode=0755
state=directory state=directory
- name: Create a moodle data dir with apache permission to write - name: Create a Moodle data dir with Apache permission to write
file: path={{ moodle_data }} file: path={{ moodle_data }}
owner={{ apache_user }} owner={{ apache_user }}
group={{ apache_user }} group={{ apache_user }}
mode=0770 mode=0770
state=directory state=directory
- name: Remove stock moodle conf - name: Remove stock Moodle conf
file: path='/etc/{{ apache_config_dir }}/moodle.conf' file: path='/etc/{{ apache_config_dir }}/moodle.conf'
state=absent state=absent
- name: Put moodle config file in place - name: Put Moodle config file in place
template: src=022-moodle.j2 template: src=022-moodle.j2
dest=/etc/{{ apache_config_dir }}/022-moodle.conf dest=/etc/{{ apache_config_dir }}/022-moodle.conf
owner=root owner=root
@ -73,13 +73,13 @@
mode=0644 mode=0644
when: moodle_enabled when: moodle_enabled
- name: Enable moodle - name: Enable Moodle
file: path=/etc/apache2/sites-enabled/022-moodle.conf file: path=/etc/apache2/sites-enabled/022-moodle.conf
src=/etc/apache2/sites-available/022-moodle.conf src=/etc/apache2/sites-available/022-moodle.conf
state=link state=link
when: moodle_enabled and is_debuntu when: moodle_enabled and is_debuntu
- name: Disable moodle - name: Disable Moodle
file: path=/etc/apache2/sites-enabled/022-moodle.conf file: path=/etc/apache2/sites-enabled/022-moodle.conf
state=absent state=absent
when: not moodle_enabled and is_debuntu when: not moodle_enabled and is_debuntu
@ -116,24 +116,24 @@
enabled=yes enabled=yes
when: moodle_enabled when: moodle_enabled
- name: Restart apache - name: Restart Apache
service: name={{ apache_service }} service: name={{ apache_service }}
state=restarted state=restarted
- name: see if the config.php file exists - name: See if the config.php file exists
stat: path='{{ moodle_base }}/config.php' stat: path='{{ moodle_base }}/config.php'
register: config register: config
- name: Execute moodle startup script - name: Execute Moodle startup 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 config file
# command: chown -R {{ apache_user }} {{ moodle_base }} # command: chown -R {{ apache_user }} {{ moodle_base }}
file: path={{ moodle_base }}/config.php file: path={{ moodle_base }}/config.php
mode=0644 mode=0644
- name: add moodle to service list - name: Add Moodle to service list
ini_file: dest='{{ service_filelist }}' ini_file: dest='{{ service_filelist }}'
section=moodle section=moodle
option='{{ item.option }}' option='{{ item.option }}'