|
1 | 1 | --- |
2 | | -- name: create additional configuration |
| 2 | +- name: Create additional configuration |
3 | 3 | template: |
4 | 4 | src: "hardening.conf.j2" |
5 | 5 | dest: "/etc/nginx/conf.d/90.hardening.conf" |
6 | 6 | mode: '0600' |
7 | 7 | owner: "root" |
8 | 8 | group: "root" |
9 | | - notify: restart nginx |
| 9 | + notify: Restart nginx |
10 | 10 |
|
11 | | -- name: change configuration in main nginx.conf |
| 11 | +- name: Change configuration in main nginx.conf |
12 | 12 | lineinfile: |
13 | 13 | dest: "/etc/nginx/nginx.conf" |
14 | 14 | regexp: '^\s*server_tokens' |
|
17 | 17 | mode: '0640' |
18 | 18 | owner: "root" |
19 | 19 | group: "root" |
20 | | - notify: restart nginx |
| 20 | + notify: Restart nginx |
21 | 21 |
|
22 | | -- name: change ssl_protocols in main nginx.conf |
| 22 | +- name: Change ssl_protocols in main nginx.conf |
23 | 23 | lineinfile: |
24 | 24 | dest: "/etc/nginx/nginx.conf" |
25 | 25 | regexp: '^\s*ssl_protocols' |
|
28 | 28 | mode: '0640' |
29 | 29 | owner: "root" |
30 | 30 | group: "root" |
31 | | - notify: restart nginx |
| 31 | + notify: Restart nginx |
32 | 32 |
|
33 | | -- name: change ssl_prefer_server_ciphers in main nginx.conf |
| 33 | +- name: Change ssl_prefer_server_ciphers in main nginx.conf |
34 | 34 | lineinfile: |
35 | 35 | dest: "/etc/nginx/nginx.conf" |
36 | 36 | regexp: '^\s*ssl_prefer_server_ciphers' |
|
39 | 39 | mode: '0640' |
40 | 40 | owner: "root" |
41 | 41 | group: "root" |
42 | | - notify: restart nginx |
| 42 | + notify: Restart nginx |
43 | 43 |
|
44 | | -- name: change client_max_body_size in main nginx.conf |
| 44 | +- name: Change client_max_body_size in main nginx.conf |
45 | 45 | lineinfile: |
46 | 46 | dest: "/etc/nginx/nginx.conf" |
47 | 47 | regexp: '^\s*client_max_body_size' |
|
50 | 50 | mode: '0640' |
51 | 51 | owner: "root" |
52 | 52 | group: "root" |
53 | | - notify: restart nginx |
| 53 | + notify: Restart nginx |
54 | 54 |
|
55 | | -- name: change client_body_buffer_size in main nginx.conf |
| 55 | +- name: Change client_body_buffer_size in main nginx.conf |
56 | 56 | lineinfile: |
57 | 57 | dest: "/etc/nginx/nginx.conf" |
58 | 58 | regexp: '^\s*client_body_buffer_size' |
|
61 | 61 | mode: '0640' |
62 | 62 | owner: "root" |
63 | 63 | group: "root" |
64 | | - notify: restart nginx |
| 64 | + notify: Restart nginx |
65 | 65 |
|
66 | | -- name: change keepalive_timeout in main nginx.conf |
| 66 | +- name: Change keepalive_timeout in main nginx.conf |
67 | 67 | lineinfile: |
68 | 68 | dest: "/etc/nginx/nginx.conf" |
69 | 69 | regexp: '^\s*keepalive_timeout' |
|
72 | 72 | mode: '0640' |
73 | 73 | owner: "root" |
74 | 74 | group: "root" |
75 | | - notify: restart nginx |
| 75 | + notify: Restart nginx |
76 | 76 |
|
77 | | -- name: remove default.conf |
| 77 | +- name: Remove default.conf |
78 | 78 | file: |
79 | 79 | path: "{{ item }}" |
80 | 80 | state: absent |
81 | 81 | when: nginx_remove_default_site |
82 | | - notify: restart nginx |
| 82 | + notify: Restart nginx |
83 | 83 | loop: |
84 | 84 | - "/etc/nginx/conf.d/default.conf" |
85 | 85 | - "/etc/nginx/sites-enabled/default" |
86 | 86 |
|
87 | | -- name: generate dh group |
| 87 | +- name: Generate dh group |
88 | 88 | openssl_dhparam: |
89 | 89 | path: "/etc/nginx/dh{{ nginx_dh_size }}.pem" |
90 | 90 | size: "{{ nginx_dh_size }}" |
91 | 91 | mode: '0640' |
92 | 92 | owner: "root" |
93 | 93 | group: "root" |
94 | | - notify: restart nginx |
| 94 | + notify: Restart nginx |
0 commit comments