Skip to content

Commit ab71f7d

Browse files
committed
bug fixes and adding addl vars
1 parent 36a96a3 commit ab71f7d

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ security_policy_enforcement_mode: transparent
4141
log_policy_filter_request_type: all
4242

4343
log_policy_syslog_target: 127.0.0.1:514
44+
nginx_demo_workload: http://10.1.1.1:8080

handlers/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616

1717
when:
1818
- nginx_start | bool
19-
- not ansible_check_mode
19+
- not ansible_check_mode

tasks/install-app-protect-linux.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
that:
3737
- nginx_plus_version is defined
3838
- nginx_plus_version | int >= 18
39-
fail_msg: "'nginx_plus_version' release version must be a minimum of 18 for App Protect. Actual: {{ nginx_plus_version }}"
40-
success_msg: "'nginx_plus_version' is {{ nginx_plus_version }}"
39+
fail_msg: "'nginx_plus_version' release version must be a minimum of 18 for App Protect. Actual: {{ (nginx_plus_version is defined) | ternary(nginx_plus_version, 'NONE') }}"
40+
success_msg: "'nginx_plus_version' is {{ (nginx_plus_version is defined) | ternary(nginx_plus_version, 'NONE') }}"
4141
quiet: true
4242

4343
- name: Fail if app protect zip doesn't not match detected NGINX+ version
@@ -62,8 +62,8 @@
6262
- name: Unarchive the App Protect package file that is already on the remote machine
6363
unarchive:
6464
src: "{{ install_zip }}"
65-
dest: "{{ tmp_dir }}"
66-
remote_src: yes
65+
dest: "{{ tmp_dir }}/"
66+
remote_src: true
6767

6868
- name: Display paths of all .rpm files in dir; exclude NGINX+ installer
6969
find:
@@ -94,6 +94,21 @@
9494
selinux:
9595
state: disabled
9696

97+
- name: "Start NGINX App Protect"
98+
service:
99+
name: nginx-app-protect
100+
state: started
101+
enabled: yes
102+
when:
103+
- not ansible_check_mode
104+
105+
- name: "Start NGINX"
106+
service:
107+
name: nginx
108+
state: reloaded
109+
when:
110+
- not ansible_check_mode
111+
97112
- name: Recursively remove extracted directory
98113
file:
99114
path: "{{ tmp_dir }}"

templates/nginx.conf.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ http {
1616
keepalive_timeout 65;
1717

1818
server {
19-
listen 8080;
19+
listen 80;
2020
server_name localhost;
2121
proxy_http_version 1.1;
2222

@@ -28,7 +28,7 @@ http {
2828
location / {
2929
client_max_body_size 0;
3030
default_type text/html;
31-
proxy_pass http://10.1.1.8:8080$request_uri;
31+
proxy_pass {{ nginx_demo_workload }}$request_uri;
3232
}
3333
}
3434
}

0 commit comments

Comments
 (0)