summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/src/doc/label
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2017-02-05 13:17:57 -0500
committerGitHub <noreply@github.com>2017-02-05 13:17:57 -0500
commita965c28ab7ca6ac93c70e4a2415316ddaf52812e (patch)
tree7da0c11ef0426553991cd3527d91bcd2854f42c2 /roles/lib_openshift/src/doc/label
parentec0983dc4bc96573e3f7f958aea7040c15c1db81 (diff)
parent4b054d7da5f404dfd8eb238b617e4dcf7dc93b17 (diff)
downloadopenshift-a965c28ab7ca6ac93c70e4a2415316ddaf52812e.tar.gz
openshift-a965c28ab7ca6ac93c70e4a2415316ddaf52812e.tar.bz2
openshift-a965c28ab7ca6ac93c70e4a2415316ddaf52812e.tar.xz
openshift-a965c28ab7ca6ac93c70e4a2415316ddaf52812e.zip
Merge pull request #3249 from kwoodson/oc_label
Adding oc_label to lib_openshift.
Diffstat (limited to 'roles/lib_openshift/src/doc/label')
-rw-r--r--roles/lib_openshift/src/doc/label92
1 files changed, 92 insertions, 0 deletions
diff --git a/roles/lib_openshift/src/doc/label b/roles/lib_openshift/src/doc/label
new file mode 100644
index 000000000..fb3ed2503
--- /dev/null
+++ b/roles/lib_openshift/src/doc/label
@@ -0,0 +1,92 @@
+# flake8: noqa
+# pylint: skip-file
+
+DOCUMENTATION = '''
+---
+module: oc_label
+short_description: Create, modify, and idempotently manage openshift labels.
+description:
+ - Modify openshift labels programmatically.
+options:
+ state:
+ description:
+ - State controls the action that will be taken with resource
+ - 'present' will create or update and object to the desired state
+ - 'absent' will ensure certain labels are removed
+ - 'list' will read the labels
+ - 'add' will insert labels to the already existing labels
+ default: present
+ choices: ["present", "absent", "list", "add"]
+ aliases: []
+ kubeconfig:
+ description:
+ - The path for the kubeconfig file to use for authentication
+ required: false
+ default: /etc/origin/master/admin.kubeconfig
+ aliases: []
+ debug:
+ description:
+ - Turn on debug output.
+ required: false
+ default: False
+ aliases: []
+ kind:
+ description:
+ - The kind of object that can be managed.
+ default: node
+ choices:
+ - node
+ - pod
+ - namespace
+ aliases: []
+ labels:
+ description:
+ - A list of labels for the resource.
+ - Each list consists of a key and a value.
+ - eg, {'key': 'foo', 'value': 'bar'}
+ required: false
+ default: None
+ aliases: []
+ selector:
+ description:
+ - The selector to apply to the resource query
+ required: false
+ default: None
+ aliases: []
+author:
+- "Joel Diaz <jdiaz@redhat.com>"
+extends_documentation_fragment: []
+'''
+
+EXAMPLES = '''
+- name: Add a single label to a node's existing labels
+ oc_label:
+ name: ip-172-31-5-23.ec2.internal
+ state: add
+ kind: node
+ labels:
+ - key: logging-infra-fluentd
+ value: 'true'
+
+- name: remove a label from a node
+ oc_label:
+ name: ip-172-31-5-23.ec2.internal
+ state: absent
+ kind: node
+ labels:
+ - key: color
+ value: blue
+
+- name: Ensure node has these exact labels
+ oc_label:
+ name: ip-172-31-5-23.ec2.internal
+ state: present
+ kind: node
+ labels:
+ - key: color
+ value: green
+ - key: type
+ value: master
+ - key: environment
+ value: production
+'''