From 688cff4ea856b99af5cf4a3e9ad042df54a336f9 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Thu, 19 Aug 2021 20:22:46 +0530 Subject: [PATCH] k8s: document multi template feature (#209) k8s: document multi template feature SUMMARY template parameter allows user to provide multiple template files. Fixes: #207 Signed-off-by: Abhijeet Kasurde akasurde@redhat.com ISSUE TYPE Docs Pull Request COMPONENT NAME plugins/modules/k8s.py Reviewed-by: None Reviewed-by: Mike Graves Reviewed-by: None --- plugins/modules/k8s.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/modules/k8s.py b/plugins/modules/k8s.py index d2fb02a5..e7bbd7e4 100644 --- a/plugins/modules/k8s.py +++ b/plugins/modules/k8s.py @@ -108,6 +108,7 @@ options: description: - Provide a valid YAML template definition file for an object when creating or updating. - Value can be provided as string or dictionary. + - The parameter accepts multiple template files. Added in version 2.0.0. - Mutually exclusive with C(src) and C(resource_definition). - Template files needs to be present on the Ansible Controller's file system. - Additional parameters can be specified using dictionary. @@ -214,6 +215,15 @@ EXAMPLES = r''' variable_start_string: '[[' variable_end_string: ']]' +- name: Read multiple definition template file from the Ansible controller file system + kubernetes.core.k8s: + state: present + template: + - path: '/testing/deployment_one.j2' + - path: '/testing/deployment_two.j2' + variable_start_string: '[[' + variable_end_string: ']]' + - name: fail on validation errors kubernetes.core.k8s: state: present