-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #7
- Loading branch information
Showing
9 changed files
with
120 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- | ||
- name: Enable EPEL repo | ||
package: | ||
name: epel-release | ||
state: latest | ||
when: ansible_os_family == 'RedHat' and ansible_distribution != 'Fedora' and mode == 'moodle' | ||
|
||
- name: Install packages common for WordPress / Moodle | ||
package: | ||
name: "{{ packages }}" | ||
state: latest | ||
vars: | ||
packages: | ||
- php-pdo | ||
- php-gd | ||
- php-opcache | ||
- php-mbstring | ||
- php-xml | ||
- "php{% if ansible_os_family == 'Debian' %}{{ noobient_nginx_php_ver }}{% endif %}-intl" | ||
- "php{% if ansible_os_family == 'RedHat' %}-pecl{% else %}{{ noobient_nginx_php_ver }}{% endif %}-zip" | ||
register: noobient_nginx_phpapps_installed | ||
|
||
- name: Install packages for WordPress | ||
package: | ||
name: "{{ packages }}" | ||
state: latest | ||
vars: | ||
packages: | ||
- php-mysqlnd | ||
- php-json | ||
register: noobient_nginx_wp_installed | ||
when: mode == 'wordpress' and noobient_nginx_wp_installed is not defined | ||
|
||
- name: Install packages for Moodle | ||
package: | ||
name: "{{ packages }}" | ||
state: latest | ||
vars: | ||
packages: | ||
- php-devel | ||
- libsodium | ||
- libsodium-devel | ||
- php-pgsql | ||
- php-soap | ||
- php-pear | ||
register: noobient_nginx_moodle_installed | ||
when: mode == 'moodle' and noobient_nginx_moodle_installed is not defined | ||
|
||
- name: Install libsodium | ||
command: | ||
cmd: pecl install --nodeps libsodium | ||
register: noobient_nginx_sodium_install | ||
changed_when: noobient_nginx_sodium_installed_str not in noobient_nginx_sodium_install.stdout | ||
failed_when: noobient_nginx_sodium_install.rc != 0 and noobient_nginx_sodium_install.rc != 1 | ||
when: mode == 'moodle' and noobient_nginx_sodium_install is not defined | ||
|
||
# Not available on EL8 | ||
- name: Install ImageMagick PHP extension | ||
package: | ||
name: "php{% if ansible_os_family == 'RedHat' %}-pecl{% else %}{{ noobient_nginx_php_ver }}{% endif %}-imagick" | ||
state: latest | ||
when: not (ansible_distribution_major_version == '8' and ansible_os_family == 'RedHat') | ||
|
||
- name: Set PHP options for Moodle | ||
ini_file: | ||
path: "{{ noobient_nginx_php_ini }}" | ||
section: PHP | ||
option: "{{ noobient_nginx_php_moodle_opt.option }}" | ||
value: "{{ noobient_nginx_php_moodle_opt.value }}" | ||
mode: '0644' | ||
backup: true | ||
loop: | ||
- { option: 'max_input_vars', value: '5000' } | ||
loop_control: | ||
loop_var: noobient_nginx_php_moodle_opt | ||
notify: Reload PHP | ||
when: mode == 'moodle' | ||
|
||
- name: Enable libsodium PHP module | ||
ini_file: | ||
path: /etc/php.d/99-libsodium.ini | ||
create: true | ||
section: '' | ||
option: extension | ||
value: sodium.so | ||
no_extra_spaces: true | ||
owner: root | ||
group: root | ||
mode: '0644' | ||
notify: Reload PHP | ||
when: mode == 'moodle' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
# Test batch mode and idempotency at the same time | ||
- include_role: | ||
name: "{{ playbook_dir.split('/')[:-1] | last }}" | ||
vars: | ||
nginx_batch: | ||
- { domain: foo3.com, mode: redirect, new_domain: bar.com, ssl_selfsigned: true } | ||
- { domain: foo.com, mode: proxy, ssl_selfsigned: 'true', host_port: '7777', proxy_port: '8888' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,6 @@ | ||
--- | ||
- hosts: 127.0.0.1 | ||
tasks: | ||
- include_tasks: php.yml | ||
- include_tasks: single.yml | ||
|
||
# Test batch mode and idempotency at the same time | ||
- include_role: | ||
name: "{{ playbook_dir.split('/')[:-1] | last }}" | ||
vars: | ||
nginx_batch: | ||
- { domain: foo3.com, mode: redirect, new_domain: bar.com, ssl_selfsigned: true } | ||
- { domain: foo.com, mode: proxy, ssl_selfsigned: 'true', host_port: '7777', proxy_port: '8888' } | ||
- include_tasks: php.yml | ||
- include_tasks: batch.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters