On 13. mai 2016 21:35, Alejandro Comisario wrote:
- name: ensure murano database user is present
  mysql_user:
    login_host: "{{ mysql_host }}"
    login_password: "{{ mysql_root_password }}"
    login_user: root
    name: myuser
    host: "{{ item }}"
    password: "{{ myuser_mysql_password }}"
    priv: myuserdb*:ALL
    state: present
  ignore_errors: true
  with_items:

    - groups['haproxy']

    - hostvars.groups.haproxy['ansible_fqdn']
  run_once: True

I don't think you can do this in one task since host: need to have to different values.

So split in two tasks, one with

    host: "{{ item }}"
  with_items: groups['haproxy']

and the second with

    host: "{{ hostvars[item]['ansible_fqdn'] }}"
  with_items: groups['haproxy']

--
Kai Stian Olstad

--
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/98bcb921-8d42-5bcb-1139-aac35c487dd9%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to