Closed ptoscano closed 3 months ago
[citest]
[citest]
[citest]
[citest]
Another way to dynamically construct lists in an assignment statement where you want to omit some of the elements is like this:
- name: Start Candlepin container
command:
argv:
"{{ podman_run_cli }}"
changed_when: false
vars:
podman_run_cli: [podman, run, --rm, --detach, --hostname, candlepin_host, --name, candlepin, --publish,
8443:8443, --publish, 8080:8080] +
{{ ['--privileged'] if (ansible_distribution in ['CentOS', 'RedHat']
and ansible_distribution_major_version | int < 8)
else [] }} + [ghcr.io/ptoscano/candlepin-unofficial]
Yes, it uses the "json" style of list definition, but I prefer readability to strict adherence of Ansible guidelines
hmm - the indentation is way off - maybe github is auto-indenting something?
[citest]
Using the
containers.podman
collection to handlepodman
is a nice idea, however what that collection supports now is becoming more strict than what this role supports. Case in point:containers.podman
now requires Python 3.6+ for the managed nodes, which breaks the testing of EL 7.This means that sadly the setup of a self-deployed Candlepin needs to run
podman
commands manually; use the proper parameters forpodman run
depending on the OS.The gymnastics of checking the return code & stderr of
podman stop
are needed because the--ignore
option (which would be ideal) was introduced inpodman
1.7.0, and EL 7 haspodman
1.6.4.There is no behaviour change.