|
4 | 4 | gather_facts: false |
5 | 5 | vars: |
6 | 6 | photon_database_path: /tmp/molecule-photon-data |
| 7 | + photon_network: molecule-traefik |
7 | 8 | tasks: |
8 | 9 | - name: Inspect Photon container |
9 | 10 | community.docker.docker_container_info: |
|
14 | 15 | ansible.builtin.assert: |
15 | 16 | that: |
16 | 17 | - photon_container.container.State.Status == 'running' |
| 18 | + - photon_container.container.State.Health.Status == 'healthy' |
17 | 19 | - photon_container.container.Config.Image == 'python:3.13-alpine' |
18 | 20 | - photon_container.container.HostConfig.RestartPolicy.Name == 'always' |
19 | 21 | - >- |
20 | | - photon_container.container.HostConfig.PortBindings['2322/tcp'][0].HostPort |
21 | | - == '12322' |
| 22 | + photon_container.container.HostConfig.PortBindings is none or |
| 23 | + photon_container.container.HostConfig.PortBindings | length == 0 |
| 24 | + - photon_network in photon_container.container.NetworkSettings.Networks |
22 | 25 | - >- |
23 | 26 | photon_container.container.Mounts | selectattr('Destination', 'equalto', |
24 | 27 | '/photon/photon_data') | list | length == 1 |
|
28 | 31 | map(attribute='Source') | first) == photon_database_path |
29 | 32 | - photon_container.container.Config.Env is contains('PHOTON_UPDATE_STRATEGY=CONTINUOUS') |
30 | 33 | - photon_container.container.Config.Env is contains('PHOTON_UPDATE_INTERVAL=3600') |
| 34 | + - photon_container.container.Config.Labels['traefik.enable'] == 'true' |
| 35 | + - photon_container.container.Config.Labels['traefik.docker.network'] == photon_network |
| 36 | + - photon_container.container.Config.Labels['traefik.http.routers.photon.rule'] == 'Host(`photon.test`)' |
| 37 | + - photon_container.container.Config.Labels['traefik.http.routers.photon.tls'] == 'true' |
| 38 | + - photon_container.container.Config.Labels['traefik.http.routers.photon.tls.certresolver'] == 'le' |
| 39 | + - photon_container.container.Config.Labels['traefik.http.services.photon.loadbalancer.server.port'] == '2322' |
31 | 40 |
|
32 | 41 | - name: Check Photon API endpoint from the container |
33 | 42 | community.docker.docker_container_exec: |
|
0 commit comments