diff --git a/playbooks/controller_config.yml b/playbooks/controller_config.yml index 06f41ec..18b34eb 100644 --- a/playbooks/controller_config.yml +++ b/playbooks/controller_config.yml @@ -5,36 +5,6 @@ - ../vaults/{{ env }}.yml connection: local tasks: - - name: Include setting role - ansible.builtin.include_role: - name: infra.controller_configuration.settings - when: controller_settings | length is not match('0') - - - name: Include organization role - ansible.builtin.include_role: - name: infra.controller_configuration.organizations - vars: - assign_galaxy_credentials_to_org: false - assign_default_ee_to_org: false - when: controller_organizations | length is not match('0') - - - name: Include labels role - ansible.builtin.include_role: - name: infra.controller_configuration.labels - when: controller_labels | length is not match('0') - - - name: Include users role - ansible.builtin.include_role: - name: infra.controller_configuration.users - vars: - controller_configuration_users_secure_logging: true - when: controller_user_accounts | length is not match('0') - - - name: Include teams role - ansible.builtin.include_role: - name: infra.controller_configuration.teams - when: controller_teams | length is not match('0') - # probably not good but kinda works, looking for better solutions, # you are better off removing this block and getting token into vault by hand - name: Figuring out AH token @@ -53,96 +23,8 @@ ansible.builtin.set_fact: ah_token: "{{ ah_token['token'] }}" when: r_ah_token['changed'] # noqa: no-handler - # what needs to be done to guarantee this to work? - - - name: Include credential_types role - ansible.builtin.include_role: - name: infra.controller_configuration.credential_types - when: controller_credential_types | length is not match('0') - - - name: Include credential role - ansible.builtin.include_role: - name: infra.controller_configuration.credentials - vars: - controller_configuration_credentials_secure_logging: true - when: controller_credentials | length is not match('0') - - - name: Include credential_input_sources role - ansible.builtin.include_role: - name: infra.controller_configuration.credential_input_sources - when: controller_credential_input_sources | length is not match('0') - - - name: Include instance_groups role - ansible.builtin.include_role: - name: infra.controller_configuration.instance_groups - when: controller_instance_groups | length is not match('0') - - - name: Include execution_environments role - ansible.builtin.include_role: - name: infra.controller_configuration.execution_environments - when: controller_execution_environments | length is not match('0') - - - name: Include organizations role - ansible.builtin.include_role: - name: infra.controller_configuration.organizations - when: controller_organizations | length is not match('0') - - - name: Include Notification role - ansible.builtin.include_role: - name: infra.controller_configuration.notification_templates - when: controller_notifications | length is not match('0') - - - name: Include projects role - ansible.builtin.include_role: - name: infra.controller_configuration.projects - when: controller_projects | length is not match('0') - - - name: Include inventories role - ansible.builtin.include_role: - name: infra.controller_configuration.inventories - when: controller_inventories | length is not match('0') - - - name: Include inventory_sources role - ansible.builtin.include_role: - name: infra.controller_configuration.inventory_sources - when: controller_inventory_sources | length is not match('0') - - - name: Include inventory_source_update role - ansible.builtin.include_role: - name: infra.controller_configuration.inventory_source_update - - - name: Include groups role - ansible.builtin.include_role: - name: infra.controller_configuration.groups - when: controller_groups | length is not match('0') - - - name: Include hosts role - ansible.builtin.include_role: - name: infra.controller_configuration.hosts - when: controller_hosts | length is not match('0') - - - name: Include applications role - ansible.builtin.include_role: - name: infra.controller_configuration.applications - when: controller_applications | length is not match('0') - - - name: Include job_templates role - ansible.builtin.include_role: - name: infra.controller_configuration.job_templates - when: controller_templates | length is not match('0') - - - name: Include workflow_job_templates role - ansible.builtin.include_role: - name: infra.controller_configuration.workflow_job_templates - when: controller_workflows | length is not match('0') - - - name: Include schedules role - ansible.builtin.include_role: - name: infra.controller_configuration.schedules - when: controller_schedules | length is not match('0') - - name: Include roles role + - name: Call dispatch role ansible.builtin.include_role: - name: infra.controller_configuration.roles - when: controller_roles | length is not match('0') + name: infra.controller_configuration.dispatch ... diff --git a/playbooks/eda_config.yml b/playbooks/eda_config.yml index 3ce9b3d..bd35602 100644 --- a/playbooks/eda_config.yml +++ b/playbooks/eda_config.yml @@ -5,29 +5,8 @@ - "../vaults/{{ env }}.yml" connection: local tasks: - - name: Include credential role + - name: Call dispatch role ansible.builtin.include_role: - name: infra.eda_configuration.credential - when: eda_credentials is defined - - - name: Include project role - ansible.builtin.include_role: - name: infra.eda_configuration.project - when: eda_projects is defined - - - name: Include project_sync role - ansible.builtin.include_role: - name: infra.eda_configuration.project_sync - when: eda_projects is defined - - - name: Include decision_environment role - ansible.builtin.include_role: - name: infra.eda_configuration.decision_environment - when: eda_decision_environments is defined - - - name: Include rulebook_activation role - ansible.builtin.include_role: - name: infra.eda_configuration.rulebook_activation - when: eda_rulebook_activations is defined + name: infra.eda_configuration.dispatch ... diff --git a/playbooks/hub_config.yml b/playbooks/hub_config.yml index 8e939ad..cca67db 100644 --- a/playbooks/hub_config.yml +++ b/playbooks/hub_config.yml @@ -6,6 +6,11 @@ vars_files: - ../vaults/{{ env }}.yml tasks: + # Pending a bug fix + # - name: Include dispatch role + # ansible.builtin.include_role: + # name: infra.ah_configuration.dispatch + - name: Include collection_remote role ansible.builtin.include_role: name: infra.ah_configuration.collection_remote diff --git a/playbooks/install_configure.yml b/playbooks/install_configure.yml index ca3677d..d6bde43 100644 --- a/playbooks/install_configure.yml +++ b/playbooks/install_configure.yml @@ -24,34 +24,9 @@ vars_files: - "../vaults/{{ env }}.yml" tasks: - - name: Include repository role + - name: Call dispatch role ansible.builtin.include_role: - name: infra.ah_configuration.repository - - - name: Include repository sync role - ansible.builtin.include_role: - name: infra.ah_configuration.repository_sync - - - name: Publish custom collections - when: publish | default(false) - block: - - name: Include namespace role - ansible.builtin.include_role: - name: infra.ah_configuration.namespace - - - name: Include publish role - ansible.builtin.include_role: - name: infra.ah_configuration.publish - - - name: Include group role - ansible.builtin.include_role: - name: infra.ah_configuration.group - when: ah_groups | length is not match('0') - - - name: Include user role - ansible.builtin.include_role: - name: infra.ah_configuration.user - when: ah_users | length is not match('0') + name: infra.eda_configuration.dispatch - name: Configure ansible controller post installation hosts: "{{ env | default('dev') }}" # noqa: syntax-check @@ -80,38 +55,6 @@ controller_password: "{{ controller_password }}" validate_certs: false - - name: Include setting role - ansible.builtin.include_role: - name: infra.controller_configuration.settings - when: controller_settings | length is not match('0') - - - name: Include organization role - ansible.builtin.include_role: - name: infra.controller_configuration.organizations - vars: - assign_galaxy_credentials_to_org: false - assign_default_ee_to_org: false - when: controller_organizations | length is not match('0') - - - name: Include labels role - ansible.builtin.include_role: - name: infra.controller_configuration.labels - when: controller_labels | length is not match('0') - - - name: Include users role - ansible.builtin.include_role: - name: infra.controller_configuration.users - vars: - controller_configuration_users_secure_logging: true - when: controller_user_accounts | length is not match('0') - - - name: Include teams role - ansible.builtin.include_role: - name: infra.controller_configuration.teams - when: controller_teams | length is not match('0') - - # probably not good but kinda works, looking for better solutions, - # you are better off removing this block and getting token into vault by hand - name: Figuring out AH token when: ah_token is not defined or ah_token['token'] is defined block: @@ -120,7 +63,7 @@ ah_host: "{{ ah_host | default(groups['automationhub'][0]) }}" ah_username: "{{ ah_token_username | default('admin') }}" ah_password: "{{ ah_token_password }}" - ah_path_prefix: 'galaxy' # this is for private automation hub + ah_path_prefix: galaxy # this is for private automation hub validate_certs: false register: r_ah_token @@ -128,98 +71,10 @@ ansible.builtin.set_fact: ah_token: "{{ ah_token['token'] }}" when: r_ah_token['changed'] # noqa: no-handler - # what needs to be done to guarantee this to work? - - - name: Include credential_types role - ansible.builtin.include_role: - name: infra.controller_configuration.credential_types - when: controller_credential_types | length is not match('0') - - - name: Include credential role - ansible.builtin.include_role: - name: infra.controller_configuration.credentials - vars: - controller_configuration_credentials_secure_logging: true - when: controller_credentials | length is not match('0') - - - name: Include credential_input_sources role - ansible.builtin.include_role: - name: infra.controller_configuration.credential_input_sources - when: controller_credential_input_sources | length is not match('0') - - - name: Include instance_groups role - ansible.builtin.include_role: - name: infra.controller_configuration.instance_groups - when: controller_instance_groups | length is not match('0') - - - name: Include execution_environments role - ansible.builtin.include_role: - name: infra.controller_configuration.execution_environments - when: controller_execution_environments | length is not match('0') - - - name: Include organizations role - ansible.builtin.include_role: - name: infra.controller_configuration.organizations - when: controller_organizations | length is not match('0') - - - name: Include Notification role - ansible.builtin.include_role: - name: infra.controller_configuration.notification_templates - when: controller_notifications | length is not match('0') - - - name: Include projects role - ansible.builtin.include_role: - name: infra.controller_configuration.projects - when: controller_projects | length is not match('0') - - - name: Include inventories role - ansible.builtin.include_role: - name: infra.controller_configuration.inventories - when: controller_inventories | length is not match('0') - - - name: Include inventory_sources role - ansible.builtin.include_role: - name: infra.controller_configuration.inventory_sources - when: controller_inventory_sources | length is not match('0') - - - name: Include inventory_source_update role - ansible.builtin.include_role: - name: infra.controller_configuration.inventory_source_update - - - name: Include groups role - ansible.builtin.include_role: - name: infra.controller_configuration.groups - when: controller_groups | length is not match('0') - - - name: Include hosts role - ansible.builtin.include_role: - name: infra.controller_configuration.hosts - when: controller_hosts | length is not match('0') - - - name: Include applications role - ansible.builtin.include_role: - name: infra.controller_configuration.applications - when: controller_applications | length is not match('0') - - - name: Include job_templates role - ansible.builtin.include_role: - name: infra.controller_configuration.job_templates - when: controller_templates | length is not match('0') - - - name: Include workflow_job_templates role - ansible.builtin.include_role: - name: infra.controller_configuration.workflow_job_templates - when: controller_workflows | length is not match('0') - - - name: Include schedules role - ansible.builtin.include_role: - name: infra.controller_configuration.schedules - when: controller_schedules | length is not match('0') - - name: Include roles role + - name: Call dispatch role ansible.builtin.include_role: - name: infra.controller_configuration.roles - when: controller_roles | length is not match('0') + name: infra.controller_configuration.dispatch - name: Launch build execution environment job template awx.awx.job_launch: