|
1 | 1 | --- |
2 | 2 | - name: (Alpine Linux) Set up NGINX App Protect WAF/DoS license |
3 | | - when: ansible_os_family == "Alpine" |
| 3 | + when: ansible_facts['os_family'] == "Alpine" |
4 | 4 | block: |
5 | 5 | - name: Install cryptography package |
6 | 6 | ansible.builtin.package: |
|
14 | 14 |
|
15 | 15 | - name: (Alpine Linux) Copy NGINX App Protect WAF/DoS certificate |
16 | 16 | ansible.builtin.copy: |
17 | | - src: "{{ nginx_app_protect_license.certificate }}" |
| 17 | + src: "{{ nginx_app_protect_license['certificate'] }}" |
18 | 18 | dest: /etc/apk/cert.pem |
19 | 19 | decrypt: true |
20 | 20 | mode: 0444 |
21 | 21 |
|
22 | 22 | - name: (Alpine Linux) Copy NGINX App Protect WAF/DoS key |
23 | 23 | ansible.builtin.copy: |
24 | | - src: "{{ nginx_app_protect_license.key }}" |
| 24 | + src: "{{ nginx_app_protect_license['key'] }}" |
25 | 25 | dest: /etc/apk/cert.key |
26 | 26 | decrypt: true |
27 | 27 | mode: 0444 |
|
45 | 45 | fail_msg: Something went wrong! Make sure your App Protect WAF/DoS license is valid! |
46 | 46 |
|
47 | 47 | - name: (Debian/Red Hat OSs) Set up NGINX App Protect WAF/DoS license |
48 | | - when: ansible_os_family != "Alpine" |
| 48 | + when: ansible_facts['os_family'] != "Alpine" |
49 | 49 | block: |
50 | 50 | - name: (Debian/Red Hat OSs) Create SSL directory |
51 | 51 | ansible.builtin.file: |
|
60 | 60 | decrypt: true |
61 | 61 | mode: 0444 |
62 | 62 | loop: |
63 | | - - "{{ nginx_app_protect_license.certificate }}" |
64 | | - - "{{ nginx_app_protect_license.key }}" |
| 63 | + - "{{ nginx_app_protect_license['certificate'] }}" |
| 64 | + - "{{ nginx_app_protect_license['key'] }}" |
65 | 65 |
|
66 | 66 | - name: (Debian/Red Hat OSs) Install cryptography package |
67 | 67 | ansible.builtin.package: |
68 | | - name: "{{ (ansible_python.version.major == 3) | ternary('python3-cryptography', 'python2-cryptography') }}" |
| 68 | + name: "{{ (ansible_python['version']['major'] == 3) | ternary('python3-cryptography', 'python2-cryptography') }}" |
69 | 69 |
|
70 | 70 | - name: (Debian/Red Hat OSs) Check that NGINX App Protect WAF/DoS certificate is valid |
71 | 71 | community.crypto.x509_certificate_info: |
|
80 | 80 | - name: (Debian/Red Hat OSs) Check that NGINX App Protect WAF/DoS license is valid |
81 | 81 | ansible.builtin.assert: |
82 | 82 | that: |
83 | | - - cert.expired == false |
84 | | - - cert.public_key == key.public_key |
| 83 | + - "{{ not cert['expired'] | bool }}" |
| 84 | + - "{{ cert['public_key'] == key['public_key'] }}" |
85 | 85 | success_msg: Your NGINX App Protect WAF/DoS license is valid! |
86 | 86 | fail_msg: Something went wrong! Make sure your NGINX App Protect WAF/DoS license is valid! |
0 commit comments