controller_configuration icon indicating copy to clipboard operation
controller_configuration copied to clipboard

Extra variables for workflow job templates and job templates

Open przemkalit opened this issue 1 year ago • 0 comments

What does this PR do?

Hi, I want to introduce two variables that can later be used by other filetree_create tasks. The idea behind this is to allow the export of only job templates related to certain workflows and the projects associated with these job templates. I know that having a dictionary instead of a list of IDs or names may not be necessary, but it's good to have both options to avoid querying for the ID or name.

How should this be tested?

- name: Get the Workflow
  hosts: all 
  tasks:
    - name: Retrieve the workflow
      vars:
        workflow_job_template_id: 1
      ansible.builtin.include_role: infra.controller_configuration.filetree_create

    - name: Retrieve job templates of workflow
      loop: "{{ workflow_node_jobs_dictvar | dict2items }}"
      vars:
        job_template_id: "{{ item.value }}"
      ansible.builtin.include_role: infra.controller_configuration.filetree_create
  
    - name: Retrieve the projects of job templates
      loop: "{{ projects_dictvar | dict2items }}"
      vars:
        project_id: "{{ item.value }}"
      ansible.builtin.include_role: infra.controller_configuration.filetree_create

Is there a relevant Issue open for this?

N/A

Other Relevant info, PRs, etc

This PR is related to #836.

przemkalit avatar Jul 01 '24 13:07 przemkalit