ansible-role-nginx/tasks/plus/setup-license.yml
2020-09-19 17:32:17 +02:00

43 lines
1.1 KiB
YAML

---
- name: (Debian/Red Hat/SLES OSs) Set up NGINX Plus license
block:
- name: (Debian/Red Hat/SLES OSs) Create SSL directory
file:
path: /etc/ssl/nginx
state: directory
mode: 0755
- name: (Debian/Red Hat/SLES OSs) Copy NGINX Plus certificate and license key
copy:
src: "{{ item }}"
dest: /etc/ssl/nginx
decrypt: yes
mode: 0444
loop:
- "{{ nginx_license['certificate'] }}"
- "{{ nginx_license['key'] }}"
when: ansible_facts['os_family'] != "Alpine"
- name: (Alpine Linux) Set up NGINX Plus license
block:
- name: (Alpine Linux) Create APK directory
file:
path: /etc/apk
state: directory
mode: 0755
- name: (Alpine Linux) Copy NGINX Plus key
copy:
src: "{{ nginx_license['key'] }}"
dest: /etc/apk/cert.key
decrypt: yes
mode: 0444
- name: (Alpine Linux) Copy NGINX Plus certificate
copy:
src: "{{ nginx_license['certificate'] }}"
dest: /etc/apk/cert.pem
decrypt: yes
mode: 0444
when: ansible_facts['os_family'] == "Alpine"