On Tuesday, July 29, 2014 7:48:58 AM UTC-7, Michael DeHaan wrote:
>
> In your original note:
>
>
> dependencies:
> - { role: pythonapp, when: is_legacy is not defined }
> - { role: rubyapp, when: is_legacy is defined }
>
>
> If pythonapp and rubyapp share a common dependency like the role "dbaccess"
> then when pythonapp gets skipped, it currently sets the dbaccess role to be
> skipped even though rubyapp depends on it.
>
> ====
>
> What I'm saying is in your playbook, do this:
>
> roles:
>
> - { role: pythonapp, when: is_legacy is not defined }
> - { role: rubyapp, when: is_legacy is defined }
>
> In this case, the common dep would not be skipped inadvertantly.
>
>
The problem is the role is higher level, these roles are never declared in
the playbook. The full set looks like this:
They playbook:
# surveymonkey.yml
- hosts: "auth_web_servers"
roles:
- usersvc
- hosts: "main_web_servers"
roles:
- surveymonkey
and then those roles:
# roles/usersvc/meta/main.yml
dependencies:
- { role: gunicorn, when: use_uwsgi is not defined }
- { role: uwsgi, when: use_uwsgi is defined }
# roles/surveymonkey/meta/main.yml
dependencies:
- { role: gunicorn, when: use_uwsgi is not defined }
- { role: uwsgi, when: use_uwsgi is defined }
# roles/gunicorn/meta/main.yml
dependencies:
- { role: python }
# roles/uwsgi/meta/main.yml
dependencies:
- { role: python }
Are you saying I can declare roles inside meta/main.yml instead of
dependencies?
--
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/b5df3707-b7bc-40fd-9ed7-e2922332ec9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.