diff --git a/changelogs/fragments/20241207-add-insecure-skip-tls-verify-to-helm-template.yaml b/changelogs/fragments/20241207-add-insecure-skip-tls-verify-to-helm-template.yaml
new file mode 100644
index 0000000000..2f2526d5bf
--- /dev/null
+++ b/changelogs/fragments/20241207-add-insecure-skip-tls-verify-to-helm-template.yaml
@@ -0,0 +1,3 @@
+---
+minor_changes:
+ - Parameter insecure_registry added to helm_template as equivalent of insecure-skip-tls-verify (https://github.com/ansible-collections/kubernetes.core/pull/805).
diff --git a/docs/kubernetes.core.helm_template_module.rst b/docs/kubernetes.core.helm_template_module.rst
index c89d27e216..983616d3f7 100644
--- a/docs/kubernetes.core.helm_template_module.rst
+++ b/docs/kubernetes.core.helm_template_module.rst
@@ -158,6 +158,26 @@ Parameters
Include custom resource descriptions in rendered templates.
+
diff --git a/plugins/modules/helm_template.py b/plugins/modules/helm_template.py
index b748b15545..16a1131ced 100644
--- a/plugins/modules/helm_template.py
+++ b/plugins/modules/helm_template.py
@@ -72,6 +72,13 @@
- If the directory already exists, it will be overwritten.
required: false
type: path
+ insecure_registry:
+ description:
+ - Skip TLS certificate checks for the chart download
+ required: false
+ type: bool
+ default: false
+ version_added: 5.1.0
release_name:
description:
- Release name to use in rendered templates.
@@ -221,6 +228,7 @@ def template(
dependency_update=None,
disable_hook=None,
output_dir=None,
+ insecure_registry=None,
show_only=None,
release_name=None,
release_namespace=None,
@@ -251,6 +259,9 @@ def template(
if output_dir:
cmd += " --output-dir=" + output_dir
+ if insecure_registry:
+ cmd += " --insecure-skip-tls-verify"
+
if show_only:
for template in show_only:
cmd += " -s " + template
@@ -289,6 +300,7 @@ def main():
include_crds=dict(type="bool", default=False),
release_name=dict(type="str", aliases=["name"]),
output_dir=dict(type="path"),
+ insecure_registry=dict(type="bool", default=False),
release_namespace=dict(type="str"),
release_values=dict(type="dict", default={}, aliases=["values"]),
show_only=dict(type="list", default=[], elements="str"),
@@ -308,6 +320,7 @@ def main():
include_crds = module.params.get("include_crds")
release_name = module.params.get("release_name")
output_dir = module.params.get("output_dir")
+ insecure_registry = module.params.get("insecure_registry")
show_only = module.params.get("show_only")
release_namespace = module.params.get("release_namespace")
release_values = module.params.get("release_values")
@@ -337,6 +350,7 @@ def main():
disable_hook=disable_hook,
release_name=release_name,
output_dir=output_dir,
+ insecure_registry=insecure_registry,
release_namespace=release_namespace,
release_values=release_values,
show_only=show_only,
|