My Ansible version => ansible 2.1.0
Le mercredi 20 avril 2016 11:28:07 UTC+2, Clément VALENTIN a écrit :
>
> Hi,
>
> I try to use function "with_subelements" with module mysql_user to create
> an user with multiple host with a dict.
> But i can't do this :(
>
> roles/vars/main.yml :
>
> TEST:
> - name: TEST300
> app_MySQLHost: "127.0.0.1"
> app_MySQLPort: "3306"
> app_MySQLAuth: "{{ mysql_auth_file }}"
> app_MySQLDatabase: "TEST"
> app_MySQLUser: "TEST"
> app_MySQLAuthorizeHostname:
> - '127.0.0.1'
> - '192.168.0.1'
>
>
> roles/tasks/main.yml
>
> - name: "[MySQL] Check user"
> mysql_user:
> name: "{{ item.0.app_MySQLUser }}"
> host: "{{ item.1 }}"
> login_host: "{{ item.0.app_MySQLHost }}"
> login_port: "{{ item.0.app_MySQLPort }}"
> config_file: "{{ item.0.app_MySQLAuth }}"
> password: "{{ lookup('password', 'roles/TEST/credentials/mysql.pass
> length=15 chars=ascii_letters,digits') }}"
> update_password: on_create
> priv: "{{ item.0.app_MySQLUser }}.*:ALL"
> state: present
> with_subelements:
> - "{{ project }}"
> - app_MySQLAuthorizeHostname
>
>
> But ansible return :
> [WARNING]: Failure when attempting to use callback plugin
> (<ansible.plugins.callback.default.CallbackModule object at 0x1a42350>):
> not all arguments converted during string formatting
>
> Any idea ?
>
> Thx
>
--
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/f7e29ccc-8a1e-4bec-bd39-1804bc6b3bab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.