Hey Felix - can you elaborate? I'm already using:
loop_control:
label: "{{ item.item }}"
As shown in my post. It doesn't quench the output of the items. Am I
missing something?
Rob
On Monday, January 28, 2019 at 2:11:57 PM UTC-5, Felix Fontein wrote:
>
> Hi,
>
> check out the label directive for loop_control:
>
> https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html#loop-control
>
>
> Cheers,
> Felix
>
>
>
> On Mon, 28 Jan 2019 07:54:39 -0800 (PST)
> [email protected] <javascript:> wrote:
>
> > Hey all-
> >
> > I'm using stat and with_items to check proper ownership of various
> > files. Is there any way to reduce the volume of output (i.e.,
> > eliminate everything in red, below)?
> >
> > rowagn@localhost:~/data-platform/oracle/ansible/db12r2$ cat test.yml
> > ---
> > - hosts: localhost
> > tasks:
> > - name: Stat filesystems
> > stat: path="{{ item }}"
> > with_items:
> > - /dev
> > - /home
> > register: filesystems_stat
> >
> > - name: Confirming ownership of filesystems
> > assert:
> > that: "{{ item.stat.pw_name == 'root' }}"
> > with_items: "{{ filesystems_stat.results }}"
> > loop_control:
> > label: "{{ item.item }}"
> >
> > - name: Stat filesystem no with_items
> > stat: path="/dev"
> > register: dev_stat
> >
> > - name: Confirming ownership of dev
> > assert:
> > that: "{{ dev_stat.stat.pw_name == 'root' }}"
> >
> > rowagn@localhost:~/data-platform/oracle/ansible/db12r2$
> > ansible-playbook -i "localhost," -c local test.yml
> >
> > PLAY [localhost]
> > ***************************************************************
> >
> > TASK [setup]
> > *******************************************************************
> > ok: [localhost]
> >
> > TASK [Stat filesystems]
> > ********************************************************
> > ok: [localhost] => (item=/dev)
> > ok: [localhost] => (item=/home)
> >
> > TASK [Confirming ownership of filesystems]
> > *************************************
> > ok: [localhost] => (item=/dev) => {
> > "changed": false,
> > "item": {
> > "changed": false,
> > "invocation": {
> > [...]
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/4c35685c-4b49-47e3-bc5c-669ecd23ad29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.