- name: Logging into pulp
shell: pulp-admin login -u admin -p admin
- name: searching the rpm into {{ reponame }} repo
shell: pulp-admin rpm repo content rpm --repo-id={{reponame}} --match
'filename={{ item }}'
loop: "{{ rpmname | default([]) }}"
register: pulp
when: search is defined
failed_when: pulp.stdout == "\e[0m"
Also i tried to use this one.
But ansible task will pass without fail.
On Thu, Apr 4, 2019 at 1:10 PM Kunalsing Thakur <[email protected]>
wrote:
> can you tell me what should be written in role? i am trying to understand
> but can't intepret in role.
>
>
> On Thu, Apr 4, 2019 at 1:06 PM Kai Stian Olstad <
> [email protected]> wrote:
>
>> On 04.04.2019 08:25, Kunalsing Thakur wrote:
>> > Hi Brian,
>> > I have registered results. i am able to access the content using
>> > pulp.results.[0].stdout. if nothing is found stdout prints this
>> > "\e[0m".
>> > And i want to compare this string to failed the task using failed_when
>> > condition.
>> > but somehow it gives me below error.
>> > fatal: [pulp]: FAILED! =>
>> > msg: 'The conditional check ''pulp.results.[0].stdout == "\e[0m"''
>> > failed. The error was: template error while templating string: expected
>> > name or number. String: {% if pulp.results.[0].stdout == "\e[0m" %}
>> > True {%
>> > else %} False {% endif %}'
>>
>> Sebastian Meyer gave you the answer to this in you other thread, maybe
>> read that one more carefully?
>>
>>
>> https://groups.google.com/d/msgid/ansible-project/0749a574-c80b-a765-72c9-928842320e95%40b1-systems.de
>>
>>
>> --
>> Kai Stian Olstad
>>
>> --
>> 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/8469c870271d8c0d3fdd408352d6d971%40olstad.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
>
>
> [image: --]
>
> kunalsing thakur
> [image: https://]about.me/kunalsingthakur
>
> <https://about.me/kunalsingthakur?promo=email_sig&utm_source=email_sig&utm_medium=email_sig&utm_campaign=external_links>
>
--
[image: --]
kunalsing thakur
[image: https://]about.me/kunalsingthakur
<https://about.me/kunalsingthakur?promo=email_sig&utm_source=email_sig&utm_medium=email_sig&utm_campaign=external_links>
--
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/CANErU6%3DVaxkgXLvH-FsBZPUZiBj1TJuDy8C-zRAsobjee4PnXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.