Skip to content

Possibility to use a loop over controller items? #142

@nodje

Description

@nodje

It's nice to benefit from the infra.controller abstraction over the ansible.controller collection, but I'm reaching a density in my filetree_read source where a loop notion becomes necessary.

I have enough object to create that I'd need a mecanism like:

controller_organizations:
  - name: "{{ item }}"
    instance_groups: "{{ common_instance_groups }}"
    default_environment: "{{ common_default_execution_environment }}"
    galaxy_credentials: "{{ common_galaxy_credentials }}"
    loop:
     - org_list

rather than to have to duplicate the block 50 times over.

But I don't see how this would be possible in the filetree_read source variables.

Right now it seems that my only option to be able to loop over list of items would be to go back a layer down and start to use ansible.controller.

Some controllers like controller_roles have this use case kind of embedded as it can be applied to both team and teams list, organization and organizations list, etc.

Maybe adding this possibility to all controller object could be a solution, so that a list of names could be used as an entry for any type of object?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions