Hi Brian, Wow... I could have swore I read that you should never import a role from another role: That is to say that in a role's tasks/main.yml to do import_role for some other role. This made sense to me since a role, I thought, was supposed to only do one thing and do it well. Importing one role from another would seem to inherently do more than one thing, and chaining roles like that could exhibit unpredictable behavior. On the other hand having a playbook that chains import_role, of course, is fine and I get that.
So are you saying that importing a role from another role is an OK thing to do? Paul On Tuesday, June 21, 2022 at 9:39:45 AM UTC-5 Brian Coca wrote: > @Paul Mano the features @flowersong mentions are for installing, not > running the role. There has never been advice to use dependencies over > importing a role. I have personally always advised the opposite, I > created import_role/include_role because the dependency mechanism is > very counterintuitive. I think you are mistaking the misuse of include > (used as current include_tasks) or include_vars targeting 'files from > a role' vs importing the role itself, this WAS advised against (still > is). > > 2.9 is EoL as is 2.10, the import_role/include_role features were added in > 2.4. > -- > ---------- > Brian Coca > > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/998a0f48-e31a-42b9-81c8-83ea3cd66c27n%40googlegroups.com.
