I have a tikitaka3.yml (main yml file) and a tikitaka3a.yml (playbook to be 
included) . When I prompt the user for a variable and then in the tasks 
section when I call it, like so:

    ---
    - hosts: all

    vars:
      khan:
    # contents: "{{ lookup('file', 
'/home/imran/Desktop/tobefetched/file1.txt') }}"

    vars_prompt:
     - name: targetenv
       prompt: 1.)EPC 2.)CLIENTS 3)TESTERS
       private: False
       default: "1"

    gather_facts: no
    tasks:

    - name: Inlude playbook tikitaka3a
    include: /home/khan/Desktop/playbooks/tikitaka3a.yml target=umar
    when: targetenv.stdout|int < 2  #this statement has no effect
    #when: targetenv == 1  #Neither does this statement
    #when: targetenc == "1"  #and neither does this statement have affect
  

    #- name: stuff n stuff # This task will give an error if not commented 
    #  debug: var=targetenv.stdout


The include statement always comes into affect, without the when condition 
ever being evaluated

-- 
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/f1208ccf-6afa-41ba-9a5f-d6e692d86aa7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to