mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-07-29 10:54:41 +00:00
Fix englist grammar errors and rename modules to helm and helm_info
This commit is contained in:
@@ -27,8 +27,8 @@ Click on the name of a plugin or module to view that content's documentation:
|
|||||||
- [k8s_info](https://docs.ansible.com/ansible/latest/modules/k8s_info_module.html)
|
- [k8s_info](https://docs.ansible.com/ansible/latest/modules/k8s_info_module.html)
|
||||||
- [k8s_scale](https://docs.ansible.com/ansible/latest/modules/k8s_scale_module.html)
|
- [k8s_scale](https://docs.ansible.com/ansible/latest/modules/k8s_scale_module.html)
|
||||||
- [k8s_service](https://docs.ansible.com/ansible/latest/modules/k8s_service_module.html)
|
- [k8s_service](https://docs.ansible.com/ansible/latest/modules/k8s_service_module.html)
|
||||||
- [helm_cli](https://docs.ansible.com/ansible/latest/modules/helm_cli_module.html)
|
- [helm](https://docs.ansible.com/ansible/latest/modules/helm_module.html)
|
||||||
- [helm_cli_info](https://docs.ansible.com/ansible/latest/modules/helm_cli_info_module.html)
|
- [helm_info](https://docs.ansible.com/ansible/latest/modules/helm_info_module.html)
|
||||||
|
|
||||||
## Installation and Usage
|
## Installation and Usage
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
---
|
---
|
||||||
- name: Ensure helm is not install
|
- name: Ensure helm is not installed
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: absent
|
state: absent
|
||||||
with_items:
|
with_items:
|
||||||
- "/tmp/helm"
|
- "/tmp/helm"
|
||||||
|
|
||||||
- name: Check failed if helm is not install
|
- name: Check failed if helm is not installed
|
||||||
include_tasks: test_helm_not_installed.yml
|
include_tasks: test_helm_not_installed.yml
|
||||||
|
|
||||||
- name: "Install {{ helm_version }}"
|
- name: "Install {{ helm_version }}"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Failed test when helm is not install
|
- name: Failed test when helm is not installed
|
||||||
helm_cli:
|
helm:
|
||||||
binary_path: "{{ helm_binary}}_fake"
|
binary_path: "{{ helm_binary}}_fake"
|
||||||
name: test
|
name: test
|
||||||
chart_ref: "{{ chart_test }}"
|
chart_ref: "{{ chart_test }}"
|
||||||
|
|||||||
@@ -6,24 +6,24 @@
|
|||||||
name: "{{ helm_namespace }}"
|
name: "{{ helm_namespace }}"
|
||||||
wait: true
|
wait: true
|
||||||
|
|
||||||
- name: Check helm_cli_info empty
|
- name: Check helm_info empty
|
||||||
helm_cli_info:
|
helm_info:
|
||||||
binary_path: "{{ helm_binary}}"
|
binary_path: "{{ helm_binary }}"
|
||||||
name: test
|
name: test
|
||||||
namespace: "{{ helm_namespace }}"
|
namespace: "{{ helm_namespace }}"
|
||||||
register: empty_info
|
register: empty_info
|
||||||
|
|
||||||
- name: "Assert that no chart are installed with helm_cli_info"
|
- name: "Assert that no charts are installed with helm_info"
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- empty_info.status is undefined
|
- empty_info.status is undefined
|
||||||
|
|
||||||
- name: "Install {{ chart_test }} from {{ source }}"
|
- name: "Install {{ chart_test }} from {{ source }}"
|
||||||
helm_cli:
|
helm:
|
||||||
binary_path: "{{ helm_binary}}"
|
binary_path: "{{ helm_binary }}"
|
||||||
name: test
|
name: test
|
||||||
chart_ref: "{{ chart_source }}"
|
chart_ref: "{{ chart_source }}"
|
||||||
chart_version: "{{ chart_source_version | default(omit)}}"
|
chart_version: "{{ chart_source_version | default(omit) }}"
|
||||||
namespace: "{{ helm_namespace }}"
|
namespace: "{{ helm_namespace }}"
|
||||||
register: install
|
register: install
|
||||||
|
|
||||||
@@ -34,25 +34,25 @@
|
|||||||
- install.status.chart == "{{ chart_test }}-{{ chart_test_version }}"
|
- install.status.chart == "{{ chart_test }}-{{ chart_test_version }}"
|
||||||
- install.status.status | lower == 'deployed'
|
- install.status.status | lower == 'deployed'
|
||||||
|
|
||||||
- name: Check helm_cli_info content
|
- name: Check helm_info content
|
||||||
helm_cli_info:
|
helm_info:
|
||||||
binary_path: "{{ helm_binary}}"
|
binary_path: "{{ helm_binary }}"
|
||||||
name: test
|
name: test
|
||||||
namespace: "{{ helm_namespace }}"
|
namespace: "{{ helm_namespace }}"
|
||||||
register: content_info
|
register: content_info
|
||||||
|
|
||||||
- name: "Assert that {{ chart_test }} is installed from {{ source }} with helm_cli_info"
|
- name: "Assert that {{ chart_test }} is installed from {{ source }} with helm_info"
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- content_info.status.chart == "{{ chart_test }}-{{ chart_test_version }}"
|
- content_info.status.chart == "{{ chart_test }}-{{ chart_test_version }}"
|
||||||
- content_info.status.status | lower == 'deployed'
|
- content_info.status.status | lower == 'deployed'
|
||||||
|
|
||||||
- name: Check idempotency
|
- name: Check idempotency
|
||||||
helm_cli:
|
helm:
|
||||||
binary_path: "{{ helm_binary}}"
|
binary_path: "{{ helm_binary }}"
|
||||||
name: test
|
name: test
|
||||||
chart_ref: "{{ chart_source }}"
|
chart_ref: "{{ chart_source }}"
|
||||||
chart_version: "{{ chart_source_version | default(omit)}}"
|
chart_version: "{{ chart_source_version | default(omit) }}"
|
||||||
namespace: "{{ helm_namespace }}"
|
namespace: "{{ helm_namespace }}"
|
||||||
register: install
|
register: install
|
||||||
|
|
||||||
@@ -64,11 +64,11 @@
|
|||||||
- install.status.status | lower == 'deployed'
|
- install.status.status | lower == 'deployed'
|
||||||
|
|
||||||
- name: "Add vars to {{ chart_test }} from {{ source }}"
|
- name: "Add vars to {{ chart_test }} from {{ source }}"
|
||||||
helm_cli:
|
helm:
|
||||||
binary_path: "{{ helm_binary}}"
|
binary_path: "{{ helm_binary }}"
|
||||||
name: test
|
name: test
|
||||||
chart_ref: "{{ chart_source }}"
|
chart_ref: "{{ chart_source }}"
|
||||||
chart_version: "{{ chart_source_version | default(omit)}}"
|
chart_version: "{{ chart_source_version | default(omit) }}"
|
||||||
namespace: "{{ helm_namespace }}"
|
namespace: "{{ helm_namespace }}"
|
||||||
values: "{{ chart_test_values }}"
|
values: "{{ chart_test_values }}"
|
||||||
register: install
|
register: install
|
||||||
@@ -81,12 +81,12 @@
|
|||||||
- install.status.chart == "{{ chart_test }}-{{ chart_test_version }}"
|
- install.status.chart == "{{ chart_test }}-{{ chart_test_version }}"
|
||||||
- "install.status['values'].revisionHistoryLimit == 0"
|
- "install.status['values'].revisionHistoryLimit == 0"
|
||||||
|
|
||||||
- name: Check idempotency after add vars
|
- name: Check idempotency after adding vars
|
||||||
helm_cli:
|
helm:
|
||||||
binary_path: "{{ helm_binary}}"
|
binary_path: "{{ helm_binary }}"
|
||||||
name: test
|
name: test
|
||||||
chart_ref: "{{ chart_source }}"
|
chart_ref: "{{ chart_source }}"
|
||||||
chart_version: "{{ chart_source_version | default(omit)}}"
|
chart_version: "{{ chart_source_version | default(omit) }}"
|
||||||
namespace: "{{ helm_namespace }}"
|
namespace: "{{ helm_namespace }}"
|
||||||
values: "{{ chart_test_values }}"
|
values: "{{ chart_test_values }}"
|
||||||
register: install
|
register: install
|
||||||
@@ -100,11 +100,11 @@
|
|||||||
- "install.status['values'].revisionHistoryLimit == 0"
|
- "install.status['values'].revisionHistoryLimit == 0"
|
||||||
|
|
||||||
- name: "Remove Vars to {{ chart_test }} from {{ source }}"
|
- name: "Remove Vars to {{ chart_test }} from {{ source }}"
|
||||||
helm_cli:
|
helm:
|
||||||
binary_path: "{{ helm_binary}}"
|
binary_path: "{{ helm_binary }}"
|
||||||
name: test
|
name: test
|
||||||
chart_ref: "{{ chart_source }}"
|
chart_ref: "{{ chart_source }}"
|
||||||
chart_version: "{{ chart_source_version | default(omit)}}"
|
chart_version: "{{ chart_source_version | default(omit) }}"
|
||||||
namespace: "{{ helm_namespace }}"
|
namespace: "{{ helm_namespace }}"
|
||||||
register: install
|
register: install
|
||||||
|
|
||||||
@@ -116,16 +116,16 @@
|
|||||||
- install.status.chart == "{{ chart_test }}-{{ chart_test_version }}"
|
- install.status.chart == "{{ chart_test }}-{{ chart_test_version }}"
|
||||||
- install.status['values'] == {}
|
- install.status['values'] == {}
|
||||||
|
|
||||||
- name: Check idempotency after remove vars
|
- name: Check idempotency after removing vars
|
||||||
helm_cli:
|
helm:
|
||||||
binary_path: "{{ helm_binary}}"
|
binary_path: "{{ helm_binary }}"
|
||||||
name: test
|
name: test
|
||||||
chart_ref: "{{ chart_source }}"
|
chart_ref: "{{ chart_source }}"
|
||||||
chart_version: "{{ chart_source_version | default(omit)}}"
|
chart_version: "{{ chart_source_version | default(omit) }}"
|
||||||
namespace: "{{ helm_namespace }}"
|
namespace: "{{ helm_namespace }}"
|
||||||
register: install
|
register: install
|
||||||
|
|
||||||
- name: Assert idempotency after remove vars
|
- name: Assert idempotency after removing vars
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- install is not changed
|
- install is not changed
|
||||||
@@ -134,11 +134,11 @@
|
|||||||
- install.status['values'] == {}
|
- install.status['values'] == {}
|
||||||
|
|
||||||
- name: "Upgrade {{ chart_test }} from {{ source }}"
|
- name: "Upgrade {{ chart_test }} from {{ source }}"
|
||||||
helm_cli:
|
helm:
|
||||||
binary_path: "{{ helm_binary}}"
|
binary_path: "{{ helm_binary }}"
|
||||||
name: test
|
name: test
|
||||||
chart_ref: "{{ chart_source_upgrade | default(chart_source) }}"
|
chart_ref: "{{ chart_source_upgrade | default(chart_source) }}"
|
||||||
chart_version: "{{ chart_source_version_upgrade | default(omit)}}"
|
chart_version: "{{ chart_source_version_upgrade | default(omit) }}"
|
||||||
namespace: "{{ helm_namespace }}"
|
namespace: "{{ helm_namespace }}"
|
||||||
register: install
|
register: install
|
||||||
|
|
||||||
@@ -150,11 +150,11 @@
|
|||||||
- install.status.chart == "{{ chart_test }}-{{ chart_test_version_upgrade }}"
|
- install.status.chart == "{{ chart_test }}-{{ chart_test_version_upgrade }}"
|
||||||
|
|
||||||
- name: Check idempotency after upgrade
|
- name: Check idempotency after upgrade
|
||||||
helm_cli:
|
helm:
|
||||||
binary_path: "{{ helm_binary}}"
|
binary_path: "{{ helm_binary }}"
|
||||||
name: test
|
name: test
|
||||||
chart_ref: "{{ chart_source_upgrade | default(chart_source) }}"
|
chart_ref: "{{ chart_source_upgrade | default(chart_source) }}"
|
||||||
chart_version: "{{ chart_source_version_upgrade | default(omit)}}"
|
chart_version: "{{ chart_source_version_upgrade | default(omit) }}"
|
||||||
namespace: "{{ helm_namespace }}"
|
namespace: "{{ helm_namespace }}"
|
||||||
register: install
|
register: install
|
||||||
|
|
||||||
@@ -166,21 +166,21 @@
|
|||||||
- install.status.chart == "{{ chart_test }}-{{ chart_test_version_upgrade }}"
|
- install.status.chart == "{{ chart_test }}-{{ chart_test_version_upgrade }}"
|
||||||
|
|
||||||
- name: "Remove {{ chart_test }} from {{ source }}"
|
- name: "Remove {{ chart_test }} from {{ source }}"
|
||||||
helm_cli:
|
helm:
|
||||||
binary_path: "{{ helm_binary}}"
|
binary_path: "{{ helm_binary }}"
|
||||||
state: absent
|
state: absent
|
||||||
name: test
|
name: test
|
||||||
namespace: "{{ helm_namespace }}"
|
namespace: "{{ helm_namespace }}"
|
||||||
register: install
|
register: install
|
||||||
|
|
||||||
- name: "Assert that {{ chart_test }} chart is remove from {{ source }}"
|
- name: "Assert that {{ chart_test }} chart is removed from {{ source }}"
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- install is changed
|
- install is changed
|
||||||
|
|
||||||
- name: Check idempotency after remove
|
- name: Check idempotency after remove
|
||||||
helm_cli:
|
helm:
|
||||||
binary_path: "{{ helm_binary}}"
|
binary_path: "{{ helm_binary }}"
|
||||||
state: absent
|
state: absent
|
||||||
name: test
|
name: test
|
||||||
namespace: "{{ helm_namespace }}"
|
namespace: "{{ helm_namespace }}"
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: ClusterRoleBinding
|
|
||||||
metadata:
|
|
||||||
name: tiller
|
|
||||||
roleRef:
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
||||||
kind: ClusterRole
|
|
||||||
name: "{{ tiller_cluster_role }}"
|
|
||||||
subjects:
|
|
||||||
- kind: ServiceAccount
|
|
||||||
name: tiller
|
|
||||||
namespace: "{{ tiller_namespace }}"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
---
|
|
||||||
kind: ServiceAccount
|
|
||||||
apiVersion: v1
|
|
||||||
metadata:
|
|
||||||
name: tiller
|
|
||||||
namespace: "{{ tiller_namespace }}"
|
|
||||||
@@ -12,7 +12,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = '''
|
||||||
---
|
---
|
||||||
module: helm_cli
|
module: helm
|
||||||
|
|
||||||
short_description: Manages Kubernetes packages with the Helm package manager
|
short_description: Manages Kubernetes packages with the Helm package manager
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ EXAMPLES = '''
|
|||||||
shell: "helm repo add stable https://kubernetes-charts.storage.googleapis.com"
|
shell: "helm repo add stable 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_cli:
|
helm:
|
||||||
name: test
|
name: test
|
||||||
chart_ref: stable/grafana
|
chart_ref: stable/grafana
|
||||||
release_namespace: monitoring
|
release_namespace: monitoring
|
||||||
@@ -146,14 +146,14 @@ 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_cli:
|
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_cli:
|
helm:
|
||||||
name: test
|
name: test
|
||||||
state: absent
|
state: absent
|
||||||
wait: true
|
wait: true
|
||||||
@@ -165,14 +165,14 @@ EXAMPLES = '''
|
|||||||
dest: /tmp/helm_repo
|
dest: /tmp/helm_repo
|
||||||
|
|
||||||
- name: Deploy Grafana chart from local path
|
- name: Deploy Grafana chart from local path
|
||||||
helm_cli:
|
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_cli:
|
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
|
||||||
@@ -12,7 +12,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = '''
|
||||||
---
|
---
|
||||||
module: helm_cli_info
|
module: helm_info
|
||||||
short_description: Get informations from Helm package deployed inside the cluster
|
short_description: Get informations from Helm package deployed inside the cluster
|
||||||
description:
|
description:
|
||||||
- Get informations (values, states, ...) from Helm package deployed inside the cluster
|
- Get informations (values, states, ...) from Helm package deployed inside the cluster
|
||||||
@@ -55,7 +55,7 @@ options:
|
|||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- name: Deploy latest version of Grafana chart inside monitoring namespace
|
- name: Deploy latest version of Grafana chart inside monitoring namespace
|
||||||
helm_cli_info:
|
helm_info:
|
||||||
name: test
|
name: test
|
||||||
release_namespace: monitoring
|
release_namespace: monitoring
|
||||||
'''
|
'''
|
||||||
Reference in New Issue
Block a user