2016-01-12 00:20:42 +07:00
|
|
|
---
|
|
|
|
|
2017-04-25 17:27:08 +07:00
|
|
|
- name: SET_FACT | Backward compatibility (nginx_vhosts)
|
|
|
|
set_fact:
|
|
|
|
nginx_sites: "{{ nginx_vhosts }}"
|
|
|
|
when: nginx_vhosts is defined
|
|
|
|
|
|
|
|
- name: SET_FACT | Backward compatibility (nginx_default_vhost_ssl)
|
|
|
|
set_fact:
|
|
|
|
nginx_default_site_ssl: "{{ nginx_default_vhost_ssl }}"
|
|
|
|
when: nginx_default_vhost_ssl is defined
|
|
|
|
|
|
|
|
- name: SET_FACT | Backward compatibility (nginx_default_vhost)
|
|
|
|
set_fact:
|
|
|
|
nginx_default_site: "{{ nginx_default_vhost }}"
|
|
|
|
when: nginx_default_vhost is defined
|
|
|
|
|
2016-01-12 00:20:42 +07:00
|
|
|
- name: SHELL | Get Nginx version
|
|
|
|
shell: nginx -v 2>&1 | sed -r 's#.*/##;' | cut -d ' ' -f 1
|
2016-03-09 01:37:39 +07:00
|
|
|
args:
|
|
|
|
executable: /bin/sh
|
2016-01-12 00:20:42 +07:00
|
|
|
register: nginx_version
|
|
|
|
changed_when: false
|
2017-06-01 16:38:22 +07:00
|
|
|
check_mode: no
|
2016-01-12 00:20:42 +07:00
|
|
|
|
2016-01-12 21:10:43 +07:00
|
|
|
- name: SHELL | Get module list
|
2016-10-12 23:13:59 +07:00
|
|
|
shell: nginx -V 2>&1 | tr -- - '\n' | grep -A 1 with | grep _module | sed -r 's/_module//g; s/\s+//g' | sort
|
2016-03-09 01:37:39 +07:00
|
|
|
args:
|
|
|
|
executable: /bin/sh
|
|
|
|
register: shell_modules
|
2016-01-12 21:10:43 +07:00
|
|
|
changed_when: false
|
2017-06-01 16:38:22 +07:00
|
|
|
check_mode: no
|
2016-01-12 21:10:43 +07:00
|
|
|
|
2016-03-09 01:37:39 +07:00
|
|
|
- name: SET_FACT | Save modules
|
|
|
|
set_fact:
|
|
|
|
nginx_modules: "{{ shell_modules.stdout_lines }}"
|
|
|
|
|
2016-01-12 00:20:42 +07:00
|
|
|
- name: FILE | Create folders
|
2016-11-25 17:33:20 +07:00
|
|
|
file: dest="{{ item.dir }}" owner="{{ item.owner }}" mode="{{ item.mode }}" state=directory
|
2016-01-12 00:20:42 +07:00
|
|
|
with_items: "{{ nginx_dirs }}"
|
|
|
|
|
2016-11-29 20:32:27 +07:00
|
|
|
- name: FILE | Create ansible facts dir
|
|
|
|
file: path=/etc/ansible/facts.d state=directory
|