From 9cd49892c66c23e7a60202d2564bf922a1d0ee2b Mon Sep 17 00:00:00 2001 From: Todd Ruch Date: Mon, 8 Apr 2024 11:19:05 -0400 Subject: [PATCH 1/7] Updated README.md to provide details on using the new product-demos EE (#139) --- .gitignore | 4 ++-- README.md | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index bb9433c..280c057 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ - +ansible-navigator.log sean_login_info.yml .DS_Store choose_demo.yml @@ -6,6 +6,6 @@ choose_demo_example_azure.yml choose_demo_example_aws.yml .ansible.cfg *.gz - +*artifact*.json **/roles/* !**/roles/requirements.yml diff --git a/README.md b/README.md index 3af4acc..3724a8f 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,19 @@ This project is tested for compatibility with the [demo.redhat.com Product Demos > You can also use an execution environment for disconnected environments. To do this, you must disable collection downloads in the Controller. This can be done in `Settings` > `Job Settings`. This setting prevents the controller from downloading collections listed in the [collections/requirements.yml](collections/requirements.yml) file. -2. If it is not already created for you, create a Project called `Ansible official demo project` with this repo as a source. NOTE: if you are using a fork, be sure that you have the correct URL. Update the project. +2. If it is not already created for you, add an Execution Environment called `product-demos` -3. Finally, Create a Job Template called `Setup` with the following configuration: + - Name: product-demos + - Image: quay.io/acme_corp/product-demos-ee:latest + - Pull: Only pull the image if not present before running + +3. If it is not already created for you, create a Project called `Ansible official demo project` with this repo as a source. NOTE: if you are using a fork, be sure that you have the correct URL. Update the project. + +4. Finally, Create a Job Template called `Setup` with the following configuration: - Name: Setup - Inventory: Demo Inventory - - Exec Env: Control Plane EE + - Exec Env: product-demos - Playbook: setup_demo.yml - Credentials: - Type: Red Hat Ansible Automation Platform From e990f39c60e77beede608947f4abaaaa4be2c7a1 Mon Sep 17 00:00:00 2001 From: Chris Edillon <67980205+jce-redhat@users.noreply.github.com> Date: Mon, 29 Apr 2024 10:36:22 -0400 Subject: [PATCH 2/7] switch to infra.controller_configuration.dispatch (#147) --- cloud/setup.yml | 9 --------- linux/setup.yml | 6 ------ multi_select_setup.yml | 2 +- network/setup.yml | 9 --------- openshift/setup.yml | 4 ---- satellite/setup.yml | 8 -------- setup_demo.yml | 14 +++----------- windows/setup.yml | 4 ---- 8 files changed, 4 insertions(+), 52 deletions(-) diff --git a/cloud/setup.yml b/cloud/setup.yml index 1a4ced6..4e527c1 100644 --- a/cloud/setup.yml +++ b/cloud/setup.yml @@ -1,15 +1,6 @@ --- user_message: -controller_components: - - execution_environments - - projects - - credentials - - inventory_sources - - groups - - job_templates - - workflow_job_templates - controller_execution_environments: - name: Cloud Services Execution Environment image: quay.io/scottharwell/cloud-ee:latest diff --git a/linux/setup.yml b/linux/setup.yml index a950c53..3208c55 100644 --- a/linux/setup.yml +++ b/linux/setup.yml @@ -3,12 +3,6 @@ user_message: - Update the 'activation_key' and 'org_id' extra variables for 'LINUX / Register with Insights'. https://access.redhat.com/management/activation_keys - Update Credential for Insights Inventory with Red Hat account. - Add variables for system_roles. https://console.redhat.com/ansible/automation-hub/repo/published/redhat/rhel_system_roles -controller_components: - - projects - - credential_types - - credentials - - inventory_sources - - job_templates controller_credential_types: - name: Insights Collection diff --git a/multi_select_setup.yml b/multi_select_setup.yml index 8958b10..8b89318 100644 --- a/multi_select_setup.yml +++ b/multi_select_setup.yml @@ -15,4 +15,4 @@ - name: Default Components ansible.builtin.include_role: - name: "redhat_cop.controller_configuration.job_launch" + name: "infra.controller_configuration.job_launch" diff --git a/network/setup.yml b/network/setup.yml index 24501e4..aa6c90c 100644 --- a/network/setup.yml +++ b/network/setup.yml @@ -1,15 +1,6 @@ --- user_message: -controller_components: - - execution_environments - - projects - - inventories - - hosts - - inventory_sources - - inventory_source_update - - job_templates - controller_execution_environments: - name: Networking Execution Environment image: quay.io/nleiva/ee-network-image diff --git a/openshift/setup.yml b/openshift/setup.yml index d5db457..a505b52 100644 --- a/openshift/setup.yml +++ b/openshift/setup.yml @@ -1,8 +1,4 @@ --- -controller_components: - - credentials - - job_templates - controller_credentials: - name: OpenShift Credential organization: Default diff --git a/satellite/setup.yml b/satellite/setup.yml index 76507a6..193ff6b 100644 --- a/satellite/setup.yml +++ b/satellite/setup.yml @@ -1,14 +1,6 @@ --- user_message: -controller_components: - - credential_types - - credentials - - inventory_sources - - job_templates - - job_launch - - workflow_job_templates - controller_credential_types: - name: Satellite Collection kind: cloud diff --git a/setup_demo.yml b/setup_demo.yml index 4852634..a1dfc42 100644 --- a/setup_demo.yml +++ b/setup_demo.yml @@ -6,16 +6,11 @@ tasks: - name: Default Components ansible.builtin.include_role: - name: "redhat_cop.controller_configuration.{{ item }}" - loop: "{{ controller_components }}" + name: infra.controller_configuration.dispatch vars: # noqa var-naming[no-role-prefix] - controller_components: - - notification_templates - - job_templates - - settings controller_execution_environments: - name: product-demos - image: http://quay.io/acme_corp/product-demos-ee:latest + image: quay.io/acme_corp/product-demos-ee:latest controller_organizations: - name: Default default_environment: product-demos @@ -59,10 +54,7 @@ - name: Demo Components ansible.builtin.include_role: - name: "redhat_cop.controller_configuration.{{ item }}" - loop: "{{ controller_components }}" - when: - - controller_components | d("") | length > 0 + name: "infra.controller_configuration.dispatch" - name: Log Demo ansible.builtin.uri: diff --git a/windows/setup.yml b/windows/setup.yml index 977b93f..19f84d0 100644 --- a/windows/setup.yml +++ b/windows/setup.yml @@ -2,10 +2,6 @@ user_message: | '' -controller_components: - - projects - - job_templates - controller_projects: - name: Fact Scan organization: Default From 4f0df3c8db18461d59aad574300fb40e0844c1fb Mon Sep 17 00:00:00 2001 From: Chris Edillon <67980205+jce-redhat@users.noreply.github.com> Date: Mon, 13 May 2024 15:19:38 -0400 Subject: [PATCH 3/7] Change injector raw formatting (#146) --- linux/setup.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linux/setup.yml b/linux/setup.yml index 3208c55..93a0221 100644 --- a/linux/setup.yml +++ b/linux/setup.yml @@ -4,6 +4,8 @@ user_message: - Update Credential for Insights Inventory with Red Hat account. - Add variables for system_roles. https://console.redhat.com/ansible/automation-hub/repo/published/redhat/rhel_system_roles +# "!unsafe" used to pass raw jinja2 through to the injector definition, see +# https://github.com/redhat-cop/controller_configuration/tree/devel/roles/credential_types#formating-injectors controller_credential_types: - name: Insights Collection kind: cloud @@ -18,8 +20,8 @@ controller_credential_types: secret: true injectors: env: - INSIGHTS_USER: "{% raw %}{ { insights_user }}{% endraw %}" - INSIGHTS_PASSWORD: "{% raw %}{ { insights_password }}{% endraw %}" + INSIGHTS_USER: !unsafe '{{ insights_user }}' + INSIGHTS_PASSWORD: !unsafe '{{ insights_password }}' controller_credentials: - name: Insights Inventory From 16553210bd20b93fef240ae7995c8b6e54c4f1a3 Mon Sep 17 00:00:00 2001 From: Chris Edillon <67980205+jce-redhat@users.noreply.github.com> Date: Mon, 20 May 2024 15:10:02 -0400 Subject: [PATCH 4/7] Add deployment ID for bucket naming (#149) --- .gitignore | 1 + cloud/setup.yml | 4 ++++ setup_demo.yml | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index 280c057..fc9639e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ choose_demo_example_aws.yml *artifact*.json **/roles/* !**/roles/requirements.yml +.deployment_id diff --git a/cloud/setup.yml b/cloud/setup.yml index 4e527c1..c2a1f12 100644 --- a/cloud/setup.yml +++ b/cloud/setup.yml @@ -1,4 +1,6 @@ --- +_deployment_id: "{{ lookup('file', playbook_dir + '/.deployment_id') }}" + user_message: controller_execution_environments: @@ -284,6 +286,7 @@ controller_templates: notification_templates_error: Telemetry extra_vars: aws_report: vpc + reports_aws_bucket_name: reports-pd-{{ _deployment_id }} survey_enabled: true survey: name: '' @@ -312,6 +315,7 @@ controller_templates: notification_templates_error: Telemetry extra_vars: aws_report: tags + reports_aws_bucket_name: reports-pd-{{ _deployment_id }} survey_enabled: true survey: name: '' diff --git a/setup_demo.yml b/setup_demo.yml index a1dfc42..a49ad78 100644 --- a/setup_demo.yml +++ b/setup_demo.yml @@ -49,6 +49,10 @@ - name: "SESSION_COOKIE_AGE" value: 180000 + - name: Create reusable deployment ID + ansible.builtin.set_fact: + _deployment_id: '{{ lookup("ansible.builtin.password", "{{ playbook_dir }}/.deployment_id", chars=["ascii_lowercase", "digits"], length=5) }}' + - name: "Include configuration for {{ demo }}" ansible.builtin.include_vars: "{{ demo }}/setup.yml" From 88b171bb489732c6301fc6353e505b9afa36648b Mon Sep 17 00:00:00 2001 From: willtome Date: Thu, 6 Jun 2024 09:38:57 -0400 Subject: [PATCH 5/7] add state exists to credentials --- cloud/setup.yml | 1 + collections/requirements.yml | 6 +++--- linux/setup.yml | 1 + openshift/setup.yml | 1 + satellite/setup.yml | 2 ++ 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cloud/setup.yml b/cloud/setup.yml index c2a1f12..faa8804 100644 --- a/cloud/setup.yml +++ b/cloud/setup.yml @@ -20,6 +20,7 @@ controller_credentials: credential_type: Amazon Web Services organization: Default update_secrets: false + state: exists inputs: username: REPLACEME password: REPLACEME diff --git a/collections/requirements.yml b/collections/requirements.yml index 435dff2..4cd6753 100644 --- a/collections/requirements.yml +++ b/collections/requirements.yml @@ -1,9 +1,9 @@ --- collections: - name: ansible.controller - version: 4.4.0 - - name: redhat_cop.controller_configuration - version: 2.3.1 + version: 4.5.6 + - name: infra.controller_configuration + version: 2.8.1 # linux - name: ansible.posix version: 1.5.4 diff --git a/linux/setup.yml b/linux/setup.yml index 93a0221..dcc21c6 100644 --- a/linux/setup.yml +++ b/linux/setup.yml @@ -27,6 +27,7 @@ controller_credentials: - name: Insights Inventory credential_type: Insights Collection organization: Default + state: exists inputs: insights_user: REPLACEME insights_password: REPLACEME diff --git a/openshift/setup.yml b/openshift/setup.yml index a505b52..3c8cc9e 100644 --- a/openshift/setup.yml +++ b/openshift/setup.yml @@ -3,6 +3,7 @@ controller_credentials: - name: OpenShift Credential organization: Default credential_type: OpenShift or Kubernetes API Bearer Token + state: exists inputs: host: CHANGEME bearer_token: CHANGEME diff --git a/satellite/setup.yml b/satellite/setup.yml index 193ff6b..6ae2b6e 100644 --- a/satellite/setup.yml +++ b/satellite/setup.yml @@ -31,6 +31,7 @@ controller_credentials: - name: Satellite Inventory credential_type: Red Hat Satellite 6 organization: Default + state: exists inputs: host: https://satellite.example.com username: admin @@ -38,6 +39,7 @@ controller_credentials: - name: Satellite Credential credential_type: Satellite Collection organization: Default + state: exists inputs: host: https://satellite.example.com username: admin From f554bc0ee1371ac840eb86a335eed2ad684720f4 Mon Sep 17 00:00:00 2001 From: willtome Date: Thu, 6 Jun 2024 09:45:37 -0400 Subject: [PATCH 6/7] Revert "add state exists to credentials" This reverts commit 88b171bb489732c6301fc6353e505b9afa36648b. --- cloud/setup.yml | 1 - collections/requirements.yml | 6 +++--- linux/setup.yml | 1 - openshift/setup.yml | 1 - satellite/setup.yml | 2 -- 5 files changed, 3 insertions(+), 8 deletions(-) diff --git a/cloud/setup.yml b/cloud/setup.yml index faa8804..c2a1f12 100644 --- a/cloud/setup.yml +++ b/cloud/setup.yml @@ -20,7 +20,6 @@ controller_credentials: credential_type: Amazon Web Services organization: Default update_secrets: false - state: exists inputs: username: REPLACEME password: REPLACEME diff --git a/collections/requirements.yml b/collections/requirements.yml index 4cd6753..435dff2 100644 --- a/collections/requirements.yml +++ b/collections/requirements.yml @@ -1,9 +1,9 @@ --- collections: - name: ansible.controller - version: 4.5.6 - - name: infra.controller_configuration - version: 2.8.1 + version: 4.4.0 + - name: redhat_cop.controller_configuration + version: 2.3.1 # linux - name: ansible.posix version: 1.5.4 diff --git a/linux/setup.yml b/linux/setup.yml index dcc21c6..93a0221 100644 --- a/linux/setup.yml +++ b/linux/setup.yml @@ -27,7 +27,6 @@ controller_credentials: - name: Insights Inventory credential_type: Insights Collection organization: Default - state: exists inputs: insights_user: REPLACEME insights_password: REPLACEME diff --git a/openshift/setup.yml b/openshift/setup.yml index 3c8cc9e..a505b52 100644 --- a/openshift/setup.yml +++ b/openshift/setup.yml @@ -3,7 +3,6 @@ controller_credentials: - name: OpenShift Credential organization: Default credential_type: OpenShift or Kubernetes API Bearer Token - state: exists inputs: host: CHANGEME bearer_token: CHANGEME diff --git a/satellite/setup.yml b/satellite/setup.yml index 6ae2b6e..193ff6b 100644 --- a/satellite/setup.yml +++ b/satellite/setup.yml @@ -31,7 +31,6 @@ controller_credentials: - name: Satellite Inventory credential_type: Red Hat Satellite 6 organization: Default - state: exists inputs: host: https://satellite.example.com username: admin @@ -39,7 +38,6 @@ controller_credentials: - name: Satellite Credential credential_type: Satellite Collection organization: Default - state: exists inputs: host: https://satellite.example.com username: admin From c6c3231234a7fb0b7d14417747fcf233afa2640f Mon Sep 17 00:00:00 2001 From: Chris Edillon <67980205+jce-redhat@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:17:09 -0400 Subject: [PATCH 7/7] updated requirements to match product-demos-ee (#145) --- collections/requirements.yml | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/collections/requirements.yml b/collections/requirements.yml index 435dff2..1c0759c 100644 --- a/collections/requirements.yml +++ b/collections/requirements.yml @@ -1,44 +1,30 @@ --- collections: - name: ansible.controller - version: 4.4.0 + - name: infra.ah_configuration + - name: infra.controller_configuration - name: redhat_cop.controller_configuration - version: 2.3.1 # linux - name: ansible.posix - version: 1.5.4 - - name: redhat.insights - version: 1.0.7 - - name: redhat.rhel_system_roles - version: 1.20.0 - name: community.general - version: 6.3.0 + version: ">=8.0.0" - name: containers.podman + - name: redhat.insights + - name: redhat.rhel_system_roles # windows + - name: ansible.windows - name: chocolatey.chocolatey - name: community.windows - version: 1.12.0 - - name: ansible.windows - version: 1.13.0 # cloud - - name: azure.azcollection - version: 1.14.0 - name: amazon.aws - version: 5.2.0 # satellite - name: redhat.satellite - version: 3.8.0 # network - - name: cisco.ios - version: 4.4.0 - - name: cisco.nxos - version: 4.1.0 - - name: cisco.iosxr - version: 5.0.0 - name: ansible.netcommon - version: 5.0.0 + - name: cisco.ios + - name: cisco.iosxr + - name: cisco.nxos # openshift - - name: redhat.openshift - version: 2.3.0 - name: kubernetes.core - version: 2.4.0 + - name: redhat.openshift + - name: redhat.openshift_virtualization