|
15 | 15 | register: proxy_target_ports |
16 | 16 |
|
17 | 17 | # everything from this point on is delegated to the nginx host |
18 | | -- name: put dhparam in place |
19 | | - delegate_to: "{{ nginx_host }}" |
20 | | - tags: [ configure_proxy ] |
21 | | - become: yes |
22 | | - command: openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
23 | | - |
24 | | -- name: print target ports |
| 18 | +- name: print target info |
25 | 19 | delegate_to: "{{ nginx_host }}" |
26 | 20 | tags: [ configure_proxy, deploy ] |
27 | 21 | debug: |
28 | 22 | msg: | |
29 | 23 | proxy target ports -- {{ proxy_target_ports }} |
30 | | -
|
31 | | -- name: print target IP address |
32 | | - delegate_to: "{{ nginx_host }}" |
33 | | - tags: [ configure_proxy, deploy ] |
34 | | - debug: |
35 | | - msg: ip -- {{ target_ip_address }} |
36 | | - |
37 | | -- name: assert nginx config directory |
38 | | - delegate_to: "{{ nginx_host }}" |
39 | | - tags: [ configure_proxy, deploy ] |
40 | | - become: yes |
41 | | - file: |
42 | | - state: directory |
43 | | - dest: /etc/nginx |
44 | | - |
45 | | -- name: assert nginx sites-available directory |
46 | | - delegate_to: "{{ nginx_host }}" |
47 | | - tags: [ configure_proxy, deploy ] |
48 | | - become: yes |
49 | | - file: |
50 | | - state: directory |
51 | | - dest: /etc/nginx/sites-available |
52 | | - |
53 | | -- name: assert nginx sites-enable directory |
54 | | - delegate_to: "{{ nginx_host }}" |
55 | | - tags: [ configure_proxy, deploy ] |
56 | | - become: yes |
57 | | - file: |
58 | | - state: directory |
59 | | - dest: /etc/nginx/sites-enable |
60 | | - |
61 | | -- name: put nginx configuration in place |
62 | | - when: nginx_config is defined and nginx_config == "proxy" |
63 | | - delegate_to: "{{ nginx_host }}" |
64 | | - tags: [ configure_proxy, deploy ] |
65 | | - become: yes |
66 | | - template: |
67 | | - src: "{{ nginx_config }}-nginx.conf" |
68 | | - dest: /etc/nginx/nginx.conf |
| 24 | + ip -- {{ target_ip_address }} |
69 | 25 |
|
70 | 26 | - name: put configuration in place |
71 | 27 | delegate_to: "{{ nginx_host }}" |
72 | 28 | tags: [ configure_proxy, deploy ] |
73 | 29 | become: yes |
74 | 30 | template: |
75 | 31 | src: "{{ item }}" |
76 | | - dest: /etc/nginx/sites-available/{{ item }} |
77 | | - with_items: "{{ templates }}" |
78 | | - |
79 | | -- name: link configuration to enable |
80 | | - delegate_to: "{{ nginx_host }}" |
81 | | - tags: [ configure_proxy, deploy ] |
82 | | - become: yes |
83 | | - file: |
84 | | - state: link |
85 | 32 | dest: /etc/nginx/sites-enabled/{{ item }} |
86 | | - src: /etc/nginx/sites-available/{{ item }} |
87 | 33 | with_items: "{{ templates }}" |
88 | 34 |
|
89 | 35 | - name: reload nginx |
|
0 commit comments