Skip to content

Create Module which takes controller_* list as input #1279

Description

@Tompage1994

Is your feature request related to a problem? Please describe.
The modules will take the input vars for this collection as input

Describe the solution you'd like
To begin with, let's create a proposal for job_templates. This may not even reside in this repo, but it should make use of the module_utils from ansible.controller or ansible.platform.

Create a module named controller_job_templates_bulk which takes the same format as the var controller_job_templates as well as the standard controller_username type parameters. In the background it should then just create/update/delete all the objects. Perhaps there should be a parameter for delete_if_missing such that we have a way to do object diff easily. This should significantly improve speed and output of performing the actions completed in this role.

example:

infra.aap_configuration.controller_job_templates_bulk:
  controller_username: myuser
  controller_password: password
  controller_host: https://aap.example.com
  state: present
  delete_if_missing: true
  job_templates:
    - name: myjt
      project: myproj
      inventory: myinv
      playbook: hello_world.yml
    - name: anotherjt
      project: myproj
      inventory: myinv
      playbook: secondplay.yml

To do this I'm pretty certain you'll need to make use of (import) the awx.awx module utils.

Describe alternatives you've considered
N/A

Additional context
Start by creating a POC with just one module and seeing how well we can do this

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions