mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
indentation/syntax per new Ansible documentation
This commit is contained in:
parent
2b97c8cab3
commit
24bada0dd7
1 changed files with 103 additions and 82 deletions
|
@ -1,6 +1,7 @@
|
||||||
- name: Install httpd required packages
|
- name: Install httpd required packages (debian)
|
||||||
package: name={{ item }}
|
package:
|
||||||
state=present
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
with_items:
|
with_items:
|
||||||
- apache2
|
- apache2
|
||||||
- php{{ php_version }}
|
- php{{ php_version }}
|
||||||
|
@ -10,17 +11,19 @@
|
||||||
- download
|
- download
|
||||||
when: is_debian
|
when: is_debian
|
||||||
|
|
||||||
- name: Debian changed sqlite name
|
- name: Debian changed sqlite name (debian-8)
|
||||||
package: name=php{{ php_version }}-sqlite
|
package:
|
||||||
|
name: "php{{ php_version }}-sqlite"
|
||||||
when: is_debian and ansible_distribution_major_version == "8"
|
when: is_debian and ansible_distribution_major_version == "8"
|
||||||
|
|
||||||
#- name: Debian changed sqlite name
|
#- name: Debian changed sqlite name
|
||||||
# package: name=php{{ php_version }}-sqlite3
|
# package: name=php{{ php_version }}-sqlite3
|
||||||
# when: ansible_local.local_facts.os_ver == "debian-9"
|
# when: ansible_local.local_facts.os_ver == "debian-9"
|
||||||
|
|
||||||
- name: Install httpd required packages
|
- name: Install httpd required packages (ubuntu)
|
||||||
package: name={{ item }}
|
package:
|
||||||
state=present
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
with_items:
|
with_items:
|
||||||
- apache2
|
- apache2
|
||||||
- php
|
- php
|
||||||
|
@ -28,9 +31,10 @@
|
||||||
- download
|
- download
|
||||||
when: is_ubuntu
|
when: is_ubuntu
|
||||||
|
|
||||||
- name: Install httpd required packages
|
- name: Install httpd required packages (redhat)
|
||||||
package: name={{ item }}
|
package:
|
||||||
state=present
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
with_items:
|
with_items:
|
||||||
- httpd
|
- httpd
|
||||||
- php
|
- php
|
||||||
|
@ -40,106 +44,120 @@
|
||||||
- download
|
- download
|
||||||
when: is_redhat
|
when: is_redhat
|
||||||
|
|
||||||
- name: Remove the default apache2 config file
|
- name: Remove the default apache2 config file (debuntu)
|
||||||
file: path=/etc/apache2/sites-enabled/000-default.conf
|
file:
|
||||||
src=/etc/apache2/sites-available/000-default.conf
|
path: /etc/apache2/sites-enabled/000-default.conf
|
||||||
state=absent
|
src: /etc/apache2/sites-available/000-default.conf
|
||||||
|
state: absent
|
||||||
when: is_debuntu
|
when: is_debuntu
|
||||||
|
|
||||||
- name: Create httpd config files
|
- name: Create httpd config files
|
||||||
template: backup=yes
|
template:
|
||||||
src={{ item.src }}
|
backup: yes
|
||||||
dest={{ item.dest }}
|
src: "{{ item.src }}"
|
||||||
owner=root
|
dest: "{{ item.dest }}"
|
||||||
group=root
|
owner: root
|
||||||
mode={{ item.mode }}
|
group: root
|
||||||
|
mode: "{{ item.mode }}"
|
||||||
with_items:
|
with_items:
|
||||||
- { src: '010-iiab.conf.j2' , dest: '/etc/{{ apache_config_dir }}/010-iiab.conf', mode: '0755' }
|
- { 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: 'proxy_ajp.conf.j2' , dest: '/etc/{{ apache_config_dir }}/proxy_ajp.conf', mode: '0644' }
|
||||||
- { src: 'php.ini.j2' , dest: '/etc/php.ini' , mode: '0644' }
|
- { src: 'php.ini.j2' , dest: '/etc/php.ini' , mode: '0644' }
|
||||||
|
|
||||||
# remove symlinks for mpm-event, replace with mpm-prefork
|
# remove symlinks for mpm-event, replace with mpm-prefork
|
||||||
- name: Remove mpm event links
|
- name: Remove mpm event links (debuntu)
|
||||||
file: path=/etc/apache2/mods-enabled/{{ item }}
|
file:
|
||||||
state=absent
|
path: "/etc/apache2/mods-enabled/{{ item }}"
|
||||||
|
state: absent
|
||||||
with_items:
|
with_items:
|
||||||
- mpm_event.conf
|
- mpm_event.conf
|
||||||
- mpm_event.load
|
- mpm_event.load
|
||||||
when: is_debuntu
|
when: is_debuntu
|
||||||
|
|
||||||
- name: Create symlinks for mpm-prefork
|
- name: Create symlinks for mpm-prefork (debuntu)
|
||||||
file: path=/etc/apache2/mods-enabled/{{ item }}
|
file:
|
||||||
src=/etc/apache2/mods-available/{{ item }}
|
path: "/etc/apache2/mods-enabled/{{ item }}"
|
||||||
state=link
|
src: "/etc/apache2/mods-available/{{ item }}"
|
||||||
|
state: link
|
||||||
with_items:
|
with_items:
|
||||||
- mpm_prefork.conf
|
- mpm_prefork.conf
|
||||||
- mpm_prefork.load
|
- mpm_prefork.load
|
||||||
when: is_debuntu
|
when: is_debuntu
|
||||||
|
|
||||||
- name: Turn on mod_proxy
|
- name: Turn on mod_proxy (debuntu)
|
||||||
command: a2enmod {{ item }}
|
command: a2enmod {{ item }}
|
||||||
with_items:
|
with_items:
|
||||||
- proxy
|
- proxy
|
||||||
- proxy_html
|
- proxy_html
|
||||||
- headers
|
- headers
|
||||||
- rewrite
|
- rewrite
|
||||||
when: is_debuntu
|
when: is_debuntu
|
||||||
|
|
||||||
- name: Create symlinks for enabling our site
|
- name: Create symlinks for enabling our site (debuntu)
|
||||||
file: path=/etc/apache2/sites-enabled/{{ item }}
|
file:
|
||||||
src=/etc/apache2/sites-available/{{ item }}
|
path: "/etc/apache2/sites-enabled/{{ item }}"
|
||||||
state=link
|
src: "/etc/apache2/sites-available/{{ item }}"
|
||||||
|
state: link
|
||||||
with_items:
|
with_items:
|
||||||
- 010-iiab.conf
|
- 010-iiab.conf
|
||||||
when: is_debuntu
|
when: is_debuntu
|
||||||
|
|
||||||
- name: Remove the default site container
|
- name: Remove the default site container (debuntu)
|
||||||
file: dest=/etc/apache2/000-default.conf
|
file:
|
||||||
state=absent
|
dest: /etc/apache2/000-default.conf
|
||||||
|
state: absent
|
||||||
when: is_debuntu
|
when: is_debuntu
|
||||||
|
|
||||||
- name: Create http pid dir
|
- name: Create http pid dir
|
||||||
file: path=/var/run/{{ apache_user }}
|
file:
|
||||||
mode=0755
|
path: "/var/run/{{ apache_user }}"
|
||||||
owner=root
|
mode: 0755
|
||||||
group=root
|
owner: root
|
||||||
state=directory
|
group: root
|
||||||
|
state: directory
|
||||||
|
|
||||||
- name: Create admin group
|
- name: Create admin group
|
||||||
group: name=admin
|
group:
|
||||||
state=present
|
name: admin
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: Add apache user to admin group
|
- name: Add apache user to admin group
|
||||||
user: name={{ apache_user }}
|
user:
|
||||||
groups=admin
|
name: "{{ apache_user }}"
|
||||||
state=present
|
groups: admin
|
||||||
createhome=no
|
state: present
|
||||||
|
createhome: no
|
||||||
|
|
||||||
- name: Create httpd log dir
|
- name: Create httpd log dir
|
||||||
file: path=/var/log/{{ apache_service }}
|
file:
|
||||||
mode=0755
|
path: "/var/log/{{ apache_service }}"
|
||||||
owner={{ apache_user }}
|
mode: 0755
|
||||||
group={{ apache_user }}
|
owner: "{{ apache_user }}"
|
||||||
state=directory
|
group: "{{ apache_user }}"
|
||||||
|
state: directory
|
||||||
|
|
||||||
- name: Enable httpd
|
- name: Enable httpd
|
||||||
service: name={{ apache_service }}
|
service:
|
||||||
enabled=yes
|
name: "{{ apache_service }}"
|
||||||
|
enabled: yes
|
||||||
|
|
||||||
- name: Create iiab-info directory
|
- name: Create iiab-info directory
|
||||||
file: path={{ doc_root }}/info
|
file:
|
||||||
mode=0755
|
path: "{{ doc_root }}/info"
|
||||||
owner={{ apache_user }}
|
mode: 0755
|
||||||
group={{ apache_user }}
|
owner: "{{ apache_user }}"
|
||||||
state=directory
|
group: "{{ apache_user }}"
|
||||||
|
state: directory
|
||||||
|
|
||||||
- name: Remove iiab-info.conf
|
- name: Remove iiab-info.conf
|
||||||
file: dest=/etc/{{ apache_config_dir }}/iiab-info.conf
|
file:
|
||||||
state=absent
|
dest: "/etc/{{ apache_config_dir }}/iiab-info.conf"
|
||||||
|
state: absent
|
||||||
|
|
||||||
- name: Remove iiab-info.conf symlink
|
- name: Remove iiab-info.conf symlink (debuntu)
|
||||||
file: dest=/etc/apache2/sites-enabled/iiab-info.conf
|
file:
|
||||||
state=absent
|
dest: /etc/apache2/sites-enabled/iiab-info.conf
|
||||||
|
state: absent
|
||||||
when: is_debuntu
|
when: is_debuntu
|
||||||
|
|
||||||
- include_tasks: html.yml
|
- include_tasks: html.yml
|
||||||
|
@ -147,17 +165,20 @@
|
||||||
- base
|
- base
|
||||||
|
|
||||||
- name: Place the script to generate homepages
|
- name: Place the script to generate homepages
|
||||||
template: src=refresh-wiki-docs.sh
|
template:
|
||||||
dest=/usr/bin/iiab-refresh-wiki-docs
|
src: refresh-wiki-docs.sh
|
||||||
mode=0755
|
dest: /usr/bin/iiab-refresh-wiki-docs
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
- name: Give apache_user permission for poweroff
|
- name: Give apache_user permission for poweroff
|
||||||
template: src=020_apache_poweroff.j2
|
template:
|
||||||
dest=/etc/sudoers.d/020_apache_poweroff
|
src: 020_apache_poweroff.j2
|
||||||
mode=0755
|
dest: /etc/sudoers.d/020_apache_poweroff
|
||||||
|
mode: 0755
|
||||||
when: allow_apache_sudo
|
when: allow_apache_sudo
|
||||||
|
|
||||||
- name: Remove apache_user permission for poweroff
|
- name: Remove apache_user permission for poweroff
|
||||||
file: dest=/etc/sudoers.d/020_apache_poweroff
|
file:
|
||||||
state=absent
|
dest: /etc/sudoers.d/020_apache_poweroff
|
||||||
|
state: absent
|
||||||
when: not allow_apache_sudo
|
when: not allow_apache_sudo
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue