main.yml.txt

Template main.yml that will be copied into the new repository to be run as the pipeline runs after an update in the repository.
This main.yml will configure the changes made into the new repository into the designated rhaap environment, after being triggered from the pipeline.

---
- name: Configure rhaap platform controller for MGT
  hosts: "{{ instance | default('localhost') }}"
  connection: local
  gather_facts: false

  pre_tasks:
    - name: Set the vars
      ansible.builtin.set_fact:
        aap_configuration_secure_logging: false
        controller_credentials: >
          {{ controller_credentials_all |
          community.general.lists_mergeby(vars['controller_credentials_' + branch_name],
          'name', recursive=true, list_merge='append') }}
        controller_hosts: >
          {{ controller_hosts_all |
          community.general.lists_mergeby(vars['controller_hosts_' + branch_name],
          'name', recursive=true, list_merge='append') }}
        controller_inventory_sources: >
          {{ controller_inventory_sources_all |
          community.general.lists_mergeby(vars['controller_inventory_sources_' + branch_name],
          'name', recursive=true, list_merge='append') }}
        controller_inventories: >
          {{ controller_inventories_all |
          community.general.lists_mergeby(vars['controller_inventories_' + branch_name],
          'name', recursive=true, list_merge='append') }}
        controller_labels: >
          {{ controller_labels_all |
          community.general.lists_mergeby(vars['controller_labels_' + branch_name],
          'name', recursive=true, list_merge='append') }}
        controller_notifications: >
          {{ controller_notifications_all |
          community.general.lists_mergeby(vars['controller_notifications_' + branch_name],
          'name', recursive=true, list_merge='append') }}
        aap_organizations: >
          {{ aap_organizations_all |
          community.general.lists_mergeby(vars['aap_organizations_' + branch_name],
          'name', recursive=true, list_merge='append') }}
        controller_projects: >
          {{ controller_projects_all |
          community.general.lists_mergeby(vars['controller_projects_' + branch_name],
          'name', recursive=true, list_merge='append') }}
        controller_schedules: >
          {{ controller_schedules_all |
          community.general.lists_mergeby(vars['controller_schedules_' + branch_name],
          'name', recursive=true, list_merge='append') }}
        controller_templates: >
          {{ controller_templates_all |
          community.general.lists_mergeby(vars['controller_templates_' + branch_name],
          'name', recursive=true, list_merge='append') }}
        controller_roles: >
          {{ controller_roles_all |
          community.general.lists_mergeby(vars['controller_roles_' + branch_name],
          'name', recursive=true, list_merge='append') }}
        controller_workflows: >
          {{ controller_workflows_all |
          community.general.lists_mergeby(vars['controller_workflows_' + branch_name],
          'name', recursive=true, list_merge='append') }}

  roles:
    - infra.aap_configuration.dispatch

Back