Skip to content

Commit b491807

Browse files
committed
minor udpates on docs and permissions
1 parent 758c32a commit b491807

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,7 @@ default.pem
3636

3737
# Scratch Directory
3838
scratch/
39+
40+
# nginx keys
41+
sample-playbook/license/nginx-repo.key
42+
sample-playbook/license/nginx-repo.crt

README.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ Example Playbook
9898

9999
This is a sample playbook file for using the role to install NGINX App Protect on NGINX Plus and configure it using basic settings to all `wafs` inventory hosts.
100100

101+
A copy of this is in the sample-playbook directory in this repo.
102+
103+
First create a file for all the varialbles as `nginx-app-protect-vars.yml`
101104
```yaml
102105
---
103-
- hosts: wafs
104-
become: true
105-
vars:
106106
107107
# Specify whether you want to maintain your version of NGINX App Protect, upgrade to the latest version, or remove NGINX App Protect.
108108
# Can be used with `app_protect_version` to achieve fine grained control on which version of NGINX App Protect is installed/used on each playbook execution.
@@ -169,31 +169,24 @@ This is a sample playbook file for using the role to install NGINX App Protect o
169169
certificate: "{{playbook_dir}}/license/nginx-repo.crt"
170170
key: "{{playbook_dir}}/license/nginx-repo.key"
171171

172-
roles:
173-
- role: nginxinc.nginx_app_protect
174172
```
175173

176174
This is a sample playbook file for deploying the Ansible Galaxy NGINX App Protect role in a localhost and installing NGINX App Protect on NGINX Plus.
177175

178176
```yaml
179177
---
180-
- hosts: localhost
181-
become: true
178+
- hosts: wafs
179+
remote_user: centos
180+
pre_tasks:
181+
- name: load the vars
182+
include_vars:
183+
file: "{{playbook_dir}}/nginx-app-protect-vars.yml"
182184
roles:
183-
- role: nginxinc.nginx_app_protect
185+
- nginxinc.nginx_app_protect
184186
```
185187
186-
This is a sample playbook file for deploying the Ansible Galaxy NGINX App Protect role to a dynamic inventory containing the `nginx_plus` tag.
187-
188-
```yaml
189-
---
190-
- hosts: tag_nginx_plus
191-
remote_user: root
192-
roles:
193-
- role: nginxinc.nginx_app_protect
194-
```
195188
196-
To run any of the above sample playbooks create a `setup-nginx-app-protect.yml` file and paste the contents. Executing the Ansible Playbook is then as simple as executing `ansible-playbook setup-nginx.yml`.
189+
To run any of the above sample playbooks create a `nginx-app-protect-playbook.yml` file and paste the contents. Executing the Ansible Playbook is then as simple as executing `ansible-playbook nginx-app-protect-playbook.yml -b -i inventory`.
197190

198191
Alternatively, you can also clone this repository instead of installing it from Ansible Galaxy. If you decide to do so, replace the role variable in the previous sample playbooks from `nginxinc.nginx_app_protect` to `ansible-role-nginx-app-protect`.
199192

sample-playbook

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 62c40da4b1ea1c00d77081867026d6ba2fce3681

tasks/configure-app-protect.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717
template:
1818
src: "{{ app_protect_security_policy_template.template_file }}"
1919
dest: "{{ app_protect_security_policy_template.out_file_location }}{{ app_protect_security_policy_template.out_file_name }}"
20+
mode: "0644"
2021
backup: true
2122
when: app_protect_security_policy_template_enable
2223

2324
- name: "Dynamically Generate NGINX App Protect log policy file"
2425
template:
2526
src: "{{ app_protect_log_policy_template.template_file }}"
2627
dest: "{{ app_protect_log_policy_template.out_file_location }}{{ app_protect_log_policy_template.out_file_name }}"
28+
mode: '0644'
2729
backup: true
2830
when: app_protect_log_policy_template_enable
2931

0 commit comments

Comments
 (0)