Hi John, Per ansible doc, you should not import a role within another role. Instead, you should use the built in dependencies model. Importing a role in the tasks of another role is a bad idea because it reduces the portability of the role. You'd have to guarantee that the role you're using and the role you import are both present in your roles dir. The dependency model ansible provides solves this problem by leveraging the ansible galaxy command to pull dependencies from remote repositories.
Paul Sent from my T-Mobile 5G Device Get Outlook for Android<https://aka.ms/AAb9ysg> ________________________________ From: [email protected] <[email protected]> on behalf of John Petro <[email protected]> Sent: Friday, June 17, 2022, 3:26 PM To: [email protected] <[email protected]> Subject: [ansible-project] nested roles I have a question regarding nested roles. Back Story: I am doing some code reviews for some ansible code a coworker has done. I noticed that they are importing other roles into the role they are working on. Question: I feel like this is not a good idea, that dependencies should be taken care of at the playbook level, but I am having a difficult time justifying why nesting roles is not necessarily a good idea, so I am looking for some feedback to help me here. I welcome your thoughts on this... --John -- 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]<mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAPAjob8sDH_4Sz23MFPTsBiB0wzmokOKmyJdfkGdsPY6nTZchQ%40mail.gmail.com<https://groups.google.com/d/msgid/ansible-project/CAPAjob8sDH_4Sz23MFPTsBiB0wzmokOKmyJdfkGdsPY6nTZchQ%40mail.gmail.com?utm_medium=email&utm_source=footer>. -- 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/MN2PR03MB47038E41AD8C6EB8AFE62841FDAE9%40MN2PR03MB4703.namprd03.prod.outlook.com.
