nginx: Update nginx dnf module to 1.26
This commit is contained in:
parent
40e834144f
commit
171802608d
1 changed files with 21 additions and 5 deletions
|
@ -2,20 +2,36 @@
|
||||||
- name: Include OS-specific variables
|
- name: Include OS-specific variables
|
||||||
ansible.builtin.include_vars: "{{ ansible_os_family }}.yml"
|
ansible.builtin.include_vars: "{{ ansible_os_family }}.yml"
|
||||||
|
|
||||||
- name: Enable nginx:124 module
|
- name: Check if correct nginx dnf module is enabled
|
||||||
|
ansible.builtin.command:
|
||||||
|
argv:
|
||||||
|
- grep
|
||||||
|
- -E
|
||||||
|
- "^stream=1.26"
|
||||||
|
- /etc/dnf/modules.d/nginx.module
|
||||||
|
changed_when: false
|
||||||
|
check_mode: false
|
||||||
|
failed_when: result.rc not in [0, 1, 2]
|
||||||
|
register: result
|
||||||
|
when:
|
||||||
|
- ansible_os_family == "RedHat"
|
||||||
|
- ansible_distribution_major_version | int == 9
|
||||||
|
- ansible_distribution != "Fedora"
|
||||||
|
|
||||||
|
- name: Enable nginx:1.26 module
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
argv:
|
argv:
|
||||||
- dnf
|
- dnf
|
||||||
- module
|
- module
|
||||||
- -y
|
- -y
|
||||||
- enable
|
- switch-to
|
||||||
- nginx:1.24
|
- nginx:1.26
|
||||||
creates: /etc/dnf/modules.d/nginx.module
|
|
||||||
notify: Restart nginx
|
notify: Restart nginx
|
||||||
when:
|
when:
|
||||||
- ansible_os_family == "RedHat"
|
- ansible_os_family == "RedHat"
|
||||||
- ansible_distribution_major_version | int >= 9
|
- ansible_distribution_major_version | int == 9
|
||||||
- ansible_distribution != "Fedora"
|
- ansible_distribution != "Fedora"
|
||||||
|
- result.rc != 0
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue