This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
helm_plugin and helm_plugin_info: new module
Signed-off-by: Abhijeet Kasurde <[email protected]>
- Loading branch information
Showing
7 changed files
with
534 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
- name: Install env plugin in check mode | ||
helm_plugin: | ||
binary_path: "{{ helm_binary }}" | ||
namespace: "{{ helm_namespace }}" | ||
state: present | ||
plugin_path: https://github.com/adamreese/helm-env | ||
register: check_install_env | ||
check_mode: true | ||
|
||
- assert: | ||
that: | ||
- check_install_env.changed | ||
|
||
- name: Install env plugin | ||
helm_plugin: | ||
binary_path: "{{ helm_binary }}" | ||
namespace: "{{ helm_namespace }}" | ||
state: present | ||
plugin_path: https://github.com/adamreese/helm-env | ||
register: install_env | ||
|
||
- assert: | ||
that: | ||
- install_env.changed | ||
|
||
- name: Gather info about all plugin | ||
helm_plugin_info: | ||
binary_path: "{{ helm_binary }}" | ||
namespace: "{{ helm_namespace }}" | ||
register: plugin_info | ||
|
||
- assert: | ||
that: | ||
- plugin_info.plugin_list is defined | ||
|
||
- name: Install env plugin again | ||
helm_plugin: | ||
binary_path: "{{ helm_binary }}" | ||
namespace: "{{ helm_namespace }}" | ||
state: present | ||
plugin_path: https://github.com/adamreese/helm-env | ||
register: install_env | ||
|
||
- assert: | ||
that: | ||
- not install_env.changed | ||
|
||
- name: Uninstall env plugin in check mode | ||
helm_plugin: | ||
binary_path: "{{ helm_binary }}" | ||
namespace: "{{ helm_namespace }}" | ||
state: absent | ||
plugin_name: env | ||
register: check_uninstall_env | ||
check_mode: true | ||
|
||
- assert: | ||
that: | ||
- check_uninstall_env.changed | ||
|
||
- name: Uninstall env plugin | ||
helm_plugin: | ||
binary_path: "{{ helm_binary }}" | ||
namespace: "{{ helm_namespace }}" | ||
state: absent | ||
plugin_name: env | ||
register: uninstall_env | ||
|
||
- assert: | ||
that: | ||
- uninstall_env.changed | ||
|
||
- name: Uninstall env plugin again | ||
helm_plugin: | ||
binary_path: "{{ helm_binary }}" | ||
namespace: "{{ helm_namespace }}" | ||
state: absent | ||
plugin_name: env | ||
register: uninstall_env | ||
|
||
- assert: | ||
that: | ||
- not uninstall_env.changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# Copyright: (c) 2020, Ansible Project | ||
# Copyright: (c) 2020, Red Hat Inc. | ||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
|
||
# Options for common Helm modules | ||
|
||
from __future__ import (absolute_import, division, print_function) | ||
__metaclass__ = type | ||
|
||
|
||
class ModuleDocFragment(object): | ||
|
||
DOCUMENTATION = r''' | ||
options: | ||
binary_path: | ||
description: | ||
- The path of a helm binary to use. | ||
required: false | ||
type: path | ||
context: | ||
description: | ||
- Helm option to specify which kubeconfig context to use. | ||
- If the value is not specified in the task, the value of environment variable C(K8S_AUTH_CONTEXT) will be used instead. | ||
type: str | ||
aliases: [ kube_context ] | ||
kubeconfig: | ||
description: | ||
- Helm option to specify kubeconfig path to use. | ||
- If the value is not specified in the task, the value of environment variable C(K8S_AUTH_KUBECONFIG) will be used instead. | ||
type: path | ||
aliases: [ kubeconfig_path] | ||
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.