mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
194 lines
4.5 KiB
YAML
194 lines
4.5 KiB
YAML
- name: Install httpd required packages (debian)
|
|
package:
|
|
name: "{{ item }}"
|
|
state: present
|
|
with_items:
|
|
- apache2
|
|
- php{{ php_version }}
|
|
- php{{ php_version }}-curl
|
|
# - php{{ php_version }}-sqlite
|
|
tags:
|
|
- download
|
|
when: is_debian
|
|
|
|
- name: Debian changed sqlite name (debian-8)
|
|
package:
|
|
name: "php{{ php_version }}-sqlite"
|
|
when: is_debian and ansible_distribution_major_version == "8"
|
|
|
|
- name: Debian changed sqlite name (debian-9)
|
|
package: name=php{{ php_version }}-sqlite3
|
|
when: is_debian and ansible_distribution_major_version == "9"
|
|
|
|
- name: Install httpd required packages (ubuntu)
|
|
package:
|
|
name: "{{ item }}"
|
|
state: present
|
|
with_items:
|
|
- apache2
|
|
- php
|
|
tags:
|
|
- download
|
|
when: is_ubuntu
|
|
|
|
- name: Sqlite3 no longer included in another package in ubuntu18
|
|
package:
|
|
name: php{{ php_version }}-sqlite3
|
|
when: is_ubuntu_18
|
|
|
|
- name: Install httpd required packages (redhat)
|
|
package:
|
|
name: "{{ item }}"
|
|
state: present
|
|
with_items:
|
|
- httpd
|
|
- php
|
|
- php-curl
|
|
- mod_authnz_external
|
|
# - php-sqlite
|
|
tags:
|
|
- download
|
|
when: is_redhat
|
|
|
|
- name: Remove the default apache2 config file (debuntu)
|
|
file:
|
|
path: /etc/apache2/sites-enabled/000-default.conf
|
|
state: absent
|
|
when: is_debuntu
|
|
|
|
- name: Create httpd config files
|
|
template:
|
|
backup: yes
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
owner: root
|
|
group: root
|
|
mode: "{{ item.mode }}"
|
|
with_items:
|
|
- { 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' }
|
|
|
|
# remove symlinks for mpm-event, replace with mpm-prefork
|
|
- name: Remove mpm event links (debuntu)
|
|
file:
|
|
path: "/etc/apache2/mods-enabled/{{ item }}"
|
|
state: absent
|
|
with_items:
|
|
- mpm_event.conf
|
|
- mpm_event.load
|
|
when: is_debuntu
|
|
|
|
- name: Create symlinks for mpm-prefork (debuntu)
|
|
file:
|
|
path: "/etc/apache2/mods-enabled/{{ item }}"
|
|
src: "/etc/apache2/mods-available/{{ item }}"
|
|
state: link
|
|
with_items:
|
|
- mpm_prefork.conf
|
|
- mpm_prefork.load
|
|
when: is_debuntu
|
|
|
|
- name: Turn on mod_proxy (debuntu)
|
|
command: a2enmod {{ item }}
|
|
with_items:
|
|
- proxy
|
|
- proxy_html
|
|
- headers
|
|
- rewrite
|
|
when: is_debuntu
|
|
|
|
- name: Create symlinks for enabling our site (debuntu)
|
|
file:
|
|
path: "/etc/apache2/sites-enabled/{{ item }}"
|
|
src: "/etc/apache2/sites-available/{{ item }}"
|
|
state: link
|
|
with_items:
|
|
- 010-iiab.conf
|
|
when: is_debuntu
|
|
|
|
- name: Remove the default site container (debuntu)
|
|
file:
|
|
dest: /etc/apache2/000-default.conf
|
|
state: absent
|
|
when: is_debuntu
|
|
|
|
- name: Create http pid dir
|
|
file:
|
|
path: "/var/run/{{ apache_user }}"
|
|
mode: 0755
|
|
owner: root
|
|
group: root
|
|
state: directory
|
|
|
|
- name: Create admin group
|
|
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
|
|
owner: "{{ apache_user }}"
|
|
group: "{{ apache_user }}"
|
|
state: directory
|
|
|
|
- name: Enable httpd
|
|
service:
|
|
name: "{{ apache_service }}"
|
|
enabled: yes
|
|
|
|
- name: Create iiab-info directory
|
|
file:
|
|
path: "{{ doc_root }}/info"
|
|
mode: 0755
|
|
owner: "{{ apache_user }}"
|
|
group: "{{ apache_user }}"
|
|
state: directory
|
|
|
|
- name: Remove iiab-info.conf
|
|
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
|
|
when: is_debuntu
|
|
|
|
- include_tasks: html.yml
|
|
tags:
|
|
- base
|
|
|
|
# Fixes search @ http://box/modules/es-wikihow - see https://github.com/iiab/iiab/issues/829
|
|
- include_tasks: php-stem.yml
|
|
tags:
|
|
- base
|
|
|
|
- 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)
|
|
template:
|
|
src: refresh-wiki-docs.sh
|
|
dest: /usr/bin/iiab-refresh-wiki-docs
|
|
mode: 0755
|
|
|
|
- name: Give apache_user permission for poweroff
|
|
template:
|
|
src: 020_apache_poweroff.j2
|
|
dest: /etc/sudoers.d/020_apache_poweroff
|
|
mode: 0755
|
|
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
|