use vars from include_role

392 views
Skip to first unread message

Michael Ströder

unread,
May 25, 2017, 6:14:48 PM5/25/17
to ansible...@googlegroups.com
HI!

I want to use the following task (with ansible ansible-2.3.1.0-0.2.rc2):

- name: "Install web2ldap on {{ openldap_role }}"
include_role:
name: web2ldap
private: False
vars:
web_server: "apache2"
web2ldap_pip_index_url: "{{ aedir_pip_index_url }}"
web2ldap_pip_needs_compiler: "{{ aedir_pip_needs_compiler }}"
web2ldap_pip_extra_args: "{{ aedir_pip_extra_args }}"
when: openldap_role=="provider"

The role sets some vars that are used in later tasks.

If I execute the role itself before another role in the same playbook web2ldap's vars are
present an can be used. But not with the include_role task above.

Any hint what's going on is highly appreciated.

Ciao, Michael.

Trond Hindenes

unread,
May 29, 2017, 1:05:32 AM5/29/17
to Ansible Project, mic...@stroeder.com
This was discussed in another thread. Seems to be a bug in the "include_role" module

Michael Ströder

unread,
May 29, 2017, 4:43:47 AM5/29/17
to ansible...@googlegroups.com, Trond Hindenes
Trond Hindenes wrote:
> This was discussed in another thread. Seems to be a bug in the "include_role" module

I already suspected that and abandoned the separate role and replaced the include_role
task with normal tasks.

Thanks for the confirmation.

Ciao, Michael.
Reply all
Reply to author
Forward
0 new messages