Open acozine opened 2 years ago
it's very curious. shouldn't ansible deduplicate the meta.yml entries and only run each once?
I don't think Ansible deduplicates down the nested tree, and we have a lot of nested dependencies. For example, the dependency tree for the lib_jobs
role looks like this:
This makes me think we should move away from using meta for dependencies and toward just putting everything in playbooks.
That's a good idea, and would help with visibility. We can do this one role at a time.
Steps to implement:
playbooks/
to run all role dependencies currently defined in roles/<role_name>/meta/main.yml
filesmeta/main.yml
files from rolesroles/<role_name>/molecule/default/
(to prevent drift in testing)Anything else?
See also this SO post.
@carolyncole I'd interested if you have thoughts here, since you and @kayiwa worked so much on the molecule setup.
Okay, I tried a quick "proof of concept" (#2693), which showed me how complex this change would be. Definitely something to discuss broadly.
At the level of an individual role, refactoring the way we maintain role dependencies will require:
For each role dependency we remove from the meta/main.yml
file of Role A:
molecule/default/converge.yml
file for Role A, so it runs in testsmeta/main.yml
for any other role that lists Role A as a dependency, and to any playbooks that run those rolesIf we do decide to move forward on this we can close #1204 as wontfix.
Also related to #2892, which fixed a failure caused by dependency testing.
We're running dependencies like the
common
role multiple times per test run for some projects. For example, when the tests run for thelib_jobs
role, molecule runs:In production, of course, the duplication may be needed where different roles run on different servers, so the dependencies must run on each server, but it seems inefficient for testing. Can anything be done to streamline the test runs?