diff --git a/docs/podman_search_module.html b/docs/podman_search_module.html index ecc6b47..6d4797f 100644 --- a/docs/podman_search_module.html +++ b/docs/podman_search_module.html @@ -9,7 +9,7 @@ containers.podman.podman_search module – Search for remote images using podman — Python documentation - + @@ -38,7 +38,7 @@

containers.podman.podman_search module – Search for remote images using podman

Note

-

This module is part of the containers.podman collection (version 1.13.0).

+

This module is part of the containers.podman collection (version 1.14.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install containers.podman.

@@ -85,8 +85,8 @@ To check whether it is installed, run
-

listtags

-

boolean

+

list_tags

+

boolean

Whether or not to return the list of tags associated with each image

Choices:

@@ -129,7 +129,7 @@ To check whether it is installed, run - name: Gather tag info on a known remote image containers.podman.podman_search: term: "myimageregistry.com/ansible-automation-platform/ee-minimal-rhel8" - listtags: True + list_tags: True
diff --git a/plugins/modules/podman_search.py b/plugins/modules/podman_search.py index 67ad354..128e3ce 100644 --- a/plugins/modules/podman_search.py +++ b/plugins/modules/podman_search.py @@ -32,7 +32,7 @@ options: required: False default: 25 type: int - listtags: + list_tags: description: - Whether or not to return the list of tags associated with each image required: False @@ -54,7 +54,7 @@ EXAMPLES = r""" - name: Gather tag info on a known remote image containers.podman.podman_search: term: "myimageregistry.com/ansible-automation-platform/ee-minimal-rhel8" - listtags: True + list_tags: True """ RETURN = r""" @@ -80,10 +80,10 @@ import json from ansible.module_utils.basic import AnsibleModule -def search_images(module, executable, term, limit, listtags): +def search_images(module, executable, term, limit, list_tags): command = [executable, 'search', term, '--format', 'json'] command.extend(['--limit', "{0}".format(limit)]) - if listtags: + if list_tags: command.extend(['--list-tags']) rc, out, err = module.run_command(command) @@ -99,7 +99,7 @@ def main(): executable=dict(type='str', default='podman'), term=dict(type='str', required=True), limit=dict(type='int', required=False, default=25), - listtags=dict(type='bool', required=False, default=False) + list_tags=dict(type='bool', required=False, default=False) ), supports_check_mode=True, ) @@ -107,10 +107,10 @@ def main(): executable = module.params['executable'] term = module.params.get('term') limit = module.params.get('limit') - listtags = module.params.get('listtags') + list_tags = module.params.get('list_tags') executable = module.get_bin_path(executable, required=True) - result_str = search_images(module, executable, term, limit, listtags) + result_str = search_images(module, executable, term, limit, list_tags) if result_str == "": results = [] else: diff --git a/tests/integration/targets/podman_search/tasks/main.yml b/tests/integration/targets/podman_search/tasks/main.yml index a6b394c..66c5ebd 100644 --- a/tests/integration/targets/podman_search/tasks/main.yml +++ b/tests/integration/targets/podman_search/tasks/main.yml @@ -39,7 +39,7 @@ - name: Search for specific image tags containers.podman.podman_search: term: registry.access.redhat.com/rhel7/rsyslog - listtags: true + list_tags: true executable: "{{ test_executable | default('podman') }}" register: info_3