mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
parent
86dc3c09ac
commit
115f6f6732
1 changed files with 9 additions and 4 deletions
|
@ -115,14 +115,19 @@ def install(module, tserver):
|
||||||
namespace = module.params['namespace']
|
namespace = module.params['namespace']
|
||||||
|
|
||||||
chartb = chartbuilder.ChartBuilder(chart)
|
chartb = chartbuilder.ChartBuilder(chart)
|
||||||
try:
|
r_matches = (x for x in tserver.list_releases()
|
||||||
|
if x.name == name and x.namespace == namespace)
|
||||||
|
installed_release = next(r_matches, None)
|
||||||
|
if installed_release:
|
||||||
|
if installed_release.chart.metadata.version != chart['version']:
|
||||||
|
tserver.update_release(chartb.get_helm_chart(), False,
|
||||||
|
namespace, name=name, values=values)
|
||||||
|
changed = True
|
||||||
|
else:
|
||||||
tserver.install_release(chartb.get_helm_chart(), namespace,
|
tserver.install_release(chartb.get_helm_chart(), namespace,
|
||||||
dry_run=False, name=name,
|
dry_run=False, name=name,
|
||||||
values=values)
|
values=values)
|
||||||
changed = True
|
changed = True
|
||||||
except grpc._channel._Rendezvous as exc:
|
|
||||||
if "already exists" not in str(exc):
|
|
||||||
raise exc
|
|
||||||
|
|
||||||
return dict(changed=changed)
|
return dict(changed=changed)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue