ansible-role-nginx/tasks/plus/setup-debian.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

23 lines
899 B
YAML

---
- name: "(Setup: Debian/Ubuntu) Setup NGINX Plus Repository"
apt_repository:
repo: deb https://plus-pkgs.nginx.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} nginx-plus
filename: nginx-plus
update_cache: no
state: "{{ nginx_license_status | default ('present') }}"
- name: "(Setup: Debian/Ubuntu) Setup NGINX Plus License"
blockinfile:
path: /etc/apt/apt.conf.d/90nginx
create: yes
block: |
Acquire::https::plus-pkgs.nginx.com::Verify-Peer "true";
Acquire::https::plus-pkgs.nginx.com::Verify-Host "true";
Acquire::https::plus-pkgs.nginx.com::SslCert "/etc/ssl/nginx/nginx-repo.crt";
Acquire::https::plus-pkgs.nginx.com::SslKey "/etc/ssl/nginx/nginx-repo.key";
state: "{{ nginx_license_status | default ('present') }}"
- name: "(Setup: Debian/Ubuntu) Update APT Cache"
apt:
update_cache: yes