Check nginx_version before install modules
parent
d3d9b5c296
commit
4ca8f9e319
|
@ -27,11 +27,20 @@
|
||||||
state: present
|
state: present
|
||||||
default_release: "{{ ansible_distribution_release + '-backports' if nginx_backports else ansible_distribution_release }}"
|
default_release: "{{ ansible_distribution_release + '-backports' if nginx_backports else ansible_distribution_release }}"
|
||||||
|
|
||||||
|
- name: SHELL | Get Nginx version
|
||||||
|
shell: nginx -v 2>&1 | sed -r 's#.*/##;' | cut -d ' ' -f 1
|
||||||
|
args:
|
||||||
|
executable: /bin/sh
|
||||||
|
register: nginx_version
|
||||||
|
changed_when: false
|
||||||
|
check_mode: no
|
||||||
|
|
||||||
- name: APT | Install nginx modules
|
- name: APT | Install nginx modules
|
||||||
apt:
|
apt:
|
||||||
pkg: "{{ item }}"
|
pkg: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
with_items: "{{ nginx_module_packages }}"
|
with_items: "{{ nginx_module_packages }}"
|
||||||
|
when: "{{ nginx_version.stdout | version_compare('1.9.11', 'ge')"
|
||||||
|
|
||||||
- name: APT | Install python-passlib
|
- name: APT | Install python-passlib
|
||||||
apt:
|
apt:
|
||||||
|
|
|
@ -1,13 +1,5 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: SHELL | Get Nginx version
|
|
||||||
shell: nginx -v 2>&1 | sed -r 's#.*/##;' | cut -d ' ' -f 1
|
|
||||||
args:
|
|
||||||
executable: /bin/sh
|
|
||||||
register: nginx_version
|
|
||||||
changed_when: false
|
|
||||||
check_mode: no
|
|
||||||
|
|
||||||
- name: SHELL | Get module list
|
- name: SHELL | Get module list
|
||||||
shell: nginx -V 2>&1 | tr -- - '\n' | grep -A 1 with | grep _module | sed -r 's/_module//g; s/\s+//g' | sort
|
shell: nginx -V 2>&1 | tr -- - '\n' | grep -A 1 with | grep _module | sed -r 's/_module//g; s/\s+//g' | sort
|
||||||
args:
|
args:
|
||||||
|
|
Loading…
Reference in New Issue