ansible-role-nginx/tasks/plus/install-redhat.yml

25 lines
1.2 KiB
YAML
Raw Normal View History

2020-09-15 21:27:06 +02:00
---
- name: (Amazon Linux/CentOS/Oracle Linux/RHEL) {{ (nginx_license_status is defined or nginx_setup == 'uninstall') | ternary('Remove', 'Configure') }} NGINX Plus repository
ansible.builtin.yum_repository:
2020-09-15 21:27:06 +02:00
name: nginx-plus
baseurl: "{{ nginx_repository |
default(lookup('vars', 'nginx_plus_default_repository_' + ((ansible_facts['distribution'] == 'Amazon') | ternary('amazon', 'redhat')))) }}"
2020-09-15 21:27:06 +02:00
description: NGINX Plus Repository
sslclientcert: /etc/ssl/nginx/nginx-repo.crt
sslclientkey: /etc/ssl/nginx/nginx-repo.key
enabled: true
gpgcheck: true
state: "{{ nginx_license_status | default((nginx_setup == 'uninstall') | ternary('absent', 'present')) }}"
2020-09-15 21:27:06 +02:00
mode: 0644
when: nginx_manage_repo | bool
2020-09-15 21:27:06 +02:00
- name: (Amazon Linux/CentOS/Oracle Linux/RHEL) {{ nginx_setup | capitalize }} NGINX Plus
ansible.builtin.yum:
2020-09-15 21:27:06 +02:00
name: "nginx-plus{{ nginx_version | default('') }}"
state: "{{ nginx_state }}"
update_cache: true
allow_downgrade: "{{ omit if ansible_version.full is version('2.12', '<') else true }}"
ignore_errors: "{{ ansible_check_mode }}"
when: nginx_license_status is not defined
2020-09-19 17:32:17 +02:00
notify: (Handler) Run NGINX