Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: run podman directly instead of using containers.podman #196

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tests/collection-requirements.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
collections:
- name: containers.podman
- name: fedora.linux_system_roles
44 changes: 31 additions & 13 deletions tests/tasks/setup_candlepin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,41 @@
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"

- name: Stop and remove Candlepin container
containers.podman.podman_container:
name: candlepin
state: absent
command:
argv:
- podman
- stop
- candlepin
register: podman_stop_status
failed_when:
- podman_stop_status.rc != 0
- '"no such container" not in podman_stop_status.stderr'
changed_when: false

- name: Start Candlepin container
ptoscano marked this conversation as resolved.
Show resolved Hide resolved
containers.podman.podman_container:
detach: true
hostname: "{{ lsr_rhc_test_data.candlepin_host }}"
image: ghcr.io/ptoscano/candlepin-unofficial
name: candlepin
privileged: "{{ ansible_distribution in ['CentOS', 'RedHat']
and ansible_distribution_major_version | int < 8 }}"
publish:
vars:
podman_run_cli:
- podman
- run
- --rm
- --detach
- --hostname
- "{{ lsr_rhc_test_data.candlepin_host }}"
- --name
- candlepin
- --publish
- 8443:8443
- --publish
- 8080:8080
rm: true
state: started
- "{{ '--privileged'
if (ansible_distribution in ['CentOS', 'RedHat']
and ansible_distribution_major_version | int < 8)
else '' }}"
- ghcr.io/ptoscano/candlepin-unofficial
command:
argv:
"{{ podman_run_cli | reject('match', '^$') | list }}"
richm marked this conversation as resolved.
Show resolved Hide resolved
changed_when: false

- name: Ensure directories exist
file:
Expand Down
Loading