|
21 | 21 | msg: "supported_os {{ supported_os }}"
|
22 | 22 | verbosity: 2
|
23 | 23 |
|
| 24 | +- name: Debug app_protect_state |
| 25 | + debug: |
| 26 | + msg: "app_protect_state {{ app_protect_state }}" |
| 27 | + |
24 | 28 | - name: Abort if the OS/version combination is not supported
|
25 | 29 | fail:
|
26 | 30 | msg: "NGINX App Protect is not supported on os family {{ ansible_distribution }} version {{ ansible_distribution_version }}"
|
27 | 31 | when: not supported_os
|
28 | 32 |
|
29 |
| -- include_tasks: prerequisites/install-prerequisites.yml |
30 |
| - tags: nginx_prerequisites |
31 |
| - |
32 |
| -- import_tasks: keys/apt-key.yml |
33 |
| - when: |
34 |
| - - ansible_os_family == "Debian" |
35 |
| - - app_protect_install_signatures |
36 |
| - tags: nginx_aptkey |
37 |
| - |
38 |
| -- import_tasks: keys/rpm-key.yml |
39 |
| - when: |
40 |
| - - ansible_os_family == "RedHat" |
41 |
| - - app_protect_install_signatures |
42 |
| - tags: nginx_rpmkey |
43 |
| - |
44 |
| -- name: "(All OSs) Setup license" |
45 |
| - include_tasks: setup-license.yml |
46 |
| - when: app_protect_enable or app_protect_install_signatures |
47 |
| - |
48 |
| -- name: "NGINX App Protect" |
49 |
| - include_tasks: install-app-protect.yml |
50 |
| - when: supported_os and app_protect_enable |
51 |
| - |
52 |
| -- name: "NGINX App Protect Signatures" |
53 |
| - include_tasks: install-signatures.yml |
54 |
| - when: supported_os and app_protect_install_signatures |
55 |
| - |
56 |
| -- name: "Remove license" |
57 |
| - include_tasks: delete-license.yml |
58 |
| - when: |
59 |
| - - app_protect_delete_license |
60 |
| - tags: app_protect_delete_license |
61 |
| - |
62 |
| -- name: "Configure NGINX Plus App Protect" |
63 |
| - include_tasks: configure-app-protect.yml |
64 |
| - when: supported_os and app_protect_configure |
| 33 | + |
| 34 | +- name: "Install NGINX App Protect" |
| 35 | + block: |
| 36 | + |
| 37 | + - include_tasks: prerequisites/install-prerequisites.yml |
| 38 | + tags: nginx_prerequisites |
| 39 | + |
| 40 | + - import_tasks: keys/apt-key.yml |
| 41 | + when: |
| 42 | + - ansible_os_family == "Debian" |
| 43 | + - app_protect_install_signatures |
| 44 | + tags: nginx_aptkey |
| 45 | + |
| 46 | + - import_tasks: keys/rpm-key.yml |
| 47 | + when: |
| 48 | + - ansible_os_family == "RedHat" |
| 49 | + - app_protect_install_signatures |
| 50 | + tags: nginx_rpmkey |
| 51 | + |
| 52 | + - name: "(All OSs) Setup license" |
| 53 | + import_tasks: setup-license.yml |
| 54 | + when: app_protect_install_signatures |
| 55 | + |
| 56 | + - name: "Install NGINX App Protect" |
| 57 | + import_tasks: install-app-protect.yml |
| 58 | + |
| 59 | + - name: "NGINX App Protect Signatures" |
| 60 | + import_tasks: install-signatures.yml |
| 61 | + when: app_protect_install_signatures |
| 62 | + |
| 63 | + - name: "Remove license" |
| 64 | + import_tasks: delete-license.yml |
| 65 | + when: |
| 66 | + - app_protect_delete_license |
| 67 | + tags: app_protect_delete_license |
| 68 | + |
| 69 | + - name: "Configure NGINX App Protect" |
| 70 | + import_tasks: configure-app-protect.yml |
| 71 | + when: |
| 72 | + - supported_os |
| 73 | + - app_protect_configure |
| 74 | + |
| 75 | + when: app_protect_state != absent |
| 76 | + |
| 77 | +- name: "Remove NGINX App Protect" |
| 78 | + block: |
| 79 | + |
| 80 | + - name: "Remove NGINX App Protect" |
| 81 | + import_tasks: install-app-protect.yml |
| 82 | + |
| 83 | + when: app_protect_state == absent |
0 commit comments