ansible-role-nginx/tasks/plus/setup-redhat.yml
Alessandro Fael Garcia 3b6c744166
Delete NGINX Plus repository when license is deleted (#204)
This fixes a bug when only the license is deleted, making system updates fail since the NGINX Plus repository is still within the repositories list yet there is no license to authenticate to the repository
2019-12-11 12:45:12 -08:00

29 lines
1.1 KiB
YAML

---
- name: "(Setup: CentOS/RedHat/Oracle Linux) Setup NGINX Plus Repository"
yum_repository:
name: nginx-plus
baseurl: >-
https://plus-pkgs.nginx.com/centos/{{ (ansible_distribution_version | float >= 7.4 and ansible_distribution_version | float < 8.0)
| ternary(ansible_distribution_major_version | int, 7.4) }}/$basearch/
description: NGINX Plus Repository
sslclientcert: /etc/ssl/nginx/nginx-repo.crt
sslclientkey: /etc/ssl/nginx/nginx-repo.key
enabled: yes
gpgcheck: yes
state: "{{ nginx_license_status | default ('present') }}"
when: ansible_distribution != "Amazon"
- name: "(Setup: Amazon Linux) Setup NGINX Plus Repository"
yum_repository:
name: nginx-plus
baseurl: >-
https://plus-pkgs.nginx.com/amzn{{ (ansible_distribution_version == "2")
| ternary('2', '') }}/$releasever/$basearch
description: NGINX Plus Repository
sslclientcert: /etc/ssl/nginx/nginx-repo.crt
sslclientkey: /etc/ssl/nginx/nginx-repo.key
enabled: yes
gpgcheck: yes
state: "{{ nginx_license_status | default ('present') }}"
when: ansible_distribution == "Amazon"