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
|
||||
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:
|
||||
argv:
|
||||
- dnf
|
||||
- module
|
||||
- -y
|
||||
- enable
|
||||
- nginx:1.24
|
||||
creates: /etc/dnf/modules.d/nginx.module
|
||||
- switch-to
|
||||
- nginx:1.26
|
||||
notify: Restart nginx
|
||||
when:
|
||||
- ansible_os_family == "RedHat"
|
||||
- ansible_distribution_major_version | int >= 9
|
||||
- ansible_distribution_major_version | int == 9
|
||||
- ansible_distribution != "Fedora"
|
||||
- result.rc != 0
|
||||
|
||||
- name: Install packages
|
||||
ansible.builtin.package:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue