ansible-nginx/tasks/dyn_modules.yml

27 lines
771 B
YAML
Raw Normal View History

2016-10-12 23:13:59 +07:00
---
- name: FAIL | If Dynamic module is not available
2017-07-27 17:01:59 +07:00
fail:
msg: "{{ item }} dynamic module is not available"
2016-10-12 23:13:59 +07:00
with_items: "{{ nginx_dyn_modules }}"
2017-07-27 17:01:59 +07:00
when: item + '=dynamic' not in nginx_modules
2016-10-12 23:13:59 +07:00
- name: APT | Install nginx modules
2017-10-03 22:57:35 +07:00
apt:
pkg: "libnginx-mod-{{ item | replace('_', '-') }}"
state: present
default_release: "{{ ansible_distribution_release + '-backports' if nginx_backports else ansible_distribution_release }}"
2016-10-12 23:13:59 +07:00
with_items: "{{ nginx_dyn_modules }}"
when: ansible_distribution == 'Debian'
- name: FILE | Creates modules directories
2017-10-03 22:57:35 +07:00
file:
path: "{{ nginx_etc_dir}}/{{ item }}"
state: directory
mode: 0755
owner: root
group: root
with_items: ['modules-available', 'modules-enabled']
2016-10-12 23:13:59 +07:00
# TODO: manage freebsd