I have solved my problem XD
Problem is on include syntax...
- include: "{{ item.file }}"
> vars:
> project: "{{ TEST }}"
> with_items:
> - 'system.yml'
> - 'apache.yml'
Le lundi 18 avril 2016 14:32:13 UTC+2, Clément VALENTIN a écrit :
>
> Hi,
>
> I seek to send a vars dictonnary to my include page, but i can't do
> this... (roles mode)
>
> *Exemple :*
>
> roles/TEST/vars/main.yml :
>
> TEST:
>> - name: ENV1
>> http_port: '8000'
>> ServerName: "TEST.ENV1"
>> User: "TEST-ENV1"
>> Group: "TEST-ENV1"
>> AddDefaultCharset: "utf-8"
>> - name: ENV2
>> http_port: '8010'
>> ServerName: "TEST.ENV2"
>> User: "TEST-ENV2"
>> Group: "TEST-ENV2"
>
> AddDefaultCharset: "utf-8"
>>
>
> roles/TEST/task/main.yml :
>
> - include: "{{ item.file }}"
>> vars:
>> project: "{{ TEST }}"
>> with_items:
>> - { file: 'system.yml' }
>> - { file: 'apache.yml' }
>>
>
> roles/TEST/task/apache.yml :
>
> - name: "[SYSTEM] Check User & group TEST"
>> user:
>> name: "{{ item.User }}"
>> home: "{{ apache_host_path }}/{{ item.ServerName }}"
>> groups: TESTGROUP
>> shell: /bin/bash
>> password: "{{ lookup('password', 'roles/TEST/credentials/{{
>> item.ServerName }}/sftp_{{ item.User }}.pass length=15
>> chars=ascii_letters,digits') }}"
>
> update_password: on_create
>> state: present
>> with_items: "{{ project }}"
>
>
> But i can't use correctly my vars {{ project }} on my apache task :/
>
> Error :
> *fatal: [AUCHANQLF-WEB08-PRP.ope.cloud.mbs]: FAILED! => {"failed": true,
> "msg": "'dict object' has no attribute 'file'"}*
> * to retry, use: --limit @harmony.retry*
>
> Anone have an 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/79714802-729f-4c89-93e9-ba3941993ede%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.