Hello,
I’ve been playing with ansible for a couple of days and ran into some trouble with Ansible v2.4.0 (the “git” version).
Following the best practices of the documentation, I use roles and my project has basically the following structure (I’m just showing the relevant files for the sake of readability):
.
├── roles
│ ├── cassandra
│ │ ├── handlers
│ │ │ └── main.yml
│ │ ├── tasks
│ │ │ └── main.yml
│ ├── common
│ │ ├── handlers
│ │ │ └── main.yml
│ │ ├── tasks
│ │ │ └── main.yml
│ ├── email
│ │ ├── handlers
│ │ │ └── main.yml
│ │ └── tasks
│ │ └── main.yml
│ ├── NTP
│ │ ├── handlers
│ │ │ └── main.yml
│ │ └── tasks
│ │ └── main.yml
│ └── unattended_upgrades
│ ├── tasks
│ └── main.yml
└── site.yml
My playbook (the site.yml file) references the following roles:
roles:
- common
- unattended_upgrades
- cassandra
Then in turn the unattended_upgrades and cassandra tasks reference respectively the email and NTP roles via an include directive.
Here are the problems I run into when I execute my playbook:
-
Handlers from common role seem to fail silently: I don’t see any “RUNNING HANDLER” in the standard output nor any error. What seems weird to me is that handlers from the cassandra role get executed correctly. Am I missing something here?
-
Handlers from roles included in roles (even with static: true) fail with the following error: ERROR! The requested handler was not found in either the main handlers list nor in the listening handlers list. It seems there is already a GitHub issue about this one.
So, any idea about problem #1 and a workaround for problem #2 (apart from adding the roles to the roles’ list of the playbook)?
Thanks!
PS: I don’t think it matters but I’m running ansible from “bash on Ubuntu on Windows” (Ubuntu 16.04 / Windows 10 x64).