ansible-role-nginx/tasks/plus/setup-license.yml
Alessandro Fael Garcia 903693e67f
Refactor handlers (#321)
2020-09-17 17:00:27 +02:00

53 lines
1.4 KiB
YAML

---
- name: "Set up NGINX Plus license"
debug:
msg: "Setting up NGINX Plus license"
when: nginx_debug_tasks | bool
- 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"
- name: "Set up NGINX Plus license"
debug:
msg: "Done setting up NGINX Plus license"
when: nginx_debug_tasks | bool