Hello,

See https://github.com/ansible/ansible/issues/8559 for additional details, 
but in brief I have 3 roles:

roles/apache2/meta/main.yml:

> ---
> allow_duplicates: yes


roles/apache2-php/meta/main.yml:

> ---
> allow_duplicates: yes
> dependencies:
>   - { role: apache2 }


roles/apache2-ssl/meta/main.yml:

> ---

allow_duplicates: yes 

dependencies:
>   - { role: apache2-php, when: include_php == True }
>   - { role: apache2, when: include_php == False }


I would like to be able to use the apache2-ssl role in a playbook and have 
it recursively call the apache2-php and apache2 dependent roles. This works 
for the most part, except with handlers in the base apache2 role. Even with 
allow_duplicates: yes everywhere, when I call the apache2-ssl role with 
include_php == False, the "reload apache" handler still gets skipped:

excerpt from roles/apache2/tasks/main.yml:

>  - name: copy apache configuration (12.04)
>    template: src=000-default.j2 dest=/etc/apache2/sites-enabled/000-default
>    when: ansible_distribution_version == "12.04"
>    notify: reload apache2


excerpt from roles/apache2/handlers/main.yml:

>   - name: reload apache2
>     service: name=apache2 state=reloaded enabled=true


The handler is NOTIFIED, but skipped:

> NOTIFIED: [apache2 | reload apache2] 
> ******************************************
> skipping: [apachetest]

I think this occurs because the first dependent role, apache2-php, is 
skipped because include_php is False. It then recusively marks all tasks 
and handlers in apache2-php and apache2 as skipped, and then when it goes 
to apache2 a second time (when it hits the second dependent role), it is 
already marked as skipped and so the handler doesn't execute. Any ideas on 
what is going on here, and how to fix it?

Thanks!

-- 
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/0f5254b0-4f0c-4f2b-89d4-3a920aad986b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to