diff options
author | OpenShift Bot <eparis+openshiftbot@redhat.com> | 2017-03-22 18:53:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-22 18:53:47 -0500 |
commit | 3d1f4de1f4fe36163c2b62ef2c385ac746baf598 (patch) | |
tree | 42fc0dcb0f7c4bb569079b8298e2ddefccedee7e /roles/lib_openshift/src/ansible | |
parent | 763831e73432ab3db69efdbfd06a171be7d0a2af (diff) | |
parent | bfaa7976a2e3090f1b942978f340b9ffbb6b222c (diff) | |
download | openshift-3d1f4de1f4fe36163c2b62ef2c385ac746baf598.tar.gz openshift-3d1f4de1f4fe36163c2b62ef2c385ac746baf598.tar.bz2 openshift-3d1f4de1f4fe36163c2b62ef2c385ac746baf598.tar.xz openshift-3d1f4de1f4fe36163c2b62ef2c385ac746baf598.zip |
Merge pull request #3692 from kwoodson/oc_volume
Merged by openshift-bot
Diffstat (limited to 'roles/lib_openshift/src/ansible')
-rw-r--r-- | roles/lib_openshift/src/ansible/oc_volume.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/roles/lib_openshift/src/ansible/oc_volume.py b/roles/lib_openshift/src/ansible/oc_volume.py new file mode 100644 index 000000000..660376d2f --- /dev/null +++ b/roles/lib_openshift/src/ansible/oc_volume.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# flake8: noqa + +def main(): + ''' + ansible oc module for volumes + ''' + + module = AnsibleModule( + argument_spec=dict( + kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'), + state=dict(default='present', type='str', + choices=['present', 'absent', 'list']), + debug=dict(default=False, type='bool'), + kind=dict(default='dc', choices=['dc', 'rc', 'pods'], type='str'), + namespace=dict(default='default', type='str'), + vol_name=dict(default=None, type='str'), + name=dict(default=None, type='str'), + mount_type=dict(default=None, + choices=['emptydir', 'hostpath', 'secret', 'pvc', 'configmap'], + type='str'), + mount_path=dict(default=None, type='str'), + # secrets require a name + secret_name=dict(default=None, type='str'), + # pvc requires a size + claim_size=dict(default=None, type='str'), + claim_name=dict(default=None, type='str'), + # configmap requires a name + configmap_name=dict(default=None, type='str'), + ), + supports_check_mode=True, + ) + rval = OCVolume.run_ansible(module.params, module.check_mode) + if 'failed' in rval: + module.fail_json(**rval) + + module.exit_json(**rval) + + +if __name__ == '__main__': + main() |