diff --git a/.gitignore b/.gitignore index bb9433c..fc9639e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ - +ansible-navigator.log sean_login_info.yml .DS_Store choose_demo.yml @@ -6,6 +6,7 @@ choose_demo_example_azure.yml choose_demo_example_aws.yml .ansible.cfg *.gz - +*artifact*.json **/roles/* !**/roles/requirements.yml +.deployment_id 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 diff --git a/cloud/setup.yml b/cloud/setup.yml index 1a4ced6..c2a1f12 100644 --- a/cloud/setup.yml +++ b/cloud/setup.yml @@ -1,14 +1,7 @@ --- -user_message: +_deployment_id: "{{ lookup('file', playbook_dir + '/.deployment_id') }}" -controller_components: - - execution_environments - - projects - - credentials - - inventory_sources - - groups - - job_templates - - workflow_job_templates +user_message: controller_execution_environments: - name: Cloud Services Execution Environment @@ -293,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: '' @@ -321,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/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 diff --git a/linux/setup.yml b/linux/setup.yml index a950c53..93a0221 100644 --- a/linux/setup.yml +++ b/linux/setup.yml @@ -3,13 +3,9 @@ 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 +# "!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 @@ -24,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 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..a49ad78 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 @@ -54,15 +49,16 @@ - 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" - 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