2018-02-07 00:26:57 +00:00
- name : Install httpd required packages (debian)
package :
name : "{{ item }}"
state : present
2017-05-27 18:09:50 +00:00
with_items :
- apache2
2017-07-04 20:27:44 +00:00
- php{{ php_version }}
- php{{ php_version }}-curl
# - php{{ php_version }}-sqlite
2017-05-27 18:09:50 +00:00
tags :
- download
when : is_debian
2018-02-07 00:26:57 +00:00
- name : Debian changed sqlite name (debian-8)
package :
name : "php{{ php_version }}-sqlite"
2017-07-04 20:27:44 +00:00
when : is_debian and ansible_distribution_major_version == "8"
2018-02-12 01:02:09 +00:00
- name : Debian changed sqlite name (debian-9)
2018-01-24 18:07:33 +00:00
package : name=php{{ php_version }}-sqlite3
when : is_debian and ansible_distribution_major_version == "9"
2017-07-04 20:27:44 +00:00
2018-02-07 00:26:57 +00:00
- name : Install httpd required packages (ubuntu)
package :
name : "{{ item }}"
state : present
2017-05-27 23:10:45 +00:00
with_items :
- apache2
- php
tags :
- download
when : is_ubuntu
2017-05-28 13:47:49 +00:00
2018-05-21 13:43:44 +00:00
- name : Sqlite3 no longer included in another package in ubuntu18
package :
name : php{{ php_version }}-sqlite3
2018-05-21 13:53:18 +00:00
when : is_ubuntu_18
2018-05-21 13:43:44 +00:00
2018-02-07 00:26:57 +00:00
- name : Install httpd required packages (redhat)
package :
name : "{{ item }}"
state : present
2017-05-27 18:09:50 +00:00
with_items :
- httpd
- php
- php-curl
2018-03-30 18:40:00 +00:00
- mod_authnz_external
2017-05-27 18:09:50 +00:00
# - php-sqlite
tags :
- download
2017-05-27 23:10:45 +00:00
when : is_redhat
2017-05-27 18:09:50 +00:00
2018-02-07 00:26:57 +00:00
- name : Remove the default apache2 config file (debuntu)
file :
path : /etc/apache2/sites-enabled/000-default.conf
state : absent
2017-05-28 13:47:49 +00:00
when : is_debuntu
2017-05-27 18:09:50 +00:00
- name : Create httpd config files
2018-02-07 00:26:57 +00:00
template :
backup : yes
src : "{{ item.src }}"
dest : "{{ item.dest }}"
owner : root
group : root
mode : "{{ item.mode }}"
2017-05-27 18:09:50 +00:00
with_items :
2018-02-07 00:26:57 +00:00
- { src: '010-iiab.conf.j2' , dest : '/etc/{{ apache_config_dir }}/010-iiab.conf' , mode : '0755' }
- { src: 'proxy_ajp.conf.j2' , dest : '/etc/{{ apache_config_dir }}/proxy_ajp.conf' , mode : '0644' }
- { src: 'php.ini.j2' , dest: '/etc/php.ini' , mode : '0644' }
2017-05-27 18:09:50 +00:00
# remove symlinks for mpm-event, replace with mpm-prefork
2018-02-07 00:26:57 +00:00
- name : Remove mpm event links (debuntu)
file :
path : "/etc/apache2/mods-enabled/{{ item }}"
state : absent
2017-05-27 18:09:50 +00:00
with_items :
2018-02-07 00:26:57 +00:00
- mpm_event.conf
- mpm_event.load
2017-05-27 23:10:45 +00:00
when : is_debuntu
2017-05-27 18:09:50 +00:00
2018-02-07 00:26:57 +00:00
- name : Create symlinks for mpm-prefork (debuntu)
file :
path : "/etc/apache2/mods-enabled/{{ item }}"
src : "/etc/apache2/mods-available/{{ item }}"
state : link
2017-05-27 18:09:50 +00:00
with_items :
2018-02-08 23:03:50 +00:00
- mpm_prefork.conf
- mpm_prefork.load
2017-05-27 23:10:45 +00:00
when : is_debuntu
2017-05-27 18:09:50 +00:00
2018-02-07 00:26:57 +00:00
- name : Turn on mod_proxy (debuntu)
2017-05-27 18:09:50 +00:00
command : a2enmod {{ item }}
with_items :
2018-02-07 00:26:57 +00:00
- proxy
- proxy_html
- headers
- rewrite
2017-05-27 23:10:45 +00:00
when : is_debuntu
2017-05-27 18:09:50 +00:00
2018-02-07 00:26:57 +00:00
- name : Create symlinks for enabling our site (debuntu)
file :
path : "/etc/apache2/sites-enabled/{{ item }}"
src : "/etc/apache2/sites-available/{{ item }}"
state : link
2017-05-27 18:09:50 +00:00
with_items :
2018-02-07 00:26:57 +00:00
- 010 -iiab.conf
2017-05-27 23:10:45 +00:00
when : is_debuntu
2017-05-27 18:09:50 +00:00
2018-02-07 00:26:57 +00:00
- name : Remove the default site container (debuntu)
file :
dest : /etc/apache2/000-default.conf
state : absent
2017-05-27 23:10:45 +00:00
when : is_debuntu
2017-05-27 18:09:50 +00:00
- name : Create http pid dir
2018-02-07 00:26:57 +00:00
file :
path : "/var/run/{{ apache_user }}"
mode : 0755
owner : root
group : root
state : directory
2017-05-27 18:09:50 +00:00
2017-10-27 13:25:51 +00:00
- name : Create admin group
2018-02-07 00:26:57 +00:00
group :
name : admin
state : present
2017-05-27 18:09:50 +00:00
- name : Add apache user to admin group
2018-02-07 00:26:57 +00:00
user :
name : "{{ apache_user }}"
groups : admin
state : present
createhome : no
2017-05-27 18:09:50 +00:00
- name : Create httpd log dir
2018-02-07 00:26:57 +00:00
file :
path : "/var/log/{{ apache_service }}"
mode : 0755
owner : "{{ apache_user }}"
group : "{{ apache_user }}"
state : directory
2017-05-27 18:09:50 +00:00
- name : Enable httpd
2018-02-07 00:26:57 +00:00
service :
name : "{{ apache_service }}"
enabled : yes
2017-05-27 18:09:50 +00:00
- name : Create iiab-info directory
2018-02-07 00:26:57 +00:00
file :
path : "{{ doc_root }}/info"
mode : 0755
owner : "{{ apache_user }}"
group : "{{ apache_user }}"
state : directory
2017-05-27 18:09:50 +00:00
- name : Remove iiab-info.conf
2018-02-07 00:26:57 +00:00
file :
dest : "/etc/{{ apache_config_dir }}/iiab-info.conf"
state : absent
- name : Remove iiab-info.conf symlink (debuntu)
file :
dest : /etc/apache2/sites-enabled/iiab-info.conf
state : absent
2017-05-27 18:09:50 +00:00
when : is_debuntu
2017-10-31 03:55:24 +00:00
- include_tasks : html.yml
2017-05-27 18:09:50 +00:00
tags :
- base
2018-07-18 22:18:17 +00:00
# Fixes search @ http://box/modules/es-wikihow - see https://github.com/iiab/iiab/issues/829
2018-07-18 21:41:38 +00:00
- include_tasks : php-stem.yml
tags :
- base
2018-07-19 00:34:57 +00:00
- 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)
2018-02-07 00:26:57 +00:00
template :
src : refresh-wiki-docs.sh
dest : /usr/bin/iiab-refresh-wiki-docs
mode : 0755
2017-06-09 23:25:56 +00:00
2017-07-04 21:46:11 +00:00
- name : Give apache_user permission for poweroff
2018-02-07 00:26:57 +00:00
template :
src : 020_apache_poweroff.j2
dest : /etc/sudoers.d/020_apache_poweroff
mode : 0755
2017-07-06 16:56:43 +00:00
when : allow_apache_sudo
- name : Remove apache_user permission for poweroff
2018-02-07 00:26:57 +00:00
file :
dest : /etc/sudoers.d/020_apache_poweroff
state : absent
2017-07-06 16:56:43 +00:00
when : not allow_apache_sudo