Skip to content

Commit

Permalink
now with ees?
Browse files Browse the repository at this point in the history
  • Loading branch information
l3acon committed Aug 29, 2024
1 parent 209395f commit adb714a
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 8 deletions.
4 changes: 2 additions & 2 deletions openshift/hub/sync.yml → openshift/hub/collections.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
- name: Add AH token to repo and Sync AutomationHub
- name: Add AH collection token to repo and sync repository
hosts: localhost
gather_facts: false
tasks:
- name: Add AH token
- name: Add Console AH token
infra.ah_configuration.collection_remote:
name: "{{ item.name }}"
url: "{{ item.url }}"
Expand Down
37 changes: 37 additions & 0 deletions openshift/hub/registries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
- name: Configure AH credential for registry and sync EEs
hosts: localhost
gather_facts: false
tasks:
- name: Add Console EE credential
infra.ah_configuration.ah_ee_registry:
name: "{{ item.name }}"
url: "{{ item.url }}"
ah_host: "{{ automation_hub_url }}"
ah_username: 'admin'
ah_password: "{{ lookup('ansible.builtin.env', 'CONTROLLER_PASSWORD') }}"
username: "{{ ee_registry_username }}"
password: "{{ ee_registry_password }}"
loop: "{{ ah_ee_registries }}"

- name: Sync AH registries
infra.ah_configuration.ah_ee_registry_sync:
name: "{{ item.name }}"
wait: true
timeout: 300
ah_host: "{{ automation_hub_url }}"
ah_username: 'admin'
ah_password: "{{ lookup('ansible.builtin.env', 'CONTROLLER_PASSWORD') }}"
loop: "{{ ah_ee_registries }}"

- name: Pull EE images
infra.ah_configuration.ah_ee_image:
name: "{{ item.name }}"
state: present
tags: "{{ item.tags }}"
wait: true
timeout: 300
ah_host: "{{ automation_hub_url }}"
ah_username: 'admin'
ah_password: "{{ lookup('ansible.builtin.env', 'CONTROLLER_PASSWORD') }}"
loop: "{{ ah_ee_images }}"
60 changes: 54 additions & 6 deletions openshift/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ controller_templates:
- "OpenShift Credential"
- "Controller Credential"

- name: OpenShift / Hub / Sync Repositories
- name: OpenShift / Hub / Sync Collection Repositories
job_type: run
inventory: "Demo Inventory"
project: "Ansible official demo project"
playbook: "openshift/hub/sync.yml"
playbook: "openshift/hub/collections.yml"
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
Expand All @@ -79,6 +79,41 @@ controller_templates:
url: https://console.redhat.com/api/automation-hub/content/published/
auth_url: https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token

- name: OpenShift / Hub / Sync EE Registries
job_type: run
inventory: "Demo Inventory"
project: "Ansible official demo project"
playbook: "openshift/hub/registries.yml"
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
survey_enabled: true
credentials:
- "OpenShift Credential"
- "Controller Credential"
survey:
name: ''
description: ''
spec:
- question_name: EE Registry username
type: text
variable: ee_registry_username
required: true
- question_name: EE Registry password
type: text
variable: ee_registry_password
required: true
extra_vars:
ah_ee_registries:
- name: rh-registry
url: https://registry.redhat.io
ah_ee_images:
- name: registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel9
tags:
- latest
- name: registry.redhat.io/ansible-automation-platform-24/ee-minimal-rhel9
tags:
- latest

- name: OpenShift / CNV / Install Operator
job_type: run
Expand Down Expand Up @@ -276,7 +311,7 @@ controller_workflows:
extra_data:
feedback: Failed to create CNV instance

- name: OpenShift / Hub / Deploy Automation Hub and sync repositories
- name: OpenShift / Hub / Deploy Automation Hub and sync EEs and Collections
description: A workflow to deploy Automation Hub and sync repositories
organization: Default
notification_templates_started: Telemetry
Expand All @@ -291,15 +326,28 @@ controller_workflows:
type: text
variable: ah_token
required: true
- question_name: EE Registry username
type: text
variable: ee_registry_username
required: true
- question_name: EE Registry password
type: text
variable: ee_registry_password
required: true
simplified_workflow_nodes:
- identifier: Install AH using AAP Operator
unified_job_template: OpenShift / Hub / Install Automation Hub
success_nodes:
- Sync Repos
- Sync Collections
- Sync EEs
failure_nodes:
- Ticket - Instance Failed
- identifier: Sync EEs
unified_job_template: OpenShift / Hub / Sync EE Registries
failure_nodes:
- Ticket - Instance Failed
- identifier: Sync Repos
unified_job_template: OpenShift / Hub / Sync Repositories
- identifier: Sync Collections
unified_job_template: OpenShift / Hub / Sync Collection Repositories
failure_nodes:
- Ticket - Instance Failed
- identifier: Ticket - Instance Failed
Expand Down

0 comments on commit adb714a

Please sign in to comment.