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

32 lines
1.7 KiB
YAML
Raw Normal View History

2018-01-10 23:40:01 +01:00
---
- name: (Debian/Ubuntu) {{ nginx_license_status is defined | ternary('Remove', 'Configure') }} NGINX Plus license verification
blockinfile:
path: /etc/apt/apt.conf.d/90nginx
create: true
block: |
2021-05-04 20:14:51 +02:00
Acquire::https::{{ (nginx_repository | default(nginx_plus_default_repository_debian)) | regex_search('(?<=https://)[^/]*') }}::Verify-Peer "true";
Acquire::https::{{ (nginx_repository | default(nginx_plus_default_repository_debian)) | regex_search('(?<=https://)[^/]*') }}::Verify-Host "true";
Acquire::https::{{ (nginx_repository | default(nginx_plus_default_repository_debian)) | regex_search('(?<=https://)[^/]*') }}::SslCert "/etc/ssl/nginx/nginx-repo.crt";
Acquire::https::{{ (nginx_repository | default(nginx_plus_default_repository_debian)) | regex_search('(?<=https://)[^/]*') }}::SslKey "/etc/ssl/nginx/nginx-repo.key";
state: "{{ nginx_license_status | default((nginx_setup == 'uninstall') | ternary('absent', 'present')) }}"
mode: 0444
2018-01-10 23:40:01 +01:00
- 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: false
state: "{{ nginx_license_status | default((nginx_setup == 'uninstall') | ternary('absent', 'present')) }}"
mode: 0644
when: nginx_manage_repo | bool
2020-09-15 21:27:06 +02:00
- name: (Debian/Ubuntu) {{ nginx_setup | capitalize }} NGINX Plus
2020-09-15 21:27:06 +02:00
apt:
name: "nginx-plus{{ nginx_version | default('') }}"
state: "{{ nginx_state }}"
update_cache: true
2021-12-09 21:40:57 +01:00
allow_downgrade: 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