Skip to content

Commit 214cdfc

Browse files
authored
NAP 3.3 updates (#112)
1 parent ccc6620 commit 214cdfc

File tree

15 files changed

+125
-69
lines changed

15 files changed

+125
-69
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
FEATURES:
66

77
* Add support for NGINX App Protect DoS (Denial of Service) product. The `nginx_app_protect_dos_enable` variable must be set to `true` in order to install NGINX App Protect DoS.
8+
* Add support for NGINX App Protect WAF on Amazon Linux 2 (requires NGINX App Protect 3.3).
89
* Add a `nginx_app_protect_manage_repo` feature flag which can be used to disable NGINX App Protect repo management by this role.
910

1011
ENHANCEMENTS:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ The NGINX App Protect Ansible role supports all platforms supported by [NGINX Pl
6565
```yaml
6666
Alpine:
6767
- 3.10
68-
name: Amazon Linux 2
68+
Amazon Linux 2:
6969
- any
7070
CentOS:
7171
- 7.4+

molecule/Dockerfile.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN \
2525
&& dnf clean all; \
2626
elif [ $(command -v yum) ]; then \
2727
yum makecache fast \
28-
&& yum install -y bash iproute sudo /usr/bin/python /usr/bin/python2-config vim yum-plugin-ovl \
28+
&& yum install -y bash iproute sudo /usr/bin/python /usr/bin/python2-config vim yum-plugin-ovl initscripts \
2929
&& sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf \
3030
&& yum clean all; \
3131
elif [ $(command -v zypper) ]; then \

molecule/advanced/molecule.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ platforms:
3939
- nap
4040
networks:
4141
- name: molecule-test
42-
- name: ubuntu-bionic
43-
image: ubuntu:bionic
42+
- name: debian-buster
43+
image: debian:buster-slim
4444
dockerfile: ../Dockerfile.j2
4545
privileged: true
4646
volumes:
@@ -50,8 +50,8 @@ platforms:
5050
- nap
5151
networks:
5252
- name: molecule-test
53-
- name: ubuntu-focal
54-
image: ubuntu:focal
53+
- name: ubuntu-bionic
54+
image: ubuntu:bionic
5555
dockerfile: ../Dockerfile.j2
5656
privileged: true
5757
volumes:
@@ -61,8 +61,8 @@ platforms:
6161
- nap
6262
networks:
6363
- name: molecule-test
64-
- name: debian-buster
65-
image: debian:buster-slim
64+
- name: ubuntu-focal
65+
image: ubuntu:focal
6666
dockerfile: ../Dockerfile.j2
6767
privileged: true
6868
volumes:

molecule/advanced/prepare.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,6 @@
1717
force: false
1818
mode: 0444
1919

20-
- name: Install NGINX Plus on Alpine
21-
hosts: nap
22-
tasks:
23-
- name: Set up NGINX Plus on Alpine for NAP 3.2 issue workaround (remove in versions > 3.2)
24-
include_role:
25-
name: nginxinc.nginx
26-
vars:
27-
nginx_enable: true
28-
nginx_start: true
29-
nginx_type: plus
30-
nginx_remove_license: false
31-
nginx_license:
32-
certificate: ../../files/license/nginx-repo.crt
33-
key: ../../files/license/nginx-repo.key
34-
when: ansible_os_family == "Alpine"
35-
3620
- name: Set up rsyslog server for verifying NAP syslog events
3721
hosts: nap
3822
tasks:
@@ -51,3 +35,19 @@
5135
- name: Start nginx on test workload
5236
raw: nohup nginx </dev/null >/dev/null 2>&1 & sleep 1
5337
changed_when: false
38+
39+
- name: Install NGINX Plus on Alpine
40+
hosts: nap
41+
tasks:
42+
- name: Set up NGINX Plus on Alpine for NAP 3.2/3.3 issue workaround (remove in versions > 3.3)
43+
include_role:
44+
name: nginxinc.nginx
45+
vars:
46+
nginx_enable: true
47+
nginx_start: true
48+
nginx_type: plus
49+
nginx_remove_license: false
50+
nginx_license:
51+
certificate: ../../files/license/nginx-repo.crt
52+
key: ../../files/license/nginx-repo.key
53+
when: ansible_os_family == "Alpine"

molecule/default/molecule.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,43 @@ platforms:
1717
volumes:
1818
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
1919
command: "/sbin/init"
20+
- name: amazonlinux-2
21+
image: amazonlinux:2
22+
dockerfile: ../Dockerfile.j2
23+
privileged: true
24+
volumes:
25+
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
26+
command: "/usr/sbin/init"
2027
- name: centos-7
2128
image: centos:7
2229
dockerfile: ../Dockerfile.j2
2330
privileged: true
2431
volumes:
2532
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
2633
command: "/usr/sbin/init"
27-
- name: ubuntu-bionic
28-
image: ubuntu:bionic
34+
- name: debian-stretch
35+
image: debian:stretch-slim
2936
dockerfile: ../Dockerfile.j2
3037
privileged: true
3138
volumes:
3239
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
3340
command: "/sbin/init"
34-
- name: ubuntu-focal
35-
image: ubuntu:focal
41+
- name: debian-buster
42+
image: debian:buster-slim
3643
dockerfile: ../Dockerfile.j2
3744
privileged: true
3845
volumes:
3946
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
4047
command: "/sbin/init"
41-
- name: debian-stretch
42-
image: debian:stretch-slim
48+
- name: ubuntu-bionic
49+
image: ubuntu:bionic
4350
dockerfile: ../Dockerfile.j2
4451
privileged: true
4552
volumes:
4653
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
4754
command: "/sbin/init"
48-
- name: debian-buster
49-
image: debian:buster-slim
55+
- name: ubuntu-focal
56+
image: ubuntu:focal
5057
dockerfile: ../Dockerfile.j2
5158
privileged: true
5259
volumes:

molecule/default/prepare.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- name: Install NGINX Plus on Alpine
2121
hosts: all
2222
tasks:
23-
- name: Set up NGINX Plus on Alpine for NAP 3.2 issue workaround (remove in versions > 3.2)
23+
- name: Set up NGINX Plus on Alpine for NAP 3.2/3.3 issue workaround (remove in versions > 3.3)
2424
include_role:
2525
name: nginxinc.nginx
2626
vars:

molecule/default/verify.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
check_mode: true
1010
register: install
1111
failed_when: (install is changed) or (install is failed)
12-
when: ansible_os_family != "Alpine"
1312

1413
- name: Check if NGINX App Protect WAF is installed
1514
package:

molecule/specific-version/molecule.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ driver:
88
lint: |
99
set -e
1010
yamllint .
11-
ansible-lint . --force-color
11+
ansible-lint --force-color
1212
platforms:
1313
- name: alpine-3.10
1414
image: alpine:3.10
@@ -24,29 +24,29 @@ platforms:
2424
volumes:
2525
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
2626
command: "/usr/sbin/init"
27-
- name: ubuntu-bionic
28-
image: ubuntu:bionic
27+
- name: debian-stretch
28+
image: debian:stretch-slim
2929
dockerfile: ../Dockerfile.j2
3030
privileged: true
3131
volumes:
3232
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
3333
command: "/sbin/init"
34-
- name: ubuntu-focal
35-
image: ubuntu:focal
34+
- name: debian-buster
35+
image: debian:buster-slim
3636
dockerfile: ../Dockerfile.j2
3737
privileged: true
3838
volumes:
3939
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
4040
command: "/sbin/init"
41-
- name: debian-stretch
42-
image: debian:stretch-slim
41+
- name: ubuntu-bionic
42+
image: ubuntu:bionic
4343
dockerfile: ../Dockerfile.j2
4444
privileged: true
4545
volumes:
4646
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
4747
command: "/sbin/init"
48-
- name: debian-buster
49-
image: debian:buster-slim
48+
- name: ubuntu-focal
49+
image: ubuntu:focal
5050
dockerfile: ../Dockerfile.j2
5151
privileged: true
5252
volumes:

molecule/specific-version/prepare.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- name: Install NGINX Plus on Alpine
2121
hosts: all
2222
tasks:
23-
- name: Set up NGINX Plus on Alpine for NAP 3.2 issue workaround (remove in versions > 3.2)
23+
- name: Set up NGINX Plus on Alpine for NAP 3.2/3.3 issue workaround (remove in versions > 3.3)
2424
include_role:
2525
name: nginxinc.nginx
2626
vars:

0 commit comments

Comments
 (0)