From ac9aecc926293ba2138b3fed0aa04288ee1ef970 Mon Sep 17 00:00:00 2001 From: Ivan Horvath Date: Thu, 23 Mar 2017 10:01:01 -0400 Subject: first step in ocimage --- roles/lib_openshift/src/doc/image | 92 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 roles/lib_openshift/src/doc/image (limited to 'roles/lib_openshift/src/doc/image') diff --git a/roles/lib_openshift/src/doc/image b/roles/lib_openshift/src/doc/image new file mode 100644 index 000000000..fb3ed2503 --- /dev/null +++ b/roles/lib_openshift/src/doc/image @@ -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 " +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 +''' -- cgit v1.2.3 From 8cc12c32d35ae0a86f13110d6ea9bdb6a411bbc9 Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Thu, 23 Mar 2017 16:24:20 -0400 Subject: Fixing up test cases, linting, and added a return. --- roles/lib_openshift/src/doc/image | 71 +++++++++++++-------------------------- 1 file changed, 24 insertions(+), 47 deletions(-) (limited to 'roles/lib_openshift/src/doc/image') diff --git a/roles/lib_openshift/src/doc/image b/roles/lib_openshift/src/doc/image index fb3ed2503..8a5507ca4 100644 --- a/roles/lib_openshift/src/doc/image +++ b/roles/lib_openshift/src/doc/image @@ -11,12 +11,10 @@ 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 + - 'present' will create. Does _not_ support update. - 'list' will read the labels - - 'add' will insert labels to the already existing labels default: present - choices: ["present", "absent", "list", "add"] + choices: ["present", "list"] aliases: [] kubeconfig: description: @@ -30,63 +28,42 @@ options: required: false default: False aliases: [] - kind: + registry_url: description: - - The kind of object that can be managed. - default: node - choices: - - node - - pod - - namespace + - The url for the registry so that openshift can pull the image + required: false + default: None aliases: [] - labels: + image_name: description: - - A list of labels for the resource. - - Each list consists of a key and a value. - - eg, {'key': 'foo', 'value': 'bar'} + - The name of the image being imported required: false - default: None + default: False aliases: [] - selector: + image_tag: description: - - The selector to apply to the resource query + - The tag of the image being imported required: false default: None aliases: [] author: -- "Joel Diaz " +- "Ivan Horvath" 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: Get an imagestream + oc_image: + name: php55 + state: list + register: imageout -- name: Ensure node has these exact labels - oc_label: - name: ip-172-31-5-23.ec2.internal +- name: create an imagestream + oc_image: state: present - kind: node - labels: - - key: color - value: green - - key: type - value: master - - key: environment - value: production + image_name: php55 + image_tag: int + registry_url: registry.example.com + namespace: default + register: imageout ''' -- cgit v1.2.3 From 58f11324d9f0da8975d2a45516d0aeadd1bb0971 Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Thu, 23 Mar 2017 17:31:17 -0400 Subject: Adding namespace to doc. --- roles/lib_openshift/src/doc/image | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'roles/lib_openshift/src/doc/image') diff --git a/roles/lib_openshift/src/doc/image b/roles/lib_openshift/src/doc/image index 8a5507ca4..18cf4e168 100644 --- a/roles/lib_openshift/src/doc/image +++ b/roles/lib_openshift/src/doc/image @@ -3,7 +3,7 @@ DOCUMENTATION = ''' --- -module: oc_label +module: oc_image short_description: Create, modify, and idempotently manage openshift labels. description: - Modify openshift labels programmatically. @@ -22,6 +22,12 @@ options: required: false default: /etc/origin/master/admin.kubeconfig aliases: [] + namespace: + description: + - The namespace where this object lives + required: false + default: default + aliases: [] debug: description: - Turn on debug output. -- cgit v1.2.3