validate_argument_spec: fixed example syntax (#82534)

pull/82541/head
Akira Yokochi 5 months ago committed by GitHub
parent 21247c828e
commit bf9509bf33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -51,32 +51,32 @@ attributes:
EXAMPLES = r''' EXAMPLES = r'''
- name: verify vars needed for this task file are present when included - name: verify vars needed for this task file are present when included
ansible.builtin.validate_argument_spec: ansible.builtin.validate_argument_spec:
argument_spec: '{{required_data}}' argument_spec: '{{ required_data }}'
vars: vars:
required_data: required_data:
# unlike spec file, just put the options in directly # unlike spec file, just put the options in directly
stuff: stuff:
description: stuff description: stuff
type: str type: str
choices: ['who', 'knows', 'what'] choices: ['who', 'knows', 'what']
default: what default: what
but: but:
description: i guess we need one description: i guess we need one
type: str type: str
required: true required: true
- name: verify vars needed for this task file are present when included, with spec from a spec file - name: verify vars needed for this task file are present when included, with spec from a spec file
ansible.builtin.validate_argument_spec: 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 - name: verify vars needed for next include and not from inside it, also with params i'll only define there
block: block:
- ansible.builtin.validate_argument_spec: - ansible.builtin.validate_argument_spec:
argument_spec: "{{lookup('ansible.builtin.file', 'nakedoptions.yml'}}" argument_spec: "{{ lookup('ansible.builtin.file', 'nakedoptions.yml') }}"
provided_arguments: 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 - name: the include itself
vars: vars:

Loading…
Cancel
Save