public-health-ch/ansible/roles/nginxinc.nginx/tasks/plus/install-debian.yml

30 lines
1.2 KiB
YAML
Raw Normal View History

2020-05-15 22:14:14 +00:00
---
2021-02-20 14:00:27 +00:00
- name: (Debian/Ubuntu) {{ nginx_license_status is defined | ternary('Remove', 'Configure') }} NGINX Plus license verification
2020-05-15 22:14:14 +00:00
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') }}"
2021-02-20 14:00:27 +00:00
mode: 0444
- name: (Debian/Ubuntu) {{ nginx_license_status is defined | ternary('Remove', 'Configure') }} NGINX Plus repository
apt_repository:
filename: nginx-plus
repo: "{{ nginx_repository | default(nginx_plus_default_repository_debian) }}"
update_cache: no
state: "{{ nginx_license_status | default ('present') }}"
mode: 0644
2020-05-15 22:14:14 +00:00
2021-02-20 14:00:27 +00:00
- name: (Debian/Ubuntu) Install NGINX Plus
2020-05-15 22:14:14 +00:00
apt:
2021-02-20 14:00:27 +00:00
name: "nginx-plus{{ nginx_version | default('') }}"
state: "{{ nginx_state }}"
2020-05-15 22:14:14 +00:00
update_cache: yes
2021-02-20 14:00:27 +00:00
ignore_errors: "{{ ansible_check_mode }}"
when: nginx_license_status is not defined
notify: (Handler) Run NGINX