Hi Folks,

I'm new to ansible and I have got some confusion in when the statement

here is my playbook - 

 hosts: localhost
  gather_facts: false
  vars:
   nodetype: "DI"
  tasks:
  - name: concatenate
    set_fact:
     argu: "DI=1,DC=0,DP=0"
    when:  "{{ nodetype }}" == "DI"
    register: argu
    set_fact:
     argu: "DI=0,DC=1,DP=0"
    when: "{{ nodetype }}" == "DC"
    register: argu
  - debug:
     msg: "{{ argu }}"

This is just defining variable "argu" based on when condition ,I want to 
just build variable based on the input nodetype . but this is not working 
and always it prints the second argu(DI=0,DC=1,DP=0) value

Is this the right way or simpler way to achieve this?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/64b662ea-2889-4918-a2bc-b19fcb6e3927%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to