How do you scaffold a new role?
BeginnerConceptRoles, Collections and Galaxy
Answer
ansible-galaxy role init roles/nginx
This creates the directory skeleton with README.md, meta/main.yml and empty main.yml files. Inside a collection use ansible-galaxy role init --init-path roles nginx. Delete empty directories you do not use so the role stays readable. For a new collection use ansible-galaxy collection init myorg.platform.
More on Roles, Collections and Galaxy
What is a role and why use one?BeginnerWhat is the standard role directory structure?BeginnerWhat are the ways to use a role in a play?IntermediateHow do role dependencies work?IntermediateIf a role is included twice in a play, does it run twice?AdvancedHow do you pass parameters to a role?Intermediate