2018-01-10 23:40:01 +01:00
|
|
|
---
|
2020-09-19 17:32:17 +02:00
|
|
|
- name: (Debian/Red Hat/SLES OSs) Set up NGINX Plus license
|
2019-05-20 18:32:08 +02:00
|
|
|
block:
|
2020-09-19 17:32:17 +02:00
|
|
|
- name: (Debian/Red Hat/SLES OSs) Create SSL directory
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.file:
|
2019-05-20 18:32:08 +02:00
|
|
|
path: /etc/ssl/nginx
|
|
|
|
state: directory
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0755
|
2019-05-20 18:32:08 +02:00
|
|
|
|
2020-09-19 17:32:17 +02:00
|
|
|
- name: (Debian/Red Hat/SLES OSs) Copy NGINX Plus certificate and license key
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.copy:
|
2019-05-20 18:32:08 +02:00
|
|
|
src: "{{ item }}"
|
|
|
|
dest: /etc/ssl/nginx
|
2021-06-02 17:47:44 +02:00
|
|
|
decrypt: true
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0444
|
2020-07-08 14:55:15 +02:00
|
|
|
loop:
|
2020-09-17 17:00:27 +02:00
|
|
|
- "{{ nginx_license['certificate'] }}"
|
|
|
|
- "{{ nginx_license['key'] }}"
|
2020-09-15 21:27:06 +02:00
|
|
|
when: ansible_facts['os_family'] != "Alpine"
|
2019-05-20 18:32:08 +02:00
|
|
|
|
2020-09-19 17:32:17 +02:00
|
|
|
- name: (Alpine Linux) Set up NGINX Plus license
|
2019-05-20 18:32:08 +02:00
|
|
|
block:
|
2020-09-19 17:32:17 +02:00
|
|
|
- name: (Alpine Linux) Create APK directory
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.file:
|
2019-05-20 18:32:08 +02:00
|
|
|
path: /etc/apk
|
|
|
|
state: directory
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0755
|
2019-05-20 18:32:08 +02:00
|
|
|
|
2020-09-19 17:32:17 +02:00
|
|
|
- name: (Alpine Linux) Copy NGINX Plus key
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.copy:
|
2020-09-17 17:00:27 +02:00
|
|
|
src: "{{ nginx_license['key'] }}"
|
2019-05-20 18:32:08 +02:00
|
|
|
dest: /etc/apk/cert.key
|
2021-06-02 17:47:44 +02:00
|
|
|
decrypt: true
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0444
|
2019-05-20 18:32:08 +02:00
|
|
|
|
2020-09-19 17:32:17 +02:00
|
|
|
- name: (Alpine Linux) Copy NGINX Plus certificate
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.copy:
|
2020-09-17 17:00:27 +02:00
|
|
|
src: "{{ nginx_license['certificate'] }}"
|
2019-05-20 18:32:08 +02:00
|
|
|
dest: /etc/apk/cert.pem
|
2021-06-02 17:47:44 +02:00
|
|
|
decrypt: true
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0444
|
2020-09-15 21:27:06 +02:00
|
|
|
when: ansible_facts['os_family'] == "Alpine"
|
2021-12-07 02:47:13 +01:00
|
|
|
|
|
|
|
- name: (SLES) Combine NGINX Plus certificate and license key
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.assemble:
|
2021-12-07 02:47:13 +01:00
|
|
|
src: /etc/ssl/nginx
|
|
|
|
dest: /etc/ssl/nginx/nginx-repo-bundle.crt
|
|
|
|
mode: 0444
|
|
|
|
when: ansible_facts['os_family'] == "Suse"
|