summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/src/ansible
diff options
context:
space:
mode:
authorOpenShift Bot <eparis+openshiftbot@redhat.com>2017-03-27 09:52:47 -0500
committerGitHub <noreply@github.com>2017-03-27 09:52:47 -0500
commitf0cdf051ef01978269482a72ae074b822daeea3b (patch)
tree82c5c5585442b03577259b671a1381b499d634b1 /roles/lib_openshift/src/ansible
parentf1db80c12f9271099bf65cb69ad0e2804764b7ef (diff)
parent21646621634bb43eb899b0b178c97d280801f89e (diff)
downloadopenshift-f0cdf051ef01978269482a72ae074b822daeea3b.tar.gz
openshift-f0cdf051ef01978269482a72ae074b822daeea3b.tar.bz2
openshift-f0cdf051ef01978269482a72ae074b822daeea3b.tar.xz
openshift-f0cdf051ef01978269482a72ae074b822daeea3b.zip
Merge pull request #3345 from joelddiaz/oc_user
Merged by openshift-bot
Diffstat (limited to 'roles/lib_openshift/src/ansible')
-rw-r--r--roles/lib_openshift/src/ansible/oc_user.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/roles/lib_openshift/src/ansible/oc_user.py b/roles/lib_openshift/src/ansible/oc_user.py
new file mode 100644
index 000000000..6b1440796
--- /dev/null
+++ b/roles/lib_openshift/src/ansible/oc_user.py
@@ -0,0 +1,34 @@
+# pylint: skip-file
+# flake8: noqa
+
+def main():
+ '''
+ ansible oc module for user
+ '''
+
+ 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'),
+ username=dict(default=None, type='str'),
+ full_name=dict(default=None, type='str'),
+ # setting groups for user data will not populate the
+ # 'groups' field in the user data.
+ # it will call out to the group data and make the user
+ # entry there
+ groups=dict(default=[], type='list'),
+ ),
+ supports_check_mode=True,
+ )
+
+ results = OCUser.run_ansible(module.params, module.check_mode)
+
+ if 'failed' in results:
+ module.fail_json(**results)
+
+ module.exit_json(**results)
+
+if __name__ == '__main__':
+ main()