Minor doc fixes (#114)

* Spelling fixes
* Documentation update
* Example update to use FQCN

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde
2020-06-05 11:32:26 +05:30
committed by GitHub
parent 01399ea840
commit 3078131db5
11 changed files with 69 additions and 69 deletions

View File

@@ -42,7 +42,7 @@ options:
description: description:
- Use to specify an object namespace. Useful when creating, deleting, or discovering an object without - Use to specify an object namespace. Useful when creating, deleting, or discovering an object without
providing a full resource definition. Use in conjunction with I(api_version), I(kind), and I(name) providing a full resource definition. Use in conjunction with I(api_version), I(kind), and I(name)
to identify a specfic object. If I(resource definition) is provided, the I(metadata.namespace) value to identify a specific object. If I(resource definition) is provided, the I(metadata.namespace) value
from the I(resource_definition) will override this option. from the I(resource_definition) will override this option.
type: str type: str
''' '''

View File

@@ -7,7 +7,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r'''
--- ---
module: helm module: helm
@@ -120,9 +120,9 @@ options:
type: str type: str
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Create helm namespace as HELM 3 doesn't create it automatically - name: Create helm namespace as HELM 3 doesn't create it automatically
k8s: community.kubernetes.k8s:
api_version: v1 api_version: v1
kind: Namespace kind: Namespace
name: "monitoring" name: "monitoring"
@@ -130,12 +130,12 @@ EXAMPLES = '''
# From repository # From repository
- name: Add stable chart repo - name: Add stable chart repo
helm_repository: community.kubernetes.helm_repository:
name: stable name: stable
repo_url: "https://kubernetes-charts.storage.googleapis.com" repo_url: "https://kubernetes-charts.storage.googleapis.com"
- name: Deploy latest version of Grafana chart inside monitoring namespace with values - name: Deploy latest version of Grafana chart inside monitoring namespace with values
helm: community.kubernetes.helm:
name: test name: test
chart_ref: stable/grafana chart_ref: stable/grafana
release_namespace: monitoring release_namespace: monitoring
@@ -143,39 +143,39 @@ EXAMPLES = '''
replicas: 2 replicas: 2
- name: Deploy Grafana chart on 5.0.12 with values loaded from template - name: Deploy Grafana chart on 5.0.12 with values loaded from template
helm: community.kubernetes.helm:
name: test name: test
chart_ref: stable/grafana chart_ref: stable/grafana
chart_version: 5.0.12 chart_version: 5.0.12
values: "{{ lookup('template', 'somefile.yaml') | from_yaml }}" values: "{{ lookup('template', 'somefile.yaml') | from_yaml }}"
- name: Remove test release and waiting suppression ending - name: Remove test release and waiting suppression ending
helm: community.kubernetes.helm:
name: test name: test
state: absent state: absent
wait: true wait: true
# From git # From git
- name: Git clone stable repo on HEAD - name: Git clone stable repo on HEAD
git: ansible.builtin.git:
repo: "http://github.com/helm/charts.git" repo: "http://github.com/helm/charts.git"
dest: /tmp/helm_repo dest: /tmp/helm_repo
- name: Deploy Grafana chart from local path - name: Deploy Grafana chart from local path
helm: community.kubernetes.helm:
name: test name: test
chart_ref: /tmp/helm_repo/stable/grafana chart_ref: /tmp/helm_repo/stable/grafana
release_namespace: monitoring release_namespace: monitoring
# From url # From url
- name: Deploy Grafana chart on 5.0.12 from url - name: Deploy Grafana chart on 5.0.12 from url
helm: community.kubernetes.helm:
name: test name: test
chart_ref: "https://kubernetes-charts.storage.googleapis.com/grafana-5.0.12.tgz" chart_ref: "https://kubernetes-charts.storage.googleapis.com/grafana-5.0.12.tgz"
release_namespace: monitoring release_namespace: monitoring
''' '''
RETURN = """ RETURN = r"""
status: status:
type: complex type: complex
description: A dictionary of status output description: A dictionary of status output

View File

@@ -7,11 +7,11 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r'''
--- ---
module: helm_info module: helm_info
short_description: Get informations from Helm package deployed inside the cluster short_description: Get information from Helm package deployed inside the cluster
version_added: "0.11.0" version_added: "0.11.0"
@@ -23,7 +23,7 @@ requirements:
- "yaml (https://pypi.org/project/PyYAML/)" - "yaml (https://pypi.org/project/PyYAML/)"
description: description:
- Get informations (values, states, ...) from Helm package deployed inside the cluster - Get information (values, states, ...) from Helm package deployed inside the cluster
options: options:
binary_path: binary_path:
@@ -56,14 +56,14 @@ options:
aliases: [ kubeconfig ] aliases: [ kubeconfig ]
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Deploy latest version of Grafana chart inside monitoring namespace - name: Deploy latest version of Grafana chart inside monitoring namespace
helm_info: community.kubernetes.helm_info:
name: test name: test
release_namespace: monitoring release_namespace: monitoring
''' '''
RETURN = """ RETURN = r"""
status: status:
type: complex type: complex
description: A dictionary of status output description: A dictionary of status output

View File

@@ -7,7 +7,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r'''
--- ---
module: helm_repository module: helm_repository
@@ -59,21 +59,21 @@ options:
repo_state: repo_state:
choices: ['present', 'absent'] choices: ['present', 'absent']
description: description:
- Desirated state of repositoriy. - Desirated state of repository.
required: false required: false
default: present default: present
aliases: [ state ] aliases: [ state ]
type: str type: str
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Add default repository - name: Add default repository
helm_repository: community.kubernetes.helm_repository:
name: stable name: stable
repo_url: https://kubernetes-charts.storage.googleapis.com repo_url: https://kubernetes-charts.storage.googleapis.com
''' '''
RETURN = ''' # ''' RETURN = r''' # '''
import traceback import traceback

View File

@@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r'''
module: k8s module: k8s
@@ -147,16 +147,16 @@ requirements:
- "PyYAML >= 3.11" - "PyYAML >= 3.11"
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Create a k8s namespace - name: Create a k8s namespace
k8s: community.kubernetes.k8s:
name: testing name: testing
api_version: v1 api_version: v1
kind: Namespace kind: Namespace
state: present state: present
- name: Create a Service object from an inline definition - name: Create a Service object from an inline definition
k8s: community.kubernetes.k8s:
state: present state: present
definition: definition:
apiVersion: v1 apiVersion: v1
@@ -178,7 +178,7 @@ EXAMPLES = '''
port: 8000 port: 8000
- name: Remove an existing Service object - name: Remove an existing Service object
k8s: community.kubernetes.k8s:
state: absent state: absent
api_version: v1 api_version: v1
kind: Service kind: Service
@@ -188,31 +188,31 @@ EXAMPLES = '''
# Passing the object definition from a file # Passing the object definition from a file
- name: Create a Deployment by reading the definition from a local file - name: Create a Deployment by reading the definition from a local file
k8s: community.kubernetes.k8s:
state: present state: present
src: /testing/deployment.yml src: /testing/deployment.yml
- name: >- - name: >-
Read definition file from the Ansible controller file system. Read definition file from the Ansible controller file system.
If the definition file has been encrypted with Ansible Vault it will automatically be decrypted. If the definition file has been encrypted with Ansible Vault it will automatically be decrypted.
k8s: community.kubernetes.k8s:
state: present state: present
definition: "{{ lookup('file', '/testing/deployment.yml') | from_yaml }}" definition: "{{ lookup('file', '/testing/deployment.yml') | from_yaml }}"
- name: Read definition file from the Ansible controller file system after Jinja templating - name: Read definition file from the Ansible controller file system after Jinja templating
k8s: community.kubernetes.k8s:
state: present state: present
definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}" definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}"
- name: fail on validation errors - name: fail on validation errors
k8s: community.kubernetes.k8s:
state: present state: present
definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}" definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}"
validate: validate:
fail_on_error: yes fail_on_error: yes
- name: warn on validation errors, check for unexpected properties - name: warn on validation errors, check for unexpected properties
k8s: community.kubernetes.k8s:
state: present state: present
definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}" definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}"
validate: validate:
@@ -220,7 +220,7 @@ EXAMPLES = '''
strict: yes strict: yes
''' '''
RETURN = ''' RETURN = r'''
result: result:
description: description:
- The created, patched, or otherwise present object. Will be empty in the case of a deletion. - The created, patched, or otherwise present object. Will be empty in the case of a deletion.

View File

@@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r'''
module: k8s_auth module: k8s_auth
@@ -75,7 +75,7 @@ requirements:
- requests-oauthlib - requests-oauthlib
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- hosts: localhost - hosts: localhost
module_defaults: module_defaults:
group/k8s: group/k8s:
@@ -88,7 +88,7 @@ EXAMPLES = '''
- include_vars: k8s_passwords.yml - include_vars: k8s_passwords.yml
- name: Log in (obtain access token) - name: Log in (obtain access token)
k8s_auth: community.kubernetes.k8s_auth:
username: admin username: admin
password: "{{ k8s_admin_password }}" password: "{{ k8s_admin_password }}"
register: k8s_auth_results register: k8s_auth_results
@@ -96,7 +96,7 @@ EXAMPLES = '''
# Previous task provides the token/api_key, while all other parameters # Previous task provides the token/api_key, while all other parameters
# are taken from module_defaults # are taken from module_defaults
- name: Get a list of all pods from any namespace - name: Get a list of all pods from any namespace
k8s_info: community.kubernetes.k8s_info:
api_key: "{{ k8s_auth_results.k8s_auth.api_key }}" api_key: "{{ k8s_auth_results.k8s_auth.api_key }}"
kind: Pod kind: Pod
register: pod_list register: pod_list
@@ -104,7 +104,7 @@ EXAMPLES = '''
always: always:
- name: If login succeeded, try to log out (revoke access token) - name: If login succeeded, try to log out (revoke access token)
when: k8s_auth_results.k8s_auth.api_key is defined when: k8s_auth_results.k8s_auth.api_key is defined
k8s_auth: community.kubernetes.k8s_auth:
state: absent state: absent
api_key: "{{ k8s_auth_results.k8s_auth.api_key }}" api_key: "{{ k8s_auth_results.k8s_auth.api_key }}"
''' '''
@@ -112,7 +112,7 @@ EXAMPLES = '''
# Returned value names need to match k8s modules parameter names, to make it # Returned value names need to match k8s modules parameter names, to make it
# easy to pass returned values of k8s_auth to other k8s modules. # easy to pass returned values of k8s_auth to other k8s modules.
# Discussion: https://github.com/ansible/ansible/pull/50807#discussion_r248827899 # Discussion: https://github.com/ansible/ansible/pull/50807#discussion_r248827899
RETURN = ''' RETURN = r'''
k8s_auth: k8s_auth:
description: Kubernetes authentication facts. description: Kubernetes authentication facts.
returned: success returned: success

View File

@@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r'''
module: k8s_exec module: k8s_exec
@@ -58,15 +58,15 @@ options:
required: yes required: yes
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Execute a command - name: Execute a command
k8s_exec: community.kubernetes.k8s_exec:
namespace: myproject namespace: myproject
pod: zuul-scheduler pod: zuul-scheduler
command: zuul-scheduler full-reconfigure command: zuul-scheduler full-reconfigure
''' '''
RETURN = ''' RETURN = r'''
result: result:
description: description:
- The command object - The command object

View File

@@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r'''
module: k8s_info module: k8s_info
short_description: Describe Kubernetes (K8s) objects short_description: Describe Kubernetes (K8s) objects
@@ -68,7 +68,7 @@ requirements:
- "PyYAML >= 3.11" - "PyYAML >= 3.11"
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Get an existing Service object - name: Get an existing Service object
k8s_info: k8s_info:
api_version: v1 api_version: v1
@@ -103,7 +103,7 @@ EXAMPLES = '''
- status.phase=Running - status.phase=Running
''' '''
RETURN = ''' RETURN = r'''
resources: resources:
description: description:
- The object(s) that exists - The object(s) that exists

View File

@@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r'''
module: k8s_log module: k8s_log
short_description: Fetch logs from Kubernetes resources short_description: Fetch logs from Kubernetes resources
@@ -48,7 +48,7 @@ options:
namespace: namespace:
description: description:
- Use to specify an object namespace. Use in conjunction with I(api_version), I(kind), and I(name) - Use to specify an object namespace. Use in conjunction with I(api_version), I(kind), and I(name)
to identify a specfic object. to identify a specific object.
type: str type: str
name: name:
description: description:
@@ -76,16 +76,16 @@ requirements:
- "PyYAML >= 3.11" - "PyYAML >= 3.11"
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Get a log from a Pod - name: Get a log from a Pod
k8s_log: community.kubernetes.k8s_log:
name: example-1 name: example-1
namespace: testing namespace: testing
register: log register: log
# This will get the log from the first Pod found matching the selector # This will get the log from the first Pod found matching the selector
- name: Log a Pod matching a label selector - name: Log a Pod matching a label selector
k8s_log: community.kubernetes.k8s_log:
namespace: testing namespace: testing
label_selectors: label_selectors:
- app=example - app=example
@@ -93,7 +93,7 @@ EXAMPLES = '''
# This will get the log from a single Pod managed by this Deployment # This will get the log from a single Pod managed by this Deployment
- name: Get a log from a Deployment - name: Get a log from a Deployment
k8s_log: community.kubernetes.k8s_log:
api_version: apps/v1 api_version: apps/v1
kind: Deployment kind: Deployment
namespace: testing namespace: testing
@@ -102,7 +102,7 @@ EXAMPLES = '''
# This will get the log from a single Pod managed by this DeploymentConfig # This will get the log from a single Pod managed by this DeploymentConfig
- name: Get a log from a DeploymentConfig - name: Get a log from a DeploymentConfig
k8s_log: community.kubernetes.k8s_log:
api_version: apps.openshift.io/v1 api_version: apps.openshift.io/v1
kind: DeploymentConfig kind: DeploymentConfig
namespace: testing namespace: testing
@@ -110,7 +110,7 @@ EXAMPLES = '''
register: log register: log
''' '''
RETURN = ''' RETURN = r'''
log: log:
type: str type: str
description: description:

View File

@@ -10,7 +10,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r'''
module: k8s_scale module: k8s_scale
@@ -36,9 +36,9 @@ requirements:
- "PyYAML >= 3.11" - "PyYAML >= 3.11"
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Scale deployment up, and extend timeout - name: Scale deployment up, and extend timeout
k8s_scale: community.kubernetes.k8s_scale:
api_version: v1 api_version: v1
kind: Deployment kind: Deployment
name: elastic name: elastic
@@ -47,7 +47,7 @@ EXAMPLES = '''
wait_timeout: 60 wait_timeout: 60
- name: Scale deployment down when current replicas match - name: Scale deployment down when current replicas match
k8s_scale: community.kubernetes.k8s_scale:
api_version: v1 api_version: v1
kind: Deployment kind: Deployment
name: elastic name: elastic
@@ -56,7 +56,7 @@ EXAMPLES = '''
replicas: 2 replicas: 2
- name: Increase job parallelism - name: Increase job parallelism
k8s_scale: community.kubernetes.k8s_scale:
api_version: batch/v1 api_version: batch/v1
kind: job kind: job
name: pi-with-timeout name: pi-with-timeout
@@ -66,25 +66,25 @@ EXAMPLES = '''
# Match object using local file or inline definition # Match object using local file or inline definition
- name: Scale deployment based on a file from the local filesystem - name: Scale deployment based on a file from the local filesystem
k8s_scale: community.kubernetes.k8s_scale:
src: /myproject/elastic_deployment.yml src: /myproject/elastic_deployment.yml
replicas: 3 replicas: 3
wait: no wait: no
- name: Scale deployment based on a template output - name: Scale deployment based on a template output
k8s_scale: community.kubernetes.k8s_scale:
resource_definition: "{{ lookup('template', '/myproject/elastic_deployment.yml') | from_yaml }}" resource_definition: "{{ lookup('template', '/myproject/elastic_deployment.yml') | from_yaml }}"
replicas: 3 replicas: 3
wait: no wait: no
- name: Scale deployment based on a file from the Ansible controller filesystem - name: Scale deployment based on a file from the Ansible controller filesystem
k8s_scale: community.kubernetes.k8s_scale:
resource_definition: "{{ lookup('file', '/myproject/elastic_deployment.yml') | from_yaml }}" resource_definition: "{{ lookup('file', '/myproject/elastic_deployment.yml') | from_yaml }}"
replicas: 3 replicas: 3
wait: no wait: no
''' '''
RETURN = ''' RETURN = r'''
result: result:
description: description:
- If a change was made, will return the patched object, otherwise returns the existing object. - If a change was made, will return the patched object, otherwise returns the existing object.

View File

@@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r'''
module: k8s_service module: k8s_service
@@ -121,9 +121,9 @@ requirements:
- openshift >= 0.6.2 - openshift >= 0.6.2
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Expose https port with ClusterIP - name: Expose https port with ClusterIP
k8s_service: community.kubernetes.k8s_service:
state: present state: present
name: test-https name: test-https
namespace: default namespace: default
@@ -134,7 +134,7 @@ EXAMPLES = '''
key: special key: special
- name: Expose https port with ClusterIP using spec - name: Expose https port with ClusterIP using spec
k8s_service: community.kubernetes.k8s_service:
state: present state: present
name: test-https name: test-https
namespace: default namespace: default
@@ -147,7 +147,7 @@ EXAMPLES = '''
key: special key: special
''' '''
RETURN = ''' RETURN = r'''
result: result:
description: description:
- The created, patched, or otherwise present Service object. Will be empty in the case of a deletion. - The created, patched, or otherwise present Service object. Will be empty in the case of a deletion.