Add podman_image and podman_image_info modules (#55103)

* Add podman_image and podman_image_info modules

* Add integration test for podman_image_info

* Change parameter names per feedback

* Add integration tests for podman_image
This commit is contained in:
Sam Doran 2019-04-10 19:28:09 -04:00 committed by Adam Miller
parent e28d08a3c1
commit c2be342ce1
14 changed files with 1150 additions and 0 deletions

View file

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2019 Ansible Project
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
def run_podman_command(module, executable='podman', args=None, expected_rc=0, ignore_errors=False):
if not isinstance(executable, list):
command = [executable]
if args is not None:
command.extend(args)
rc, out, err = module.run_command(command)
if not ignore_errors and rc != expected_rc:
module.fail_json(
msg='Failed to run {command} {args}: {err}'.format(
command=command, args=args, err=err))
return rc, out, err