1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-02-04 07:11:49 +00:00
ansible-podman-collections/tests/integration/targets/podman_play/tasks/play-with-options.yml
Sagi Shnaidman a4df896bae CI - add parametrized executables to tests
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2024-02-18 13:13:57 +02:00

56 lines
1.7 KiB
YAML

---
- name: Test play pod with options
block:
- name: Copy kube file
copy:
src: "{{ kube_file }}"
dest: "{{ kube_dir }}/{{ kube_file }}"
remote_src: false
- name: Create Pod with many options
containers.podman.podman_play:
executable: "{{ test_executable | default('podman') }}"
kube_file: "{{ kube_dir }}/{{ kube_file }}"
state: started
recreate: true
annotation:
greeting: hello
greet_to: world
userns: "{{ userns }}"
log_opt:
path: "{{ log_opt.path }}"
max_size: "{{ log_opt.size }}"
register: play_pod
- name: Get pod info
containers.podman.podman_pod_info:
executable: "{{ test_executable | default('podman') }}"
name: "{{ target_pod }}"
register: play_pod_info
- name: Check userns is set in Pod
assert:
that:
- play_pod_info.pods.0.InfraConfig.userns == userns
- name: Get container info
containers.podman.podman_container_info:
executable: "{{ test_executable | default('podman') }}"
name: "{{ target_container }}"
register: play_container_info
- name: Check annotations and log options are set in Pod
assert:
that:
- play_container_info.containers.0.Config.Annotations["greeting"] == "hello"
- play_container_info.containers.0.Config.Annotations["greet_to"] == "world"
- play_container_info.containers.0.HostConfig.LogConfig["Path"] == log_opt.path
- play_container_info.containers.0.HostConfig.LogConfig["Size"] | lower == log_opt.size
always:
- name: Cleanup pods
containers.podman.podman_play:
executable: "{{ test_executable | default('podman') }}"
kube_file: "{{ kube_dir }}/{{ kube_file }}"
state: absent