task: make helm_home, bin, and kubectl bin configurable
Refs /salt-formulas/salt-formula-helm#2
diff --git a/_states/helm_repos.py b/_states/helm_repos.py
index 88f0894..ee1d556 100644
--- a/_states/helm_repos.py
+++ b/_states/helm_repos.py
@@ -2,7 +2,7 @@
from salt.exceptions import CommandExecutionError
-def managed(name, present={}, absent=[], exclusive=False):
+def managed(name, present={}, absent=[], exclusive=False, helm_home=None):
'''
Ensure the supplied repositories are available to the helm client. If the
`exclusive` flag is set to a truthy value, any extra repositories in the
@@ -17,9 +17,13 @@
absent
A list of repository names to ensure are unregistered from the Helm client
+
exclusive
A boolean flag indicating whether the state should ensure only the
supplied repositories are availabe to the target minion.
+
+ helm_home
+ An optional path to the Helm home directory
'''
ret = {'name': name,
'changes': {},
@@ -30,7 +34,8 @@
result = __salt__['helm.manage_repos'](
present=present,
absent=absent,
- exclusive=exclusive
+ exclusive=exclusive,
+ helm_home=helm_home
)
if result['failed']:
@@ -52,7 +57,7 @@
ret['comment'] = "Failed to add some repositories: %s" % e
return ret
-def updated(name):
+def updated(name, helm_home=None):
'''
Ensure the local Helm repository cache is up to date with each of the
helm client's configured remote chart repositories. Because the `helm repo
@@ -63,6 +68,9 @@
name
The name of the state
+
+ helm_home
+ An optional path to the Helm home directory
'''
ret = {'name': name,
'changes': {},
@@ -71,7 +79,7 @@
output = None
try:
- output = __salt__['helm.update_repos']()
+ output = __salt__['helm.update_repos'](helm_home=helm_home)
except CommandExecutionError as e:
ret['result'] = False
ret['comment'] = "Failed to update repos: %s" % e