I am not sure if its my misuse of jinja within ansible, but I am seeing 
strange behavior from what would seem to be a typical use case for managing 
dynamic variables. As you can see from the code below, I am using the 
mysql_os variable to determine the list to select items from.  This may be 
the intended behavior, but I swear I have done this in the past.  I tested 
on 2.3, and 2.2 with the same results.

---
  - hosts: localhost
    connection: local
    vars:
      mysql_os: "el6"

      mysql_el6_base:
        - "MySQL-server-{{ mysql_os }}"

      mysql_el7_base:
        - "mysql-community-server-{{ mysql_os }}"
    tasks:
      - debug: msg="{{ item }}.x86_64.rpm"
        with_items:
          - "{{vars['mysql_' + mysql_os + '_base']}}"

Expected Result
TASK [debug] 
******************************************************************************************************************
******
ok: [localhost] => (item=MySQL-server-el6) => {
    "item": "MySQL-server-el6",
    "msg": "MySQL-server-el6.x86_64.rpm"
}



Actual Result
TASK [debug] 
******************************************************************************************************************
******
ok: [localhost] => (item=MySQL-server-{{ mysql_os }}) => {
    "item": "MySQL-server-{{ mysql_os }}",
    "msg": "MySQL-server-{{ mysql_os }}.x86_64.rpm"
}


Thanks

-- 
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/d2a5cb61-66b9-4b91-88aa-6eb378a22c2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to