|
| 1 | +--- |
| 2 | +- hosts: all |
| 3 | + collections: |
| 4 | + - nginxinc.nginx_core |
| 5 | + roles: |
| 6 | + - role: nginx |
| 7 | + vars: |
| 8 | + nginx_type: plus |
| 9 | + nginx_license: |
| 10 | + certificate: <path/to/certificate> |
| 11 | + key: <path/to/key> |
| 12 | + nginx_remove_license: false |
| 13 | + - role: nginx_app_protect |
| 14 | + vars: |
| 15 | + nginx_app_protect_setup_license: false |
| 16 | + nginx_app_protect_remove_license: false |
| 17 | + nginx_app_protect_install_signatures: true |
| 18 | + nginx_app_protect_install_threat_campaigns: true |
| 19 | + nginx_app_protect_configure: true |
| 20 | + nginx_app_protect_security_policy_template_enable: true |
| 21 | + nginx_app_protect_security_policy_enforcement_mode: blocking |
| 22 | + nginx_app_protect_log_policy_template_enable: true |
| 23 | + nginx_app_protect_log_policy_filter_request_type: all |
| 24 | + nginx_app_protect_conf_template_enable: false |
| 25 | + - role: nginx_config |
| 26 | + vars: |
| 27 | + nginx_config_modules: |
| 28 | + - modules/ngx_http_app_protect_module.so |
| 29 | + nginx_config_http_template_enable: true |
| 30 | + nginx_config_http_template: |
| 31 | + app: |
| 32 | + template_file: http/default.conf.j2 |
| 33 | + conf_file_name: default.conf |
| 34 | + conf_file_location: /etc/nginx/conf.d/ |
| 35 | + servers: |
| 36 | + main: |
| 37 | + app_protect: |
| 38 | + enable: true |
| 39 | + policy_file: /etc/nginx/app-protect-security-policy.json |
| 40 | + security_log_enable: true |
| 41 | + security_log: |
| 42 | + path: /etc/nginx/app-protect-log-policy.json |
| 43 | + dest: /var/log/app_protect/security.log |
| 44 | + listen: |
| 45 | + listen_localhost: |
| 46 | + port: 80 |
| 47 | + server_name: localhost |
| 48 | + access_log: |
| 49 | + - name: main |
| 50 | + location: /var/log/nginx/access.log |
| 51 | + reverse_proxy: |
| 52 | + locations: |
| 53 | + main: |
| 54 | + location: / |
| 55 | + proxy_pass: http://upstr/ |
| 56 | + proxy_set_header: |
| 57 | + header_host: |
| 58 | + name: Host |
| 59 | + value: $host |
| 60 | + server_one: |
| 61 | + listen: |
| 62 | + listen_server_one: |
| 63 | + port: 8081 |
| 64 | + server_name: localhost |
| 65 | + access_log: |
| 66 | + - name: main |
| 67 | + location: /var/log/nginx/access.log |
| 68 | + web_server: |
| 69 | + locations: |
| 70 | + server_one: |
| 71 | + location: / |
| 72 | + html_file_location: /usr/share/nginx/html |
| 73 | + html_file_name: server_one.html |
| 74 | + sub_filter: |
| 75 | + once: false |
| 76 | + sub_filters: |
| 77 | + - "'server_hostname' '$hostname'" |
| 78 | + - "'server_address' '$server_addr:$server_port'" |
| 79 | + - "'server_url' '$request_uri'" |
| 80 | + - "'remote_addr' '$remote_addr:$remote_port'" |
| 81 | + - "'server_date' '$time_local'" |
| 82 | + - "'client_browser' '$http_user_agent'" |
| 83 | + - "'request_id' '$request_id'" |
| 84 | + - "'nginx_version' '$nginx_version'" |
| 85 | + - "'document_root' '$document_root'" |
| 86 | + - "'proxied_for_ip' '$http_x_forwarded_for'" |
| 87 | + server_two: |
| 88 | + listen: |
| 89 | + listen_server_two: |
| 90 | + port: 8082 |
| 91 | + server_name: localhost |
| 92 | + access_log: |
| 93 | + - name: main |
| 94 | + location: /var/log/nginx/access.log |
| 95 | + web_server: |
| 96 | + locations: |
| 97 | + server_two: |
| 98 | + location: / |
| 99 | + html_file_location: /usr/share/nginx/html |
| 100 | + html_file_name: server_two.html |
| 101 | + sub_filter: |
| 102 | + once: false |
| 103 | + sub_filters: |
| 104 | + - "'server_hostname' '$hostname'" |
| 105 | + - "'server_address' '$server_addr:$server_port'" |
| 106 | + - "'server_url' '$request_uri'" |
| 107 | + - "'remote_addr' '$remote_addr:$remote_port'" |
| 108 | + - "'server_date' '$time_local'" |
| 109 | + - "'client_browser' '$http_user_agent'" |
| 110 | + - "'request_id' '$request_id'" |
| 111 | + - "'nginx_version' '$nginx_version'" |
| 112 | + - "'document_root' '$document_root'" |
| 113 | + - "'proxied_for_ip' '$http_x_forwarded_for'" |
| 114 | + upstreams: |
| 115 | + main: |
| 116 | + name: upstr |
| 117 | + lb_method: least_conn |
| 118 | + servers: |
| 119 | + server_one: |
| 120 | + address: 0.0.0.0 |
| 121 | + port: 8081 |
| 122 | + server_two: |
| 123 | + address: 0.0.0.0 |
| 124 | + port: 8082 |
| 125 | + |
| 126 | + nginx_config_html_demo_template_enable: true |
| 127 | + nginx_config_html_demo_template: |
| 128 | + server_one: |
| 129 | + template_file: www/index.html.j2 |
| 130 | + html_file_name: server_one.html |
| 131 | + html_file_location: /usr/share/nginx/html |
| 132 | + web_server_name: Ansible NGINX collection - Server one |
| 133 | + server_two: |
| 134 | + template_file: www/index.html.j2 |
| 135 | + html_file_name: server_two.html |
| 136 | + html_file_location: /usr/share/nginx/html |
| 137 | + web_server_name: Ansible NGINX collection - Server two |
0 commit comments