Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in the roles allow "<role-name>(-defaults/tasks/files/...).y(a)ml" as default file name instead of main.yml #188

Open
gturbo opened this issue Jan 8, 2021 · 2 comments

Comments

@gturbo
Copy link

gturbo commented Jan 8, 2021

Proposal: in the roles allow "(-defaults/tasks/files/...).y(a)ml" as default file name instead of main.yml

Author: GAEL <@gturbo> IRC: handle (if different)

Date: 2021-01-08

  • Status: New
  • Proposal type: core design
  • Targeted release: ?
  • Associated PR: <link to GH PR in ansible/proposals if PR was submitted>
  • Estimated time to implement: <X days, weeks, etc.>

Motivation

Easier developper experience when working with mutliple rôles in IDE and ease finding files in file system

Problems

When you open multiple modules tasks / vars / ... in an IDE to build your plays.
It's sometimes not very easy to have all files named "main.yml" wich is what you end up doing once you use the best practices and separate your plays in modular unitary roles.

Solution proposal

only the rules responsible for searching files when parsing roles and the galaxy template generator should be impacted

Dependencies (optional)

Testing (optional)

?

Documentation (optional)

?

Anything else?

If you'd like to add anything else beyond the above required and optional sections, you are welcome to do so.

@gitqlt
Copy link

gitqlt commented Jan 17, 2021

According to the documentation:

By default Ansible will look in each directory within a role for a main.yml file for
relevant content (also main.yaml and main)

So a second option would help (in all three of the above forms: xyz.yml / xyz.yaml / xyz). It would be nice to have tasks/tasks.yml, handlers/handlers.yml, defaults/defaults.yml, vars/vars.yml, meta/meta.yml as options.

@bcoca
Copy link
Member

bcoca commented Apr 29, 2021

main can also be a directory and you can name the files whatever you want under that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants