skip_reason": "Conditional result was False".

2,432 views
Skip to first unread message

Manish Kumar

unread,
Oct 11, 2019, 6:36:50 AM10/11/19
to Ansible Project
Hi All,

I am trying to compare the output marked in yellow and proceed if condition is true   but it is skipping with skip_reason": "Conditional result was False".

Please let me know how it can be achieved .

---
- hosts: localhost
  tasks:
  - name: System details
    debug: msg="{{ item }}"
    with_items: 
    - "{{ ansible_processor }}"
    - "{{ ansible_processor_cores }}"
    register: out
  - name: verify
    debug: msg="passed"
    when: ansible_processor=="Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz" 


ok: [localhost] => (item=None) => {

    "msg": "Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz"

}

ok: [localhost] => (item=None) => {

    "msg": 1

}

 

TASK [verify] ******************************************************************

task path: /U01/automation/playbooks/Esm_java.yml:10

skipping: [localhost] => {

    "skip_reason": "Conditional result was False"

}

META: ran handlers

META: ran handlers

 

PLAY RECAP *********************************************************************

localhost                  : ok=2    changed=0    unreachable=0    failed=0   



Thanks,

Manish

Srinivas Naram

unread,
Oct 11, 2019, 8:28:02 AM10/11/19
to ansible...@googlegroups.com
Hi Manish,

I was facing same issue yesterday. To troubleshoot the issue I have gathered the facts and observed that ansible_processor kind of variables are list and have to be referenced with .0 or .1

try this out 

ansible_processor. 0 


--
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-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/941ab553-52b8-4661-8d0c-da9033d0b359%40googlegroups.com.

Manish Kumar

unread,
Oct 14, 2019, 1:41:47 AM10/14/19
to Ansible Project
I tried but same result it is skipping .   

when: ansible_processor.0 =="Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz" 
To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.

Vladimir Botka

unread,
Oct 14, 2019, 2:46:20 AM10/14/19
to Manish Kumar, ansible...@googlegroups.com
On Fri, 11 Oct 2019 03:36:50 -0700 (PDT)
Manish Kumar <manishl...@gmail.com> wrote:

> - name: System details
> debug: msg="{{ item }}"
> with_items:
> - "{{ ansible_processor }}"
> - "{{ ansible_processor_cores }}"
> register: out
> [...]
> ok: [localhost] => (item=None) => {
>
> "msg": "Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz"
>
> }
>
> ok: [localhost] => (item=None) => {
>
> "msg": 1
>
> }

Could you explain the magic of printing "1" when the item is "None" ?

Manish Kumar

unread,
Oct 14, 2019, 3:14:59 AM10/14/19
to Ansible Project
Its working now while using ansible_processor .2 
Reply all
Reply to author
Forward
0 new messages