From bf9509bf33b2675d73f4abe72bebb91815d284f5 Mon Sep 17 00:00:00 2001 From: Akira Yokochi Date: Sun, 14 Jan 2024 01:17:21 +0900 Subject: [PATCH] validate_argument_spec: fixed example syntax (#82534) --- lib/ansible/modules/validate_argument_spec.py | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/ansible/modules/validate_argument_spec.py b/lib/ansible/modules/validate_argument_spec.py index b662e377c96..37a40d1cde2 100644 --- a/lib/ansible/modules/validate_argument_spec.py +++ b/lib/ansible/modules/validate_argument_spec.py @@ -51,32 +51,32 @@ attributes: EXAMPLES = r''' - name: verify vars needed for this task file are present when included ansible.builtin.validate_argument_spec: - argument_spec: '{{required_data}}' + argument_spec: '{{ required_data }}' vars: required_data: - # unlike spec file, just put the options in directly - stuff: - description: stuff - type: str - choices: ['who', 'knows', 'what'] - default: what - but: - description: i guess we need one - type: str - required: true + # unlike spec file, just put the options in directly + stuff: + description: stuff + type: str + choices: ['who', 'knows', 'what'] + default: what + but: + description: i guess we need one + type: str + required: true - name: verify vars needed for this task file are present when included, with spec from a spec file ansible.builtin.validate_argument_spec: - argument_spec: "{{(lookup('ansible.builtin.file', 'myargspec.yml') | from_yaml )['specname']['options']}}" + argument_spec: "{{ (lookup('ansible.builtin.file', 'myargspec.yml') | from_yaml )['specname']['options'] }}" - name: verify vars needed for next include and not from inside it, also with params i'll only define there block: - ansible.builtin.validate_argument_spec: - argument_spec: "{{lookup('ansible.builtin.file', 'nakedoptions.yml'}}" + argument_spec: "{{ lookup('ansible.builtin.file', 'nakedoptions.yml') }}" provided_arguments: - but: "that i can define on the include itself, like in it's `vars:` keyword" + but: "that i can define on the include itself, like in it's `vars:` keyword" - name: the include itself vars: