Skip to content

Commit

Permalink
Ensure dispatch is generalised (#709)
Browse files Browse the repository at this point in the history
Co-authored-by: Sean Sullivan <[email protected]>
  • Loading branch information
Tompage1994 and sean-m-sullivan authored Oct 13, 2023
1 parent 63d3bf5 commit e88e4be
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions roles/dispatch/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ controller_configuration_dispatcher_roles:
- {role: inventory_sources, var: controller_inventory_sources, tags: inventory_sources}
- {role: inventory_source_update, var: controller_inventory_sources, tags: inventory_sources}
- {role: execution_environments, var: controller_execution_environments, tags: execution_environments}
- {role: organizations, var: controller_organizations, tags: organizations, assign_galaxy_credentials_to_org: true, assign_default_ee_to_org: true}
- {role: applications, var: controller_applications, tags: applications}
- {role: hosts, var: controller_hosts, tags: hosts}
- {role: bulk_host_create, var: controller_bulk_hosts, tags: bulk_hosts}
Expand Down
17 changes: 14 additions & 3 deletions roles/dispatch/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ argument_specs:
controller_configuration_dispatcher_roles:
default:
- {role: settings, var: controller_settings, tags: settings}
- {role: instances, var: controller_instances, tags: instances}
- {role: instance_groups, var: controller_instance_groups, tags: instance_groups}
- {role: organizations, var: controller_organizations, tags: organizations}
- {role: labels, var: controller_labels, tags: labels}
- {role: users, var: controller_user_accounts, tags: users}
Expand All @@ -19,16 +21,17 @@ argument_specs:
- {role: inventory_sources, var: controller_inventory_sources, tags: inventory_sources}
- {role: inventory_source_update, var: controller_inventory_sources, tags: inventory_sources}
- {role: execution_environments, var: controller_execution_environments, tags: execution_environments}
- {role: organizations, var: controller_organizations, tags: organizations, assign_galaxy_credentials_to_org: true, assign_default_ee_to_org: true}
- {role: applications, var: controller_applications, tags: applications}
- {role: instances, var: controller_instances, tags: instances}
- {role: instance_groups, var: controller_instance_groups, tags: instance_groups}
- {role: project_update, var: controller_projects, tags: projects}
- {role: hosts, var: controller_hosts, tags: hosts}
- {role: bulk_host_create, var: controller_bulk_hosts, tags: bulk_hosts}
- {role: groups, var: controller_groups, tags: inventories}
- {role: job_templates, var: controller_templates, tags: job_templates}
- {role: workflow_job_templates, var: controller_workflows, tags: workflow_job_templates}
- {role: schedules, var: controller_schedules, tags: schedules}
- {role: roles, var: controller_roles, tags: roles}
- {role: job_launch, var: controller_launch_jobs, tags: job_launch}
- {role: workflow_launch, var: controller_workflow_launch_jobs, tags: workflow_launch}
required: false
description: List of roles, variables and tags to run through
type: list
Expand All @@ -45,6 +48,14 @@ argument_specs:
tags:
required: false
description: Tags to be applied to the role so tagging can be used to run only part of a playbook
assign_galaxy_credentials_to_org:
required: false
description: Variable to be applied. Whether to assign the galaxy credential to the organizations. Only relevant against the organizations role.
default: false
assign_default_ee_to_org:
required: false
description: Variable to be applied. Whether to assign the default execution environment to the organizations. Only relevant against the organizations role.
default: false


# Async variables
Expand Down
12 changes: 2 additions & 10 deletions roles/dispatch/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
loop_control:
loop_var: __role
vars:
assign_galaxy_credentials_to_org: false
assign_default_ee_to_org: false

- name: Include Tasks to add Galaxy credentials and Execution Environments to Organizations
ansible.builtin.include_role:
name: organizations
apply:
tags:
- organizations
tags: organizations
assign_galaxy_credentials_to_org: "{{ __role.assign_galaxy_credentials_to_org | default(false) }}"
assign_default_ee_to_org: "{{ __role.assign_default_ee_to_org | default(false) }}"
...

0 comments on commit e88e4be

Please sign in to comment.