Hi sebastian,
when i try to fail the task with this below condition i get the error in 
task

*failed_when: pulp.results.0.stdout == "\e[0m"*

TASK [mobi_ansible_role_pulp : searching the rpm into pulp repo] 
*************************************************
task path: /etc/ansible/roles/mobi_ansible_role_pulp/tasks/pulp.yaml:4
Wednesday 03 April 2019  14:40:58 +0000 (0:00:01.856)       0:00:06.231 
*******
fatal: [inplp01p2.infra.smf1.mobitv]: FAILED! =>
  msg: 'The conditional check ''pulp.results.0.stdout == "\e[0m"'' failed. 
The error was: error while evaluating conditional (pulp.results.0.stdout == 
"\e[0m"): ''dict object'' has no attribute ''results'''


On Wednesday, April 3, 2019 at 8:01:59 PM UTC+5:30, Sebastian Meyer wrote:
>
> On 03.04.19 16:22, Kunalsing Thakur wrote: 
> > --- 
> > - name: Logging into pulp 
> >   shell: pulp-admin login -u admin -p admin 
> > - name: searching the rpm into pulp repo 
> >   shell: pulp-admin rpm repo content rpm --repo-id=mobi-snapshots 
> --match 
> > 'filename={{ item }}' 
> >   with_items: "{{ rpmname | default([]) }}" 
> >   register: pulp 
> >   when: rpmsearch is defined 
>
> You are using register with a loop. That means pulp.results is a list 
> and there's an element for each item in that list. 
>
> You can access the stdout for the first item with pulp.results.0.stdout 
>
> Sebastian 
> -- 
> Sebastian Meyer 
> Linux Consultant & Trainer 
> Mail: me...@b1-systems.de <javascript:> 
>
> B1 Systems GmbH 
> Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de 
> GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537 
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9eeb9ab0-5574-4b62-94b5-efa27885946a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to