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
|
|
|
|
|
2016-01-12 21:10:43 +07:00
|
|
|
- name: SHELL | Get module list
|
2016-03-09 01:37:39 +07:00
|
|
|
shell: nginx -V 2>&1 | tr -- - '\n' | grep -A 1 with | grep _module | sed 's/_module[[:space:]]*//g' | sort
|
|
|
|
args:
|
|
|
|
executable: /bin/sh
|
|
|
|
register: shell_modules
|
2016-01-12 21:10:43 +07:00
|
|
|
changed_when: false
|
|
|
|
|
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
|
|
|
|
file: dest={{ item }} owner=root mode=0755 state=directory
|
|
|
|
with_items: "{{ nginx_dirs }}"
|
|
|
|
|