-
Notifications
You must be signed in to change notification settings - Fork 356
/
Copy pathinstall-redhat.yml
27 lines (25 loc) · 1.1 KB
/
install-redhat.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---
- name: (AlmaLinux/Amazon Linux/Oracle Linux/RHEL/Rocky Linux) {{ (nginx_setup == 'uninstall') | ternary('Remove', 'Configure') }} NGINX repository
ansible.builtin.yum_repository:
name: nginx
baseurl: "{{ nginx_repository | default(lookup('vars', 'nginx_default_repository_' + ((ansible_facts['distribution'] == 'Amazon') | ternary('amazon', 'redhat')))) }}"
description: NGINX Repository
enabled: true
gpgcheck: true
mode: "0644"
module_hotfixes: true
priority: 9
state: "{{ (nginx_state == 'uninstall') | ternary('absent', 'present') }}"
when: nginx_manage_repo | bool
- name: (AlmaLinux/Amazon Linux/Oracle Linux/RHEL/Rocky Linux) Force Yum cache refresh
ansible.builtin.command: yum clean metadata
when: nginx_manage_repo | bool
changed_when: false
- name: (AlmaLinux/Amazon Linux/Oracle Linux/RHEL/Rocky Linux) {{ nginx_setup | capitalize }} NGINX
ansible.builtin.yum:
name: nginx{{ nginx_version | default('') }}
state: "{{ nginx_state }}"
update_cache: true
allow_downgrade: true
ignore_errors: "{{ ansible_check_mode }}"
notify: (Handler) Run NGINX