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

Support parsing argument_specs.yml #763

Open
gionn opened this issue Sep 2, 2024 · 3 comments
Open

Support parsing argument_specs.yml #763

gionn opened this issue Sep 2, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@gionn
Copy link

gionn commented Sep 2, 2024

Since the introduction of the role arguments validation, it may happen to define an argument like:

my_role_argument:
  type: str
  description: My mandatory role argument
  required: true

which usually doesn't need a default value set in defaults/main.yml, otherwise such argument validation won't work as expected (it will always succeeded because of being defined e.g. '').

This prevent ansible-doctor to properly render those variables, unless also meta/argument_specs.yml is used to discover the available vars.

@xoxys xoxys added the enhancement New feature or request label Sep 4, 2024
@xoxys
Copy link
Member

xoxys commented Sep 4, 2024

Thanks for your feedback! Makes sense to me, would you like to work on the implementation?

@gionn
Copy link
Author

gionn commented Sep 4, 2024

I could but will be great if you provide some guidance on where to slip that in

@xoxys
Copy link
Member

xoxys commented Sep 20, 2024

I would add it right beside all other file parsers in https://github.com/thegeeklab/ansible-doctor/blob/main/ansibledoctor/doc_parser.py#L33-L45

We should store it as a dedicated dict internally, e.g. argspec.

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

No branches or pull requests

2 participants