Block of tasks such a syntax

2 views
Skip to first unread message

kdt

unread,
Jul 22, 2019, 6:00:39 AM7/22/19
to Ansible Project
Hi,
I wonder if following is a valid syntax for creating a block of tasks

$ cat playbook-some.yml
---
- hosts: all
  vars_files
:
       
- ./vars_defaults.yml

  tasks
:
    block
   
- name: Doing measure A
      import_role
:
         name
: vendor1.measureA
    - name: Doing measure B
      import_role
:
         name
: vendor1.measureB
   
when: do_measures_a_till_b

Question is about the lack of "- name: some description" line before block.

Kai Stian Olstad

unread,
Jul 22, 2019, 6:26:37 AM7/22/19
to ansible...@googlegroups.com
On 22.07.2019 12:00, kdt wrote:
> Hi,
> I wonder if following is a valid syntax for creating a block of tasks

No.


> $ cat playbook-some.yml
> ---
> - hosts: all
> vars_files:
> - ./vars_defaults.yml
>
> tasks:
> block
> - name: Doing measure A
> import_role:
> name: vendor1.measureA
> - name: Doing measure B
> import_role:
> name: vendor1.measureB
> when: do_measures_a_till_b
>
> Question is about the lack of "- name: some description" line before
> block.

You should read the work in progress documentation Brian Coca is
creating since it contain all the answers for you
https://github.com/ansible/ansible/pull/59163/files?short_path=6c7897a#diff-6c7897af459d36548b439591f7542db6

--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages