mirror of
https://github.com/HanXHX/ansible-nginx.git
synced 2026-03-08 10:02:10 +07:00
Install modules on Debian 9+ or 8 with backports
This commit is contained in:
@@ -27,20 +27,14 @@
|
||||
state: present
|
||||
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
|
||||
apt:
|
||||
pkg: "{{ item }}"
|
||||
state: present
|
||||
with_items: "{{ nginx_module_packages }}"
|
||||
when: "{{ nginx_version.stdout | version_compare('1.9.11', 'ge')"
|
||||
when:
|
||||
ansible_distribution_major_version | version_compare('9', 'ge') or
|
||||
nginx_backports
|
||||
|
||||
- name: APT | Install python-passlib
|
||||
apt:
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
---
|
||||
|
||||
- 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
|
||||
shell: nginx -V 2>&1 | tr -- - '\n' | grep -A 1 with | grep _module | sed -r 's/_module//g; s/\s+//g' | sort
|
||||
args:
|
||||
|
||||
Reference in New Issue
Block a user