Hi kai,
thanks for information.
i tried below condition
failed_when: pulp.stdout == "\\e[0m"
failed_when: pulp.stdout == '\e[0m'
failed_when: pulp.stdout == "\\e[0m"
failed_when: pulp.stdout == "\e[0m"
failed_when: "'e[0m' in pulp.stdout"
i tried all stuff but no luck
any new suggestion ?
On Thu, Apr 4, 2019 at 1:38 PM Kai Stian Olstad <
[email protected]> wrote:
> On 04.04.2019 09:47, Kunalsing Thakur wrote:
> > - 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.
>
> This is the correct syntax.
>
> The reason it doesn't work can be many thing and the trial and error
> might be you best option.
>
>
> Your backslash in failed_when is probably taken as an escape.
> - So try double backslash to escape the the backslash.
> - Try changing to single quotes instead of double(with and without
> double backslashes)
>
>
> Alternative is to just check for partial match(leave out the backslash).
>
> failed_when: "'e[0m' in pulp.stdout"
>
>
> If that will not work you have a lot of filter that can do regexp that
> you can look into.
>
>
> --
> 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/f2e9f828937956a3e5d7fbddae81a766%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>
--
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/CANErU6n-aCuNzMvP3hfb0E%3DDwcVnmdYh_SAnqXcw0a99HuJP8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.