2017-05-27 18:09:50 +00:00
|
|
|
- name: Install httpd required packages
|
|
|
|
package: name={{ item }}
|
|
|
|
state=present
|
|
|
|
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
|
|
|
|
|
2017-07-04 20:27:44 +00:00
|
|
|
- name: Debian changed sqlite name
|
|
|
|
package: name=php{{ php_version }}-sqlite
|
|
|
|
when: is_debian and ansible_distribution_major_version == "8"
|
|
|
|
|
2017-07-17 19:11:46 +00:00
|
|
|
#- name: Debian changed sqlite name
|
|
|
|
# package: name=php{{ php_version }}-sqlite3
|
|
|
|
# when: ansible_local.local_facts.os_ver == "debian-9"
|
2017-07-04 20:27:44 +00:00
|
|
|
|
2017-05-27 23:10:45 +00:00
|
|
|
- name: Install httpd required packages
|
|
|
|
package: name={{ item }}
|
|
|
|
state=present
|
|
|
|
with_items:
|
|
|
|
- apache2
|
|
|
|
- php
|
|
|
|
tags:
|
|
|
|
- download
|
|
|
|
when: is_ubuntu
|
2017-05-28 13:47:49 +00:00
|
|
|
|
2017-05-27 18:09:50 +00:00
|
|
|
- name: Install httpd required packages
|
|
|
|
package: name={{ item }}
|
|
|
|
state=present
|
|
|
|
with_items:
|
|
|
|
- httpd
|
|
|
|
- php
|
|
|
|
- php-curl
|
|
|
|
# - php-sqlite
|
|
|
|
tags:
|
|
|
|
- download
|
2017-05-27 23:10:45 +00:00
|
|
|
when: is_redhat
|
2017-05-27 18:09:50 +00:00
|
|
|
|
2017-10-27 13:25:51 +00:00
|
|
|
- name: Remove the default apache2 config file
|
2017-05-27 18:09:50 +00:00
|
|
|
file: path=/etc/apache2/sites-enabled/000-default.conf
|
|
|
|
src=/etc/apache2/sites-available/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
|
|
|
|
template: backup=yes
|
|
|
|
src={{ item.src }}
|
|
|
|
dest={{ item.dest }}
|
|
|
|
owner=root
|
|
|
|
group=root
|
|
|
|
mode={{ item.mode }}
|
|
|
|
with_items:
|
2017-06-09 23:25:56 +00:00
|
|
|
- { src: '010-iiab.conf.j2' , dest: '/etc/{{ apache_config_dir }}/010-iiab.conf', mode: '0755' }
|
2017-05-27 18:09:50 +00:00
|
|
|
- { 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' }
|
|
|
|
|
|
|
|
# remove symlinks for mpm-event, replace with mpm-prefork
|
|
|
|
- name: Remove mpm event links
|
|
|
|
file: path=/etc/apache2/mods-enabled/{{ item }}
|
|
|
|
state=absent
|
|
|
|
with_items:
|
|
|
|
- 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
|
|
|
|
2017-10-27 13:25:51 +00:00
|
|
|
- name: Create symlinks for mpm-prefork
|
2017-05-27 18:09:50 +00:00
|
|
|
file: path=/etc/apache2/mods-enabled/{{ item }}
|
|
|
|
src=/etc/apache2/mods-available/{{ item }}
|
|
|
|
state=link
|
|
|
|
with_items:
|
|
|
|
- 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
|
|
|
|
2017-10-27 13:25:51 +00:00
|
|
|
- name: Turn on mod_proxy
|
2017-05-27 18:09:50 +00:00
|
|
|
command: a2enmod {{ item }}
|
|
|
|
with_items:
|
|
|
|
- proxy
|
|
|
|
- proxy_html
|
|
|
|
- headers
|
|
|
|
- rewrite
|
2017-05-27 23:10:45 +00:00
|
|
|
when: is_debuntu
|
2017-05-27 18:09:50 +00:00
|
|
|
|
2017-10-27 13:25:51 +00:00
|
|
|
- name: Create symlinks for enabling our site
|
2017-05-27 18:09:50 +00:00
|
|
|
file: path=/etc/apache2/sites-enabled/{{ item }}
|
|
|
|
src=/etc/apache2/sites-available/{{ item }}
|
|
|
|
state=link
|
|
|
|
with_items:
|
2017-06-09 23:25:56 +00:00
|
|
|
- 010-iiab.conf
|
2017-05-27 23:10:45 +00:00
|
|
|
when: is_debuntu
|
2017-05-27 18:09:50 +00:00
|
|
|
|
|
|
|
- name: Remove the default site container
|
|
|
|
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
|
|
|
|
file: path=/var/run/{{ apache_user }}
|
|
|
|
mode=0755
|
|
|
|
owner=root
|
|
|
|
group=root
|
|
|
|
state=directory
|
|
|
|
|
2017-10-27 13:25:51 +00:00
|
|
|
- name: Create admin group
|
2017-05-27 18:09:50 +00:00
|
|
|
group: name=admin
|
|
|
|
state=present
|
|
|
|
|
|
|
|
- name: Add apache user to admin group
|
|
|
|
user: name={{ apache_user }}
|
|
|
|
groups=admin
|
|
|
|
state=present
|
|
|
|
createhome=no
|
|
|
|
|
|
|
|
- name: Create httpd log dir
|
|
|
|
file: path=/var/log/{{ apache_service }}
|
|
|
|
mode=0755
|
2017-06-09 23:25:56 +00:00
|
|
|
owner={{ apache_user }}
|
|
|
|
group={{ apache_user }}
|
2017-05-27 18:09:50 +00:00
|
|
|
state=directory
|
|
|
|
|
|
|
|
- name: Enable httpd
|
|
|
|
service: name={{ apache_service }}
|
|
|
|
enabled=yes
|
|
|
|
|
|
|
|
- name: Create iiab-info directory
|
|
|
|
file: path={{ doc_root }}/info
|
|
|
|
mode=0755
|
2017-06-09 23:25:56 +00:00
|
|
|
owner={{ apache_user }}
|
|
|
|
group={{ apache_user }}
|
2017-05-27 18:09:50 +00:00
|
|
|
state=directory
|
|
|
|
|
|
|
|
- name: Remove iiab-info.conf
|
|
|
|
file: dest=/etc/{{ apache_config_dir }}/iiab-info.conf
|
|
|
|
state=absent
|
|
|
|
|
|
|
|
- name: Remove iiab-info.conf symlink
|
|
|
|
file: dest=/etc/apache2/sites-enabled/iiab-info.conf
|
|
|
|
state=absent
|
|
|
|
when: is_debuntu
|
|
|
|
|
|
|
|
- include: html.yml
|
|
|
|
tags:
|
|
|
|
- base
|
|
|
|
|
2017-10-27 13:25:51 +00:00
|
|
|
- name: Place the script to generate homepages
|
2017-06-09 23:25:56 +00:00
|
|
|
template: src=refresh-wiki-docs.sh
|
2017-06-14 04:26:33 +00:00
|
|
|
dest=/usr/bin/iiab-refresh-wiki-docs
|
2017-06-09 23:25:56 +00:00
|
|
|
mode=0755
|
|
|
|
|
2017-07-04 21:46:11 +00:00
|
|
|
- name: Give apache_user permission for poweroff
|
|
|
|
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
|
|
|
|
file: dest=/etc/sudoers.d/020_apache_poweroff
|
|
|
|
state=absent
|
|
|
|
when: not allow_apache_sudo
|