Merge branch 'evoadmin-web-template-override' into unstable
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
I had to apply some of the yamllint fixes to the new multi-php tasks as well. Notably it removes the need to explicitely check for the truthy "True"
This commit is contained in:
commit
276177900b
|
@ -14,6 +14,7 @@ The **patch** part changes incrementally at each release.
|
||||||
* evolinux-base: On debian 10 and later, add noexec on /dev/shm
|
* evolinux-base: On debian 10 and later, add noexec on /dev/shm
|
||||||
* php: variable to install the mysqlnd module instead of the default mysql module
|
* php: variable to install the mysqlnd module instead of the default mysql module
|
||||||
* packweb-apache: Deploy opcache.php to give some insights on PHP's opcache status
|
* packweb-apache: Deploy opcache.php to give some insights on PHP's opcache status
|
||||||
|
* webapps/evoadmin-web Overload templates if needed
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
* elasticsearch: listen on local interface only by default
|
* elasticsearch: listen on local interface only by default
|
||||||
|
|
35
webapps/evoadmin-web/README.md
Normal file
35
webapps/evoadmin-web/README.md
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
# Set custom web-add.conf file
|
||||||
|
- "templates/evoadmin-web/web-add.{{ inventory_hostname }}.conf.j2"
|
||||||
|
- "templates/evoadmin-web/web-add.{{ host_group }}.conf.j2"
|
||||||
|
- "templates/evoadmin-web/web-add.conf.j2"
|
||||||
|
And force it to update:
|
||||||
|
evoadmin_add_conf_force: True
|
||||||
|
|
||||||
|
# Set custom web-mail.tpl
|
||||||
|
- "templates/evoadmin-web/web-mail.{{ inventory_hostname }}.tpl.j2"
|
||||||
|
- "templates/evoadmin-web/web-mail.{{ host_group }}.tpl.j2"
|
||||||
|
- "templates/evoadmin-web/web-mail.tpl.j2"
|
||||||
|
And force it to update:
|
||||||
|
evoadmin_mail_tpl_force: True
|
||||||
|
|
||||||
|
# Set custom evoadmin.conf VHost
|
||||||
|
- "templates/evoadmin-web/evoadmin.{{ inventory_hostname }}.conf.j2"
|
||||||
|
- "templates/evoadmin-web/evoadmin.{{ host_group }}.conf.j2"
|
||||||
|
- "templates/evoadmin-web/evoadmin.conf.j2"
|
||||||
|
And force it to update:
|
||||||
|
evoadmin_force_vhost: True
|
||||||
|
|
||||||
|
# Set custom config.local.php
|
||||||
|
- "templates/evoadmin-web/config.local.{{ inventory_hostname }}.php.j2"
|
||||||
|
- "templates/evoadmin-web/config.local.{{ host_group }}.php.j2"
|
||||||
|
- "templates/evoadmin-web/config.local.php.j2"
|
||||||
|
And force it to update:
|
||||||
|
evoadmin_config_local_php_force: True
|
||||||
|
|
||||||
|
# Set evoadmin-web sudoers file
|
||||||
|
- "templates/evoadmin-web/sudoers.{{ inventory_hostname }}.j2"
|
||||||
|
- "templates/evoadmin-web/sudoers.{{ host_group }}.j2"
|
||||||
|
- "templates/evoadmin-web/sudoers.j2"
|
||||||
|
- "sudoers.j2"
|
||||||
|
And force it to update:
|
||||||
|
evoadmin_sudoers_conf_force: True
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
general_alert_email: "root@localhost"
|
general_alert_email: "root@localhost"
|
||||||
evoadmin_contact_email: Null
|
evoadmin_contact_email: null
|
||||||
evoadmin_bounce_email: "{{ evoadmin_contact_email }}"
|
evoadmin_bounce_email: "{{ evoadmin_contact_email }}"
|
||||||
|
|
||||||
evoadmin_home_dir: "/home/{{ evoadmin_username }}"
|
evoadmin_home_dir: "/home/{{ evoadmin_username }}"
|
||||||
|
@ -10,15 +10,21 @@ evoadmin_scripts_dir: /usr/share/scripts/evoadmin
|
||||||
evoadmin_host: "evoadmin.{{ ansible_fqdn }}"
|
evoadmin_host: "evoadmin.{{ ansible_fqdn }}"
|
||||||
evoadmin_username: evoadmin
|
evoadmin_username: evoadmin
|
||||||
|
|
||||||
evoadmin_enable_vhost: True
|
evoadmin_multi_php: false
|
||||||
evoadmin_multi_php: False
|
evoadmin_enable_vhost: true
|
||||||
|
|
||||||
|
evoadmin_force_vhost: false
|
||||||
|
evoadmin_config_local_php_force: false
|
||||||
|
evoadmin_sudoers_conf_force: false
|
||||||
|
evoadmin_add_conf_force: false
|
||||||
|
evoadmin_mail_tpl_force: false
|
||||||
|
|
||||||
evoadmin_tpl_servername: "{{ ansible_fqdn }}"
|
evoadmin_tpl_servername: "{{ ansible_fqdn }}"
|
||||||
evoadmin_tpl_address: "{{ ansible_default_ipv4.address }}"
|
evoadmin_tpl_address: "{{ ansible_default_ipv4.address }}"
|
||||||
evoadmin_tpl_phpmyadmin_url: Null
|
evoadmin_tpl_phpmyadmin_url: null
|
||||||
evoadmin_tpl_cgi_suffix: Null
|
evoadmin_tpl_cgi_suffix: null
|
||||||
evoadmin_tpl_signature: evoadmin
|
evoadmin_tpl_signature: evoadmin
|
||||||
evoadmin_tpl_mail_from: root@localhost
|
evoadmin_tpl_mail_from: root@localhost
|
||||||
evoadmin_tpl_mail_bcc: Null
|
evoadmin_tpl_mail_bcc: null
|
||||||
evoadmin_tpl_mail_standard: "{{ general_alert_email }}"
|
evoadmin_tpl_mail_standard: "{{ general_alert_email }}"
|
||||||
evoadmin_tpl_mail_urgent: "{{ general_alert_email }}"
|
evoadmin_tpl_mail_urgent: "{{ general_alert_email }}"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
galaxy_info:
|
galaxy_info:
|
||||||
author: Evolix
|
author: Evolix
|
||||||
description: Installation of evoadmin-web
|
description: Installation of evoadmin-web
|
||||||
|
@ -9,10 +10,10 @@ galaxy_info:
|
||||||
min_ansible_version: 2.2
|
min_ansible_version: 2.2
|
||||||
|
|
||||||
platforms:
|
platforms:
|
||||||
- name: Debian
|
- name: Debian
|
||||||
versions:
|
versions:
|
||||||
- jessie
|
- jessie
|
||||||
- stretch
|
- stretch
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- proftpd
|
- proftpd
|
||||||
|
|
|
@ -3,22 +3,36 @@
|
||||||
- name: "Create /etc/evolinux"
|
- name: "Create /etc/evolinux"
|
||||||
file:
|
file:
|
||||||
dest: "/etc/evolinux"
|
dest: "/etc/evolinux"
|
||||||
recurse: yes
|
recurse: true
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: Configure web-add config file
|
- name: Configure web-add config file
|
||||||
template:
|
template:
|
||||||
src: web-add.conf.j2
|
src: "{{ item }}"
|
||||||
dest: /etc/evolinux/web-add.conf
|
dest: /etc/evolinux/web-add.conf
|
||||||
|
force: "{{ evoadmin_add_conf_force }}"
|
||||||
|
with_first_found:
|
||||||
|
- "templates/evoadmin-web/web-add.{{ inventory_hostname }}.conf.j2"
|
||||||
|
- "templates/evoadmin-web/web-add.{{ host_group }}.conf.j2"
|
||||||
|
- "templates/evoadmin-web/web-add.conf.j2"
|
||||||
|
- "web-add.conf.j2"
|
||||||
|
register: evoadmin_add_conf_template
|
||||||
|
|
||||||
- name: Configure web-add template file for mail
|
- name: Configure web-add template file for mail
|
||||||
template:
|
template:
|
||||||
src: web-mail.tpl.j2
|
src: "{{ item }}"
|
||||||
dest: "{{ evoadmin_scripts_dir }}/web-mail.tpl"
|
dest: "{{ evoadmin_scripts_dir }}/web-mail.tpl"
|
||||||
|
force: "{{ evoadmin_mail_tpl_force }}"
|
||||||
|
with_first_found:
|
||||||
|
- "templates/evoadmin-web/web-mail.{{ inventory_hostname }}.tpl.j2"
|
||||||
|
- "templates/evoadmin-web/web-mail.{{ host_group }}.tpl.j2"
|
||||||
|
- "templates/evoadmin-web/web-mail.tpl.j2"
|
||||||
|
- "web-mail.tpl.j2"
|
||||||
|
register: evoadmin_mail_tpl_template
|
||||||
|
|
||||||
- name: Copy multi php-cli script
|
- name: Copy multi php-cli script
|
||||||
copy:
|
copy:
|
||||||
src: phpContainer
|
src: phpContainer
|
||||||
dest: /usr/local/bin/phpContainer
|
dest: /usr/local/bin/phpContainer
|
||||||
mode: 0700
|
mode: 0700
|
||||||
when: evoadmin_multi_php == True
|
when: evoadmin_multi_php
|
||||||
|
|
|
@ -7,6 +7,6 @@
|
||||||
|
|
||||||
- name: Patch ProFTPd config file
|
- name: Patch ProFTPd config file
|
||||||
patch:
|
patch:
|
||||||
remote_src: no
|
remote_src: false
|
||||||
src: ftp/evolinux.conf.diff
|
src: ftp/evolinux.conf.diff
|
||||||
dest: /etc/proftpd/conf.d/z-evolinux.conf
|
dest: /etc/proftpd/conf.d/z-evolinux.conf
|
||||||
|
|
|
@ -9,14 +9,14 @@
|
||||||
name: '{{ item }}'
|
name: '{{ item }}'
|
||||||
state: present
|
state: present
|
||||||
with_items:
|
with_items:
|
||||||
- php-pear
|
- php-pear
|
||||||
- php-log
|
- php-log
|
||||||
|
|
||||||
- name: Install PHP5 packages
|
- name: Install PHP5 packages
|
||||||
apt:
|
apt:
|
||||||
name: '{{ item }}'
|
name: '{{ item }}'
|
||||||
state: present
|
state: present
|
||||||
allow_unauthenticated: yes
|
allow_unauthenticated: true
|
||||||
with_items:
|
with_items:
|
||||||
- php5-pam
|
- php5-pam
|
||||||
when: ansible_distribution_release == "jessie"
|
when: ansible_distribution_release == "jessie"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
user:
|
user:
|
||||||
name: evoadmin
|
name: evoadmin
|
||||||
comment: "Evoadmin Web Account"
|
comment: "Evoadmin Web Account"
|
||||||
home: "{{ evoadmin_home_dir}}"
|
home: "{{ evoadmin_home_dir }}"
|
||||||
password: "!"
|
password: "!"
|
||||||
|
|
||||||
- name: Create www-evoadmin group
|
- name: Create www-evoadmin group
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
user:
|
user:
|
||||||
name: www-evoadmin
|
name: www-evoadmin
|
||||||
groups: shadow
|
groups: shadow
|
||||||
append: yes
|
append: true
|
||||||
when: ansible_distribution_release == "jessie"
|
when: ansible_distribution_release == "jessie"
|
||||||
|
|
||||||
- name: "Create www-evoadmin (Debian 9 or later)"
|
- name: "Create www-evoadmin (Debian 9 or later)"
|
||||||
|
@ -36,8 +36,10 @@
|
||||||
regexp: "{{ item.regexp }}"
|
regexp: "{{ item.regexp }}"
|
||||||
state: present
|
state: present
|
||||||
with_items:
|
with_items:
|
||||||
- { line: 'evoadmin: root', regexp: '^evoadmin:'}
|
- line: 'evoadmin: root'
|
||||||
- { line: 'www-evoadmin: root', regexp: '^www-evoadmin:'}
|
regexp: '^evoadmin:'
|
||||||
|
- line: 'www-evoadmin: root'
|
||||||
|
regexp: '^www-evoadmin:'
|
||||||
notify: "newaliases"
|
notify: "newaliases"
|
||||||
when: etc_aliases.stat.exists
|
when: etc_aliases.stat.exists
|
||||||
|
|
||||||
|
@ -51,7 +53,7 @@
|
||||||
repo: https://forge.evolix.org/evoadmin-web.git
|
repo: https://forge.evolix.org/evoadmin-web.git
|
||||||
dest: "{{ evoadmin_document_root }}"
|
dest: "{{ evoadmin_document_root }}"
|
||||||
version: jessie
|
version: jessie
|
||||||
update: no
|
update: false
|
||||||
when: ansible_distribution_release == "jessie"
|
when: ansible_distribution_release == "jessie"
|
||||||
|
|
||||||
- name: "Clone evoadmin repository (Debian 9 or later)"
|
- name: "Clone evoadmin repository (Debian 9 or later)"
|
||||||
|
@ -59,7 +61,7 @@
|
||||||
repo: https://forge.evolix.org/evoadmin-web.git
|
repo: https://forge.evolix.org/evoadmin-web.git
|
||||||
dest: "{{ evoadmin_document_root }}"
|
dest: "{{ evoadmin_document_root }}"
|
||||||
version: master
|
version: master
|
||||||
update: yes
|
update: false
|
||||||
when: ansible_distribution_major_version | version_compare('9', '>=')
|
when: ansible_distribution_major_version | version_compare('9', '>=')
|
||||||
|
|
||||||
- name: Change ownership on git repository
|
- name: Change ownership on git repository
|
||||||
|
@ -67,7 +69,7 @@
|
||||||
dest: "{{ evoadmin_document_root }}"
|
dest: "{{ evoadmin_document_root }}"
|
||||||
owner: "{{ evoadmin_username }}"
|
owner: "{{ evoadmin_username }}"
|
||||||
group: "{{ evoadmin_username }}"
|
group: "{{ evoadmin_username }}"
|
||||||
recurse: yes
|
recurse: true
|
||||||
|
|
||||||
- name: Create evoadmin log directory
|
- name: Create evoadmin log directory
|
||||||
file:
|
file:
|
||||||
|
@ -83,7 +85,7 @@
|
||||||
- name: "Create {{ evoadmin_scripts_dir }}"
|
- name: "Create {{ evoadmin_scripts_dir }}"
|
||||||
file:
|
file:
|
||||||
dest: "{{ evoadmin_scripts_dir }}"
|
dest: "{{ evoadmin_scripts_dir }}"
|
||||||
# recurse: yes
|
# recurse: true
|
||||||
mode: "0700"
|
mode: "0700"
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
|
@ -97,19 +99,26 @@
|
||||||
command: "chmod -R --verbose u=rwX,g=rX,o= {{ evoadmin_document_root }}"
|
command: "chmod -R --verbose u=rwX,g=rX,o= {{ evoadmin_document_root }}"
|
||||||
register: command_result
|
register: command_result
|
||||||
changed_when: "'changed' in command_result.stdout"
|
changed_when: "'changed' in command_result.stdout"
|
||||||
# failed_when: False
|
# failed_when: false
|
||||||
args:
|
args:
|
||||||
warn: no
|
warn: false
|
||||||
|
|
||||||
- name: Add evoadmin sudoers file
|
- name: Add evoadmin sudoers file
|
||||||
template:
|
template:
|
||||||
src: sudoers.j2
|
src: "{{ item }}"
|
||||||
dest: /etc/sudoers.d/evoadmin
|
dest: /etc/sudoers.d/evoadmin
|
||||||
mode: "0600"
|
mode: "0600"
|
||||||
|
force: "{{ evoadmin_sudoers_conf_force }}"
|
||||||
validate: "visudo -cf %s"
|
validate: "visudo -cf %s"
|
||||||
|
with_first_found:
|
||||||
|
- "templates/evoadmin-web/sudoers.{{ inventory_hostname }}.j2"
|
||||||
|
- "templates/evoadmin-web/sudoers.{{ host_group }}.j2"
|
||||||
|
- "templates/evoadmin-web/sudoers.j2"
|
||||||
|
- "sudoers.j2"
|
||||||
|
register: evoadmin_sudoers_conf
|
||||||
|
|
||||||
- name: Modify bashrc skel file
|
- name: Modify bashrc skel file
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/skel/.bashrc
|
dest: /etc/skel/.bashrc
|
||||||
line: "alias php='sudo /usr/local/bin/phpContainer'"
|
line: "alias php='sudo /usr/local/bin/phpContainer'"
|
||||||
when: evoadmin_multi_php == True
|
when: evoadmin_multi_php
|
||||||
|
|
|
@ -20,8 +20,15 @@
|
||||||
|
|
||||||
- name: Install evoadmin VHost
|
- name: Install evoadmin VHost
|
||||||
template:
|
template:
|
||||||
src: evoadmin.conf.j2
|
src: "{{ item }}"
|
||||||
dest: /etc/apache2/sites-available/evoadmin.conf
|
dest: /etc/apache2/sites-available/evoadmin.conf
|
||||||
|
force: "{{ evoadmin_force_vhost }}"
|
||||||
|
with_first_found:
|
||||||
|
- "templates/evoadmin-web/evoadmin.{{ inventory_hostname }}.conf.j2"
|
||||||
|
- "templates/evoadmin-web/evoadmin.{{ host_group }}.conf.j2"
|
||||||
|
- "templates/evoadmin-web/evoadmin.conf.j2"
|
||||||
|
- "evoadmin.conf.j2"
|
||||||
|
register: evoadmin_vhost_template
|
||||||
notify: reload apache2
|
notify: reload apache2
|
||||||
|
|
||||||
- name: Enable evoadmin vhost
|
- name: Enable evoadmin vhost
|
||||||
|
@ -40,16 +47,22 @@
|
||||||
|
|
||||||
- name: Copy config file for evoadmin
|
- name: Copy config file for evoadmin
|
||||||
template:
|
template:
|
||||||
src: config.local.php.j2
|
src: "{{ item }}"
|
||||||
dest: "{{ evoadmin_document_root}}/conf/config.local.php"
|
dest: "{{ evoadmin_document_root }}/conf/config.local.php"
|
||||||
mode: "0640"
|
mode: "0640"
|
||||||
owner: evoadmin
|
owner: evoadmin
|
||||||
group: evoadmin
|
group: evoadmin
|
||||||
force: no
|
force: "{{ evoadmin_config_local_php_force }}"
|
||||||
|
with_first_found:
|
||||||
|
- "templates/evoadmin-web/config.local.{{ inventory_hostname }}.php.j2"
|
||||||
|
- "templates/evoadmin-web/config.local.{{ host_group }}.php.j2"
|
||||||
|
- "templates/evoadmin-web/config.local.php.j2"
|
||||||
|
- "config.local.conf.j2"
|
||||||
|
register: evoadmin_config_local_php_template
|
||||||
|
|
||||||
- name: Enable proxy_fcgi
|
- name: Enable proxy_fcgi
|
||||||
apache2_module:
|
apache2_module:
|
||||||
state: present
|
state: present
|
||||||
name: proxy_fcgi
|
name: proxy_fcgi
|
||||||
notify: restart apache2
|
notify: restart apache2
|
||||||
when: evoadmin_multi_php == True
|
when: evoadmin_multi_php
|
||||||
|
|
Loading…
Reference in a new issue