mirror of
https://github.com/containers/ansible-podman-collections.git
synced 2026-02-04 07:11:49 +00:00
Improve readability of list_tags param
Signed-off-by: Derek <derek@frisbeeworld.com>
This commit is contained in:
parent
0f70a9c78e
commit
8e28ff2f2a
3 changed files with 13 additions and 13 deletions
|
|
@ -9,7 +9,7 @@
|
|||
<title>containers.podman.podman_search module – Search for remote images using podman — Python documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d1102ebc" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=12dfc556" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/antsibull-minimal.css" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/antsibull-minimal.css?v=9c1ca88e" />
|
||||
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
||||
<script src="_static/doctools.js?v=9a2dae69"></script>
|
||||
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
<h1>containers.podman.podman_search module – Search for remote images using podman<a class="headerlink" href="#containers-podman-podman-search-module-search-for-remote-images-using-podman" title="Link to this heading">¶</a></h1>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Note</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://galaxy.ansible.com/ui/repo/published/containers/podman/">containers.podman collection</a> (version 1.13.0).</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://galaxy.ansible.com/ui/repo/published/containers/podman/">containers.podman collection</a> (version 1.14.0).</p>
|
||||
<p>It is not included in <code class="docutils literal notranslate"><span class="pre">ansible-core</span></code>.
|
||||
To check whether it is installed, run <code class="code docutils literal notranslate"><span class="pre">ansible-galaxy</span> <span class="pre">collection</span> <span class="pre">list</span></code>.</p>
|
||||
<p>To install it, use: <code class="code docutils literal notranslate"><span class="pre">ansible-galaxy</span> <span class="pre">collection</span> <span class="pre">install</span> <span class="pre">containers.podman</span></code>.</p>
|
||||
|
|
@ -85,8 +85,8 @@ To check whether it is installed, run <code class="code docutils literal notrans
|
|||
</div></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><div class="ansible-option-cell">
|
||||
<div class="ansibleOptionAnchor" id="parameter-listtags"></div><p class="ansible-option-title" id="ansible-collections-containers-podman-podman-search-module-parameter-listtags"><strong>listtags</strong></p>
|
||||
<a class="ansibleOptionLink" href="#parameter-listtags" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
|
||||
<div class="ansibleOptionAnchor" id="parameter-list_tags"></div><p class="ansible-option-title" id="ansible-collections-containers-podman-podman-search-module-parameter-list-tags"><strong>list_tags</strong></p>
|
||||
<a class="ansibleOptionLink" href="#parameter-list_tags" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
|
||||
</div></td>
|
||||
<td><div class="ansible-option-cell"><p>Whether or not to return the list of tags associated with each image</p>
|
||||
<p class="ansible-option-line"><strong class="ansible-option-choices">Choices:</strong></p>
|
||||
|
|
@ -129,7 +129,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
|
|||
<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Gather tag info on a known remote image</span>
|
||||
<span class="w"> </span><span class="nt">containers.podman.podman_search</span><span class="p">:</span>
|
||||
<span class="w"> </span><span class="nt">term</span><span class="p">:</span><span class="w"> </span><span class="s">"myimageregistry.com/ansible-automation-platform/ee-minimal-rhel8"</span>
|
||||
<span class="w"> </span><span class="nt">listtags</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">True</span>
|
||||
<span class="w"> </span><span class="nt">list_tags</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">True</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue