1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00
iiab/roles/nginx/tasks/install.yml

58 lines
1.8 KiB
YAML
Raw Normal View History

2020-01-12 00:00:39 +00:00
- name: Install NGINX required and helper packages
package:
name: "{{ item }}"
state: present
2019-11-20 08:32:05 +00:00
with_items:
- nginx-extras
- uwsgi
- uwsgi-plugin-python3
- php-fpm
- libnginx-mod-http-subs-filter
- name: Add http server user to shadow group, so it can authenticate Admin Console
2019-11-20 08:32:05 +00:00
user:
name: "{{ apache_user }}"
groups: shadow
2020-01-12 00:00:39 +00:00
- name: Remove NGINX default config /etc/nginx/sites-enabled/default
2019-11-20 08:32:05 +00:00
file:
path: /etc/nginx/sites-enabled/default
state: absent
2019-11-20 08:46:55 +00:00
2020-01-12 00:00:39 +00:00
- name: 'Install 4 files from template: /etc/nginx/server.conf, /etc/nginx/nginx.conf, /etc/{{ apache_service }}/ports.conf, /etc/systemd/system/uwsgi.service'
2019-11-20 08:46:55 +00:00
template:
2020-01-12 00:00:39 +00:00
src: "{{ item.src }}"
dest: "{{ item.dest }}"
2019-11-20 08:46:55 +00:00
with_items:
2020-01-16 23:09:53 +00:00
- { src: 'roles/nginx/templates/server.conf.j2', dest: '/etc/nginx/server.conf' }
- { src: 'roles/nginx/templates/nginx.conf.j2', dest: '/etc/nginx/nginx.conf' }
- { src: 'roles/nginx/templates/ports.conf.j2', dest: '/etc/{{ apache_service }}/ports.conf' }
2020-01-25 20:03:01 +00:00
# php stem extension is installed in role httpd
# here it is linked to php-fpm
- name: Create softlink 20-stem.ini to /etc/php/{{ php_version }}/mods-available/stem.ini
file:
src: "/etc/php/{{ php_version }}/mods-available/stem.ini"
path: "/etc/php/{{ php_version }}/fpm/conf.d/20-stem.ini"
state: link
when: nginx_enabled
- name: Restart php{{ php_version }}-fpm service
service:
name: "php{{ php_version }}-fpm"
state: restarted
when: nginx_enabled
2020-01-30 09:00:00 +00:00
# RECORD NGINX AS INSTALLED
- name: "Set 'nginx_installed: True'"
set_fact:
nginx_installed: True
- name: "Add 'nginx_installed: True' to {{ iiab_state_file }}"
lineinfile:
dest: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
regexp: '^nginx_installed'
line: 'nginx_installed: True'