|
272 | 272 | until: terrarium_post_proxy_sync.rc == 0 |
273 | 273 | changed_when: false |
274 | 274 |
|
275 | | - - name: Remove local auth bootstrap TLS material before requesting public TLS |
| 275 | + - name: Remove local auth bootstrap routes before requesting public TLS |
276 | 276 | ansible.builtin.file: |
277 | 277 | path: "{{ item }}" |
278 | 278 | state: absent |
279 | 279 | loop: |
280 | | - - "{{ terrarium_traefik_config_dir }}/dynamic/bootstrap-cert.yml" |
281 | 280 | - "{{ terrarium_traefik_config_dir }}/dynamic/bootstrap-routes.yml" |
282 | | - - "{{ terrarium_traefik_config_dir }}/bootstrap-certs" |
283 | | - - /usr/local/share/ca-certificates/terrarium-bootstrap.crt |
284 | | - register: terrarium_bootstrap_tls_removed |
| 281 | + register: terrarium_bootstrap_routes_removed |
285 | 282 | when: |
286 | 283 | - terrarium_idp_mode == 'local' |
287 | 284 | - terrarium_auth_domain | default('') | length > 0 |
288 | 285 |
|
289 | | - - name: Refresh system CA certificates after retiring bootstrap TLS |
290 | | - ansible.builtin.command: update-ca-certificates |
291 | | - when: terrarium_bootstrap_tls_removed is changed |
292 | | - |
293 | | - - name: Restart Traefik after retiring bootstrap TLS |
| 286 | + - name: Restart Traefik after removing bootstrap routes |
294 | 287 | ansible.builtin.systemd: |
295 | 288 | name: traefik |
296 | 289 | state: restarted |
297 | | - when: terrarium_bootstrap_tls_removed is changed |
| 290 | + when: terrarium_bootstrap_routes_removed is changed |
298 | 291 |
|
299 | | - - name: Wait for local auth domain to serve public TLS |
| 292 | + - name: Wait for local auth domain to serve trusted TLS |
300 | 293 | ansible.builtin.command: |
301 | 294 | argv: |
302 | 295 | - curl |
|
310 | 303 | - --max-time |
311 | 304 | - "20" |
312 | 305 | - "https://{{ terrarium_auth_domain }}/.well-known/openid-configuration" |
313 | | - register: terrarium_auth_public_tls |
| 306 | + register: terrarium_auth_trusted_tls |
314 | 307 | retries: 36 |
315 | 308 | delay: 10 |
316 | | - until: terrarium_auth_public_tls.rc == 0 |
| 309 | + until: terrarium_auth_trusted_tls.rc == 0 |
317 | 310 | changed_when: false |
318 | 311 | failed_when: false |
319 | 312 | when: |
320 | 313 | - terrarium_idp_mode == 'local' |
321 | 314 | - terrarium_auth_domain | default('') | length > 0 |
322 | 315 |
|
323 | | - - name: Restart Traefik to retry local auth ACME after public TLS wait failure |
| 316 | + - name: Restart Traefik to retry local auth TLS after trusted TLS wait failure |
324 | 317 | ansible.builtin.systemd: |
325 | 318 | name: traefik |
326 | 319 | state: restarted |
327 | 320 | when: |
328 | 321 | - terrarium_idp_mode == 'local' |
329 | 322 | - terrarium_auth_domain | default('') | length > 0 |
330 | | - - terrarium_auth_public_tls is defined |
331 | | - - terrarium_auth_public_tls.rc | default(0) != 0 |
| 323 | + - terrarium_auth_trusted_tls is defined |
| 324 | + - terrarium_auth_trusted_tls.rc | default(0) != 0 |
332 | 325 |
|
333 | | - - name: Wait again for local auth domain to serve public TLS after ACME retry |
| 326 | + - name: Wait again for local auth domain to serve trusted TLS after retry |
334 | 327 | ansible.builtin.command: |
335 | 328 | argv: |
336 | 329 | - curl |
|
344 | 337 | - --max-time |
345 | 338 | - "20" |
346 | 339 | - "https://{{ terrarium_auth_domain }}/.well-known/openid-configuration" |
347 | | - register: terrarium_auth_public_tls_retry |
| 340 | + register: terrarium_auth_trusted_tls_retry |
348 | 341 | retries: 36 |
349 | 342 | delay: 10 |
350 | | - until: terrarium_auth_public_tls_retry.rc == 0 |
| 343 | + until: terrarium_auth_trusted_tls_retry.rc == 0 |
| 344 | + changed_when: false |
| 345 | + failed_when: false |
| 346 | + when: |
| 347 | + - terrarium_idp_mode == 'local' |
| 348 | + - terrarium_auth_domain | default('') | length > 0 |
| 349 | + - terrarium_auth_trusted_tls is defined |
| 350 | + - terrarium_auth_trusted_tls.rc | default(0) != 0 |
| 351 | + |
| 352 | + - name: Verify local auth domain serves trusted TLS after waits |
| 353 | + ansible.builtin.command: |
| 354 | + argv: |
| 355 | + - curl |
| 356 | + - -fsS |
| 357 | + - --noproxy |
| 358 | + - "*" |
| 359 | + - --resolve |
| 360 | + - "{{ terrarium_auth_domain }}:443:127.0.0.1" |
| 361 | + - --connect-timeout |
| 362 | + - "10" |
| 363 | + - --max-time |
| 364 | + - "20" |
| 365 | + - "https://{{ terrarium_auth_domain }}/.well-known/openid-configuration" |
| 366 | + register: terrarium_auth_trusted_tls_final |
351 | 367 | changed_when: false |
352 | 368 | failed_when: false |
353 | 369 | when: |
354 | 370 | - terrarium_idp_mode == 'local' |
355 | 371 | - terrarium_auth_domain | default('') | length > 0 |
356 | | - - terrarium_auth_public_tls is defined |
357 | | - - terrarium_auth_public_tls.rc | default(0) != 0 |
358 | 372 |
|
359 | | - - name: Show local auth TLS diagnostics after ACME retry failure |
| 373 | + - name: Show local auth TLS diagnostics after trusted TLS failure |
360 | 374 | ansible.builtin.shell: | |
361 | 375 | set +e |
362 | 376 | echo "== presented certificate ==" |
|
372 | 386 | when: |
373 | 387 | - terrarium_idp_mode == 'local' |
374 | 388 | - terrarium_auth_domain | default('') | length > 0 |
375 | | - - terrarium_auth_public_tls_retry is defined |
376 | | - - terrarium_auth_public_tls_retry.rc | default(0) != 0 |
| 389 | + - terrarium_auth_trusted_tls_final is defined |
| 390 | + - terrarium_auth_trusted_tls_final.rc | default(0) != 0 |
377 | 391 |
|
378 | | - - name: Fail when local auth domain still does not serve public TLS |
| 392 | + - name: Fail when local auth domain still does not serve trusted TLS |
379 | 393 | ansible.builtin.fail: |
380 | | - msg: "Local auth domain {{ terrarium_auth_domain }} still does not serve public TLS after retiring bootstrap TLS; see Traefik ACME diagnostics above." |
| 394 | + msg: "Local auth domain {{ terrarium_auth_domain }} still does not serve TLS trusted by the host; see Traefik TLS diagnostics above." |
381 | 395 | when: |
382 | 396 | - terrarium_idp_mode == 'local' |
383 | 397 | - terrarium_auth_domain | default('') | length > 0 |
384 | | - - terrarium_auth_public_tls_retry is defined |
385 | | - - terrarium_auth_public_tls_retry.rc | default(0) != 0 |
| 398 | + - terrarium_auth_trusted_tls_final is defined |
| 399 | + - terrarium_auth_trusted_tls_final.rc | default(0) != 0 |
386 | 400 |
|
387 | 401 | - name: Enable Traefik sync timer after dependent services are configured |
388 | 402 | ansible.builtin.systemd: |
|
0 commit comments