summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/src/ansible
diff options
context:
space:
mode:
authorOpenShift Bot <eparis+openshiftbot@redhat.com>2017-03-27 13:44:08 -0500
committerGitHub <noreply@github.com>2017-03-27 13:44:08 -0500
commita22e780b21eacf9ae7fc067d9f26e1a01c1d4558 (patch)
treeaaf88fa6e7ae01882d487f71e23603bb8785a4d2 /roles/lib_openshift/src/ansible
parent65af8296accd80a65c71e827b7b15536912f75fa (diff)
parent58f11324d9f0da8975d2a45516d0aeadd1bb0971 (diff)
downloadopenshift-a22e780b21eacf9ae7fc067d9f26e1a01c1d4558.tar.gz
openshift-a22e780b21eacf9ae7fc067d9f26e1a01c1d4558.tar.bz2
openshift-a22e780b21eacf9ae7fc067d9f26e1a01c1d4558.tar.xz
openshift-a22e780b21eacf9ae7fc067d9f26e1a01c1d4558.zip
Merge pull request #3758 from kwoodson/ocimage
Merged by openshift-bot
Diffstat (limited to 'roles/lib_openshift/src/ansible')
-rw-r--r--roles/lib_openshift/src/ansible/oc_image.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/roles/lib_openshift/src/ansible/oc_image.py b/roles/lib_openshift/src/ansible/oc_image.py
new file mode 100644
index 000000000..447d62f20
--- /dev/null
+++ b/roles/lib_openshift/src/ansible/oc_image.py
@@ -0,0 +1,34 @@
+# pylint: skip-file
+# flake8: noqa
+
+
+def main():
+ '''
+ ansible oc module for image import
+ '''
+
+ module = AnsibleModule(
+ argument_spec=dict(
+ kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'),
+ state=dict(default='present', type='str',
+ choices=['present', 'list']),
+ debug=dict(default=False, type='bool'),
+ namespace=dict(default='default', type='str'),
+ registry_url=dict(default=None, type='str'),
+ image_name=dict(default=None, required=True, type='str'),
+ image_tag=dict(default=None, type='str'),
+ force=dict(default=False, type='bool'),
+ ),
+
+ supports_check_mode=True,
+ )
+
+ rval = OCImage.run_ansible(module.params, module.check_mode)
+
+ if 'failed' in rval:
+ module.fail_json(**rval)
+
+ module.exit_json(**rval)
+
+if __name__ == '__main__':
+ main()