Support template param in other collections (#154)

* Support template param in other collections

The action plugin for k8s does a collection name check for the template
param, but it's missing redhat.openshift and community.kubernetes.

* Add changelog fragment

* Fix test
This commit is contained in:
Mike Graves
2021-06-29 08:41:33 -04:00
committed by GitHub
parent abcc3e884c
commit 8c7b302916
3 changed files with 6 additions and 3 deletions

View File

@@ -0,0 +1,3 @@
---
bugfixes:
- support the ``template`` param in all collections depending on kubernetes.core (https://github.com/ansible-collections/kubernetes.core/pull/154).

View File

@@ -22,7 +22,7 @@
assert:
that:
- r.failed
- "'is only supported parameter for' in r.msg"
- "'is only a supported parameter for' in r.msg"
- name: Specify both definition and template
kubernetes.core.k8s:

View File

@@ -126,8 +126,8 @@ class ActionModule(ActionBase):
def load_template(self, template, new_module_args, task_vars):
# template is only supported by k8s module.
if self._task.action not in ('k8s', 'kubernetes.core.k8s', 'community.okd.k8s'):
raise AnsibleActionFail("'template' is only supported parameter for 'k8s' module.")
if self._task.action not in ('k8s', 'kubernetes.core.k8s', 'community.okd.k8s', 'redhat.openshift.k8s', 'community.kubernetes.k8s'):
raise AnsibleActionFail("'template' is only a supported parameter for the 'k8s' module.")
template_params = []
if isinstance(template, string_types) or isinstance(template, dict):