From 4b054d7da5f404dfd8eb238b617e4dcf7dc93b17 Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Thu, 2 Feb 2017 22:21:23 -0500 Subject: Doc enhancements. --- roles/lib_openshift/src/doc/label | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) (limited to 'roles/lib_openshift/src/doc') diff --git a/roles/lib_openshift/src/doc/label b/roles/lib_openshift/src/doc/label index e206d0d06..fb3ed2503 100644 --- a/roles/lib_openshift/src/doc/label +++ b/roles/lib_openshift/src/doc/label @@ -10,7 +10,11 @@ description: options: state: description: - - State represents whether to create, modify, delete, or list + - 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: [] @@ -37,7 +41,9 @@ options: aliases: [] labels: description: - - A list of labels to for the resource. + - 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: [] @@ -53,7 +59,7 @@ extends_documentation_fragment: [] ''' EXAMPLES = ''' -- name: Add label to node +- name: Add a single label to a node's existing labels oc_label: name: ip-172-31-5-23.ec2.internal state: add @@ -61,4 +67,26 @@ EXAMPLES = ''' 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 ''' -- cgit v1.2.3