|
92 | 92 | block:
|
93 | 93 | - name: Check for PCRE install
|
94 | 94 | ansible.builtin.stat:
|
95 |
| - path: /tmp/{{ pcre_version }} |
| 95 | + path: /tmp/pcre-{{ pcre_version }} |
96 | 96 | register: pcre_result
|
97 | 97 |
|
98 | 98 | - name: Check for ZLib install
|
99 | 99 | ansible.builtin.stat:
|
100 |
| - path: /tmp/{{ zlib_version }} |
| 100 | + path: /tmp/zlib-{{ zlib_version }} |
101 | 101 | register: zlib_result
|
102 | 102 |
|
103 | 103 | - name: Check for OpenSSL install
|
104 | 104 | ansible.builtin.stat:
|
105 |
| - path: /tmp/{{ openssl_version }} |
| 105 | + path: /tmp/openssl-{{ openssl_version }} |
106 | 106 | register: openssl_result
|
107 | 107 |
|
108 | 108 | - name: Install PCRE dependecy from package
|
109 |
| - when: nginx_install_source_pcre | bool |
| 109 | + when: not nginx_install_source_pcre | bool |
110 | 110 | block:
|
111 | 111 | - name: (Alpine Linux) Install PCRE dependency from package
|
112 | 112 | community.general.apk:
|
|
135 | 135 | - name: Install PCRE dependence from source
|
136 | 136 | when:
|
137 | 137 | - not pcre_result.stat.exists | bool
|
138 |
| - - not nginx_install_source_pcre | bool |
| 138 | + - nginx_install_source_pcre | bool |
139 | 139 | - not ansible_check_mode | bool
|
140 | 140 | block:
|
141 | 141 | - name: Download PCRE dependency
|
142 | 142 | ansible.builtin.get_url:
|
143 |
| - url: "{{ (pcre_release == 2) | ternary('https://github.com/PCRE2Project/pcre2/releases/download/' ~ pcre_version ~ '/' ~ pcre_version ~ '.tar.gz', 'https://ftp.exim.org/pub/pcre/' ~ pcre_version ~ '.tar.gz') }}" |
144 |
| - dest: /tmp/{{ pcre_version }}.tar.gz |
| 143 | + url: "{{ (pcre_release == 2) | ternary('https://github.com/PCRE2Project/pcre2/releases/download/pcre2-' ~ pcre_version ~ '/pcre2-' ~ pcre_version ~ '.tar.gz', 'https://ftp.exim.org/pub/pcre/pcre-' ~ pcre_version ~ '.tar.gz') }}" |
| 144 | + dest: /tmp |
145 | 145 | mode: 0600
|
146 | 146 | register: pcre_source
|
147 | 147 |
|
| 148 | + - name: Ensure PCRE directory exists |
| 149 | + ansible.builtin.file: |
| 150 | + path: /tmp/pcre-{{ pcre_version }} |
| 151 | + state: directory |
| 152 | + mode: 0700 |
| 153 | + |
148 | 154 | - name: Unpack PCRE dependency
|
149 | 155 | ansible.builtin.unarchive:
|
150 | 156 | copy: false
|
151 |
| - dest: /tmp/ |
152 | 157 | src: "{{ pcre_source.dest }}"
|
| 158 | + dest: /tmp/pcre-{{ pcre_version }}/ |
153 | 159 | mode: 0700
|
| 160 | + extra_opts: [--strip-components=1] |
154 | 161 |
|
155 | 162 | - name: Configure PCRE dependency
|
156 | 163 | ansible.builtin.command: ./configure
|
157 | 164 | args:
|
158 |
| - chdir: /tmp/{{ pcre_version }} |
| 165 | + chdir: /tmp/pcre-{{ pcre_version }} |
159 | 166 | creates: /tmp/makefile
|
160 | 167 |
|
161 | 168 | - name: Make PCRE dependency
|
162 | 169 | community.general.make:
|
163 |
| - chdir: /tmp/{{ pcre_version }} |
| 170 | + chdir: /tmp/pcre-{{ pcre_version }} |
164 | 171 |
|
165 | 172 | - name: Install PCRE dependency
|
166 | 173 | community.general.make:
|
167 |
| - chdir: /tmp/{{ pcre_version }} |
| 174 | + chdir: /tmp/pcre-{{ pcre_version }} |
168 | 175 | target: install
|
169 | 176 |
|
170 | 177 | - name: Install ZLib dependency from package
|
171 |
| - when: nginx_install_source_zlib | bool |
| 178 | + when: not nginx_install_source_zlib | bool |
172 | 179 | block:
|
173 | 180 | - name: (Alpine Linux) Install ZLib dependency from package
|
174 | 181 | community.general.apk:
|
|
197 | 204 | - name: Install ZLib dependency from source
|
198 | 205 | when:
|
199 | 206 | - not zlib_result.stat.exists | bool
|
200 |
| - - not nginx_install_source_zlib | bool |
| 207 | + - nginx_install_source_zlib | bool |
201 | 208 | - not ansible_check_mode | bool
|
202 | 209 | block:
|
203 | 210 | - name: Download ZLib dependency
|
204 | 211 | ansible.builtin.get_url:
|
205 |
| - url: https://zlib.net/{{ zlib_version }}.tar.gz |
206 |
| - dest: /tmp/{{ zlib_version }}.tar.gz |
| 212 | + url: https://github.com/madler/zlib/releases/download/v{{ zlib_version }}/zlib-{{ zlib_version }}.tar.gz |
| 213 | + dest: /tmp |
207 | 214 | mode: 0600
|
208 | 215 | register: zlib_source
|
209 | 216 |
|
| 217 | + - name: Ensure ZLib directory exists |
| 218 | + ansible.builtin.file: |
| 219 | + path: /tmp/zlib-{{ zlib_version }} |
| 220 | + state: directory |
| 221 | + mode: 0700 |
| 222 | + |
210 | 223 | - name: Unpack ZLib dependency
|
211 | 224 | ansible.builtin.unarchive:
|
212 | 225 | copy: false
|
213 |
| - dest: /tmp/ |
214 | 226 | src: "{{ zlib_source.dest }}"
|
| 227 | + dest: /tmp/zlib-{{ zlib_version }} |
215 | 228 | mode: 0700
|
| 229 | + extra_opts: [--strip-components=1] |
216 | 230 |
|
217 | 231 | - name: Configure ZLib dependency
|
218 | 232 | ansible.builtin.command: ./configure
|
219 | 233 | args:
|
220 |
| - chdir: /tmp/{{ zlib_version }} |
| 234 | + chdir: /tmp/zlib-{{ zlib_version }} |
221 | 235 | creates: /tmp/makefile
|
222 | 236 |
|
223 | 237 | - name: Make ZLib dependency
|
224 | 238 | community.general.make:
|
225 |
| - chdir: /tmp/{{ zlib_version }} |
| 239 | + chdir: /tmp/zlib-{{ zlib_version }} |
226 | 240 |
|
227 | 241 | - name: Install ZLib dependency
|
228 | 242 | community.general.make:
|
229 |
| - chdir: /tmp/{{ zlib_version }} |
| 243 | + chdir: /tmp/zlib-{{ zlib_version }} |
230 | 244 | target: install
|
231 | 245 |
|
232 |
| - |
233 | 246 | - name: Install OpenSSL dependency from package
|
234 |
| - when: nginx_install_source_openssl | bool |
| 247 | + when: not nginx_install_source_openssl | bool |
235 | 248 | block:
|
236 | 249 | - name: (Alpine Linux) Install OpenSSL dependency from package
|
237 | 250 | community.general.apk:
|
|
260 | 273 | - name: Install OpenSSL dependency from source
|
261 | 274 | when:
|
262 | 275 | - not openssl_result.stat.exists | bool
|
263 |
| - - not nginx_install_source_openssl | bool |
| 276 | + - nginx_install_source_openssl | bool |
264 | 277 | - not ansible_check_mode | bool
|
265 | 278 | block:
|
266 | 279 | - name: Download OpenSSL dependency
|
267 | 280 | ansible.builtin.get_url:
|
268 |
| - url: https://www.openssl.org/source/{{ openssl_version }}.tar.gz |
| 281 | + url: https://github.com/openssl/openssl/archive/refs/tags/openssl-{{ openssl_version }}.tar.gz |
269 | 282 | dest: /tmp/{{ openssl_version }}.tar.gz
|
270 | 283 | mode: 0600
|
271 | 284 | register: openssl_source
|
272 | 285 |
|
| 286 | + - name: Ensure OpenSSL directory exists |
| 287 | + ansible.builtin.file: |
| 288 | + path: /tmp/openssl-{{ openssl_version }} |
| 289 | + state: directory |
| 290 | + mode: 0700 |
| 291 | + |
273 | 292 | - name: Unpack OpenSSL dependency
|
274 | 293 | ansible.builtin.unarchive:
|
275 | 294 | copy: false
|
276 |
| - dest: /tmp/ |
277 | 295 | src: "{{ openssl_source.dest }}"
|
| 296 | + dest: /tmp/openssl-{{ openssl_version }} |
278 | 297 | mode: 0700
|
| 298 | + extra_opts: [--strip-components=1] |
279 | 299 |
|
280 | 300 | - name: Configure OpenSSL dependency
|
281 | 301 | ansible.builtin.command: ./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl shared zlib
|
282 | 302 | args:
|
283 |
| - chdir: /tmp/{{ openssl_version }} |
| 303 | + chdir: /tmp/openssl-{{ openssl_version }} |
284 | 304 | creates: /tmp/makefile
|
285 | 305 |
|
286 | 306 | - name: Make OpenSSL dependency
|
287 | 307 | community.general.make:
|
288 |
| - chdir: /tmp/{{ openssl_version }} |
| 308 | + chdir: /tmp/openssl-{{ openssl_version }} |
289 | 309 |
|
290 | 310 | - name: Install OpenSSL dependency
|
291 | 311 | community.general.make:
|
292 |
| - chdir: /tmp/{{ openssl_version }} |
| 312 | + chdir: /tmp/openssl-{{ openssl_version }} |
293 | 313 | target: install
|
294 | 314 |
|
295 | 315 | - name: Get NGINX version
|
|
338 | 358 | - name: Unpack NGINX
|
339 | 359 | ansible.builtin.unarchive:
|
340 | 360 | copy: false
|
341 |
| - dest: /tmp/ |
342 | 361 | src: "{{ nginx_source.dest }}"
|
| 362 | + dest: /tmp |
343 | 363 | mode: 0755
|
344 | 364 |
|
345 | 365 | - name: Set static modules
|
|
360 | 380 | --user=nginx
|
361 | 381 | --with-mail=dynamic
|
362 | 382 | --with-stream
|
363 |
| - {{ nginx_install_source_pcre | ternary('', '--with-pcre=../' + pcre_version) }} |
364 |
| - {{ nginx_install_source_zlib | ternary('', '--with-zlib=../' + zlib_version) }} |
365 |
| - {{ nginx_install_source_openssl | ternary('', '--with-openssl=../' + openssl_version) }} |
| 383 | + {{ nginx_install_source_pcre | ternary('--with-pcre=../pcre-' + pcre_version | string, '') }} |
| 384 | + {{ nginx_install_source_zlib | ternary('--with-zlib=../zlib-' + zlib_version | string, '') }} |
| 385 | + {{ nginx_install_source_openssl | ternary('--with-openssl=../openssl-' + openssl_version | string, '') }} |
366 | 386 | {{ nginx_install_source_static_modules | default('') }}
|
367 | 387 | args:
|
368 | 388 | chdir: /tmp/{{ nginx_version }}
|
|
0 commit comments