controller_configuration icon indicating copy to clipboard operation
controller_configuration copied to clipboard

execution_environment missing in roles/job_template/defaults/main.yml

Open ctodea opened this issue 2 years ago • 5 comments

It is documented in the README, and it can be used because in roles/job_template/tasks/main.yml the parameter is passed to the job_template awx module, but is missing from the commented default variables in roles/job_template/defaults/main.yml. This confused me a bit.

ctodea avatar Apr 21 '22 08:04 ctodea

what would we default it to? and why would we want to when it isn't required to be set in controller for the job template to function.

djdanielsson avatar Apr 21 '22 13:04 djdanielsson

No need to set a value, lots of possible fields in the defaults/main.yml dont have a value, but I think, like me, some people will just copy/paste the defaults/main.yml and then modiffy it with their values, it doesn't make sense that all the possible values for the controller_templates variables are in the defaults, but that particular one is not.

So I think adding:

controller_templates: []
# possible fields:
# - name: "job_template_name"  # mandatory
#  new_name: "new_name"  # optional
#  description: "some description"  # optional
#  job_type:  # optional, choices: run, check
#  execution_environment:  # optional <<<< this

would suffice.

ctodea avatar Apr 21 '22 13:04 ctodea

we should add it to the defaults commented like that, I think better examples are in the examples folder though :) I think we should put in a comment to look in the readme for more fields though rather then covering everything in the defaults commented.

sean-m-sullivan avatar Apr 21 '22 13:04 sean-m-sullivan

I agree, I don't like the idea of keeping up with all the possible fields in the defaults file. That is what the readme is for or the examples. I would suggest removing the current commented out stuff in the defaults files all together so they don't confuse people if they are out of date.

djdanielsson avatar Jul 06 '22 18:07 djdanielsson

Honestly, I would do the following:

  • Remove comments from defaults/main.yml
  • Possibly remove even the examples in the README? Instead reference the docs for that module, which includes examples at the bottom. This retains 1 source for examples, versus 2 or 3 (if you include defaults/main.yml too).
  • Do above for all the roles

It should be clear to use README.md first before diving into the lower file structure in the repo. The example in the README is the best place for everything. If you look at roles/etc in Galaxy that are written well, this is the standard. Otherwise, as David said, we cannot possibly keep up with all possible fields.

Thoughts? I can work on this if we agree.

ansiblejunky avatar Sep 21 '22 00:09 ansiblejunky