1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-03-22 02:29:08 +00:00

Add podman search (#770)

* Add podman_search module

Signed-off-by: Derek <derek@frisbeeworld.com>
This commit is contained in:
Derek Waters 2024-06-03 16:49:29 +10:00 committed by GitHub
parent 4cb8404b7b
commit 38d95029e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 463 additions and 0 deletions

View file

@ -0,0 +1,50 @@
- name: Test podman_search
block:
- name: Search for an invalid image
containers.podman.podman_search:
term: invalidtermnope
executable: "{{ test_executable | default('podman') }}"
register: info_0
- name: Check results for no matching images
assert:
that:
- info_0.images | length == 0
- name: Search for matching images
containers.podman.podman_search:
term: etcd
executable: "{{ test_executable | default('podman') }}"
register: info_1
- name: Check results for matching images
assert:
that:
- info_1.images | length > 0
- name: Search for a specific image
containers.podman.podman_search:
term: registry.access.redhat.com/rhel7/rsyslog
executable: "{{ test_executable | default('podman') }}"
register: info_2
- name: Check result for matching image
assert:
that:
- info_2.images | length == 1
- info_2.images[0].Index == "registry.access.redhat.com"
- info_2.images[0].Name == "registry.access.redhat.com/rhel7/rsyslog"
- name: Search for specific image tags
containers.podman.podman_search:
term: registry.access.redhat.com/rhel7/rsyslog
list_tags: true
executable: "{{ test_executable | default('podman') }}"
register: info_3
- name: Check result for image tags
assert:
that:
- info_3.images | length == 1
- info_3.images[0].Tags | length > 0