From 312ea2f96ea1a916481f890bd8f63e982742715a Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 28 Aug 2024 11:03:40 -0600 Subject: [PATCH] might work --- openshift/hub/sync.yml | 23 +++++++++++++++++++++++ openshift/setup.yml | 22 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 openshift/hub/sync.yml diff --git a/openshift/hub/sync.yml b/openshift/hub/sync.yml new file mode 100644 index 00000000..8d6300df --- /dev/null +++ b/openshift/hub/sync.yml @@ -0,0 +1,23 @@ +--- +- name: Add AH token to repo and Sync AutomationHub + hosts: localhost + gather_facts: false + tasks: + - name: Add AH token + infra.ah_configuration.collection_remote: + name: rh-certified + token: "{{ ah_token }}" + url: https://console.redhat.com/api/automation-hub/content/published/ + auth_url: https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token + ah_host: "{{ automation_hub_url }}" + ah_username: 'admin' + ah_password: "{{ lookup('ansible.builtin.env', 'CONTROLLER_PASSWORD') }}" + + - name: Sync repositories in AH (this can take a while) + infra.ah_configuration.collection_repository_sync: + name: rh-certified + wait: true + timeout: 1500 + ah_host: "{{ automation_hub_url }}" + ah_username: 'admin' + ah_password: "{{ lookup('ansible.builtin.env', 'CONTROLLER_PASSWORD') }}" diff --git a/openshift/setup.yml b/openshift/setup.yml index bfbe3d31..a2fa1aa2 100644 --- a/openshift/setup.yml +++ b/openshift/setup.yml @@ -53,6 +53,28 @@ controller_templates: - "OpenShift Credential" - "Controller Credential" + - name: OpenShift / Hub / Sync Repositories + job_type: run + inventory: "Demo Inventory" + project: "Ansible official demo project" + playbook: "openshift/hub/sync.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: Automation Hub Token + type: text + description: See https://console.redhat.com/ansible/automation-hub/token + variable: ah_token + required: true + - name: OpenShift / CNV / Install Operator job_type: run inventory: "Demo Inventory"