summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/src/doc/label
blob: fb3ed2503d95ca785c6072e485751ada741e61ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
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
'''