From 3be0795ea35e64034ab812365ade4b41786bde09 Mon Sep 17 00:00:00 2001 From: Baptiste Mille-Mathias Date: Tue, 11 Feb 2020 22:36:08 +0100 Subject: [PATCH] Fix examples to use from_yaml filter with lookup (#65424) The documentation says to use `from_yaml` filter when using `lookup` from node executor. Now the examples do too. --- lib/ansible/modules/clustering/k8s/k8s.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/clustering/k8s/k8s.py b/lib/ansible/modules/clustering/k8s/k8s.py index 52cf3597799..f3938bf39cd 100644 --- a/lib/ansible/modules/clustering/k8s/k8s.py +++ b/lib/ansible/modules/clustering/k8s/k8s.py @@ -202,24 +202,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