summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/src/ansible/oc_group.py
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2017-03-17 16:03:49 -0400
committerKenny Woodson <kwoodson@redhat.com>2017-03-20 11:45:49 -0400
commit171bd68cac5d19ba6178e9288a85ef122e6fbd1a (patch)
tree9f7225c192f50ed8acd4af573c81fbbc9f9afe68 /roles/lib_openshift/src/ansible/oc_group.py
parentb6aa824eb212ff968cc4b925bb32c05ef2ebd61d (diff)
downloadopenshift-171bd68cac5d19ba6178e9288a85ef122e6fbd1a.tar.gz
openshift-171bd68cac5d19ba6178e9288a85ef122e6fbd1a.tar.bz2
openshift-171bd68cac5d19ba6178e9288a85ef122e6fbd1a.tar.xz
openshift-171bd68cac5d19ba6178e9288a85ef122e6fbd1a.zip
Adding oc_group to lib_openshift
Diffstat (limited to 'roles/lib_openshift/src/ansible/oc_group.py')
-rw-r--r--roles/lib_openshift/src/ansible/oc_group.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/roles/lib_openshift/src/ansible/oc_group.py b/roles/lib_openshift/src/ansible/oc_group.py
new file mode 100644
index 000000000..9294286d6
--- /dev/null
+++ b/roles/lib_openshift/src/ansible/oc_group.py
@@ -0,0 +1,32 @@
+# pylint: skip-file
+# flake8: noqa
+
+#pylint: disable=too-many-branches
+def main():
+ '''
+ ansible oc module for group
+ '''
+
+ 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'),
+ name=dict(default=None, type='str'),
+ namespace=dict(default='default', type='str'),
+ # addind users to a group is handled through the oc_users module
+ #users=dict(default=None, type='list'),
+ ),
+ supports_check_mode=True,
+ )
+
+ rval = OCGroup.run_ansible(module.params, module.check_mode)
+
+ if 'failed' in rval:
+ return module.fail_json(**rval)
+
+ return module.exit_json(**rval)
+
+if __name__ == '__main__':
+ main()