From 9b821a93336d8daf9da50b44ee99f478f2806ee5 Mon Sep 17 00:00:00 2001 From: Baptiste Mille-Mathias Date: Thu, 12 Mar 2020 13:55:07 -0500 Subject: [PATCH] Fix examples to use from_yaml filter with lookup --- plugins/modules/k8s.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/modules/k8s.py b/plugins/modules/k8s.py index 4ff6898c..acc74e88 100644 --- a/plugins/modules/k8s.py +++ b/plugins/modules/k8s.py @@ -216,24 +216,24 @@ EXAMPLES = ''' If the definition file has been encrypted with Ansible Vault it will automatically be decrypted. k8s: state: present - definition: "{{ lookup('file', '/testing/deployment.yml') }}" + definition: "{{ lookup('file', '/testing/deployment.yml') | from_yaml }}" - name: Read definition file from the Ansible controller file system after Jinja templating k8s: state: present - definition: "{{ lookup('template', '/testing/deployment.yml') }}" + definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}" - name: fail on validation errors k8s: state: present - definition: "{{ lookup('template', '/testing/deployment.yml') }}" + definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}" validate: fail_on_error: yes - name: warn on validation errors, check for unexpected properties k8s: state: present - definition: "{{ lookup('template', '/testing/deployment.yml') }}" + definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}" validate: fail_on_error: no strict: yes