Hi All,

Im trying to choose ansible inventory host group conditionally.

- name: Set group
  set_fact:
    group: |
        {% if c == 1 %}
        {% set group = 'grp1' %}
        {% elif c == 2 %}
        {% set group == 'grp3' %}
        {% else %}
        {% group == 'grp4' %}
        {% endif %}

- debug:
     var=group


This doesnt seem to work.

Whats the right way to use if-else with ansible set??

Kinldy assist.

-- 
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/de181027-dc27-4190-8d1e-1e5feec12546%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to