-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Question] Is the generation of defaults in the scope of the project? #77
Comments
Hi @moritzrp, I am not a maintainer, but, I am not sure to understand your question, could you provide an example? |
Hey @montaropdf , sure, let me give a concrete example: I have a role "myrole". This role contains the usual Contents of the ---
argument_specs:
main:
short_description: Main entry for myrole
options:
myrole_foo:
type: str
required: false
default: some_foo
description: foo
myrole_bar:
type: str
required: true
description: bar
alternate:
short_description: Alternate entry for myrole
options:
myrole_baz:
type: str
required: false
default: some_baz
description: baz
myrole_qux:
type: str
required: true
description: qux Since the This could generate the ---
myrole_foo: some_foo And ---
myrole_baz: some_baz But this is not strictly documentation and has some different behavior than the current file generation. So the question is from my side: Does this fit into the project from the maintainers perspective? Or is this simply not what the project is intended for? |
ok, I see, now. Could be nice, but indeed not sure this is the point of the project. However, you should be able to achieve what you want with a custom template, maybe. |
I like the idea!
This won't work, as Ansible only reads
I just tested this and in general this works, but there are some problems:
Here's the jinja I used:
So I guess its easier to achieve this with Python that with Jinja.
Looking forward to a MVP for this. :) Though we probably then need to rename the project. :) |
Great! Then I will start experimenting with this to find a solution :) |
Alright the MVP is done. I made sure not to touch the existing structure and just added a new self contained command for now. So now you have Since But this is mainly a placeholder for the test cases. I think in general the commands could be adjusted to have specific options for either generating docs or defaults. Summary of what it does:
As for the formatting of the output file:
All of these could also be controlled by the configuration or by an option passed along to the command. If you want to see an example of what it produced, you can take a look at the argument_specs.yml and resulting defaults/main.yml from the added test case. This is just the starting point. If you have any comments or suggestions for the behavior, I am of course happy to discuss it. |
Closing this since this topic was handled in #81. |
Question
First of all, I would like to say that this tool is great and already removes a lot of manual effort. So thank you for the work and effort that is being put into it!
At the moment you still need to manually update the defaults for a role. So updating the
meta/argument_specs.yml
is not enough. With bigger roles this can take quite some effort. This makes we wonder, would you see it within the scope of the project to implement a command that takes care of this as well?With that the workflow would be pretty straight forward:
meta/argument_specs.yml
aar_doc myrole markdown
aar_doc myrole defaults
I'm looking forward to hear your feedback on this topic.
P.S. I would be happy to contribute to this as well.
The text was updated successfully, but these errors were encountered: