diff options
Diffstat (limited to 'roles/lib_openshift/src/ansible/oc_serviceaccount_secret.py')
-rw-r--r-- | roles/lib_openshift/src/ansible/oc_serviceaccount_secret.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/roles/lib_openshift/src/ansible/oc_serviceaccount_secret.py b/roles/lib_openshift/src/ansible/oc_serviceaccount_secret.py new file mode 100644 index 000000000..554d9a6a2 --- /dev/null +++ b/roles/lib_openshift/src/ansible/oc_serviceaccount_secret.py @@ -0,0 +1,29 @@ +# pylint: skip-file +# flake8: noqa + +def main(): + ''' + ansible oc module to manage service account secrets. + ''' + + 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'), + namespace=dict(default=None, required=True, type='str'), + secret=dict(default=None, type='str'), + service_account=dict(required=True, type='str'), + ), + supports_check_mode=True, + ) + + rval = OCServiceAccountSecret.run_ansible(module.params, module.check_mode) + if 'failed' in rval: + module.fail_json(**rval) + + module.exit_json(**rval) + +if __name__ == '__main__': + main() |