diff --git a/changelogs/fragments/add_eda_install_on_ocp.yaml b/changelogs/fragments/add_eda_install_on_ocp.yaml new file mode 100644 index 0000000..a13b9fa --- /dev/null +++ b/changelogs/fragments/add_eda_install_on_ocp.yaml @@ -0,0 +1,2 @@ +minor_changes: + - Added ability to install EDA Controller on OCP diff --git a/roles/aap_ocp_install/README.md b/roles/aap_ocp_install/README.md index 9edcaec..95fe9ce 100644 --- a/roles/aap_ocp_install/README.md +++ b/roles/aap_ocp_install/README.md @@ -20,6 +20,9 @@ A description of the settable variables for this role should go here, including | aap_ocp_install_operator | Yes* | None | YAML Manifest to override the generated operator `Namespace` resource | | aap_ocp_install_controller | Yes* | None | Dictionary containing keys defined in the `controller variables table` | | aap_ocp_install_hub | Yes* | None | Dictionary containing keys defined in the `hub variables table` | +| aap_ocp_install_eda | Yes* | None | Dictionary containing keys defined in the `eda variables table` | +| aap_ocp_install_platform | Yes* | None | Dictionary containing keys defined in the `platform variables table` | +| aap_ocp_install_lightspeed | No | None | Indicates whether to install the Lightspeed component in an AAP platform installation | \* Variable and required keys must be defined when the type of tag is specified (e.g. `--tags controller` requires the aap_ocp_install_controller variable be defined). If the variable is omitted the corresponding component will not be installed (e.g. if only aap_ocp_install_hub variable is defined then the operator and controller installation will be skipped) @@ -40,12 +43,14 @@ If the variable is omitted the corresponding component will not be installed (e. | Key Name | Required | Default Value | Description | |----------------------------------|:---------:|---------------|---------------------------------------------------------------------| -| channel | Yes | None | Channel to subscribe (e.g. stable-2.2 or stable-2.2-cluster-scoped) | +| channel | Yes | None | Channel to subscribe (e.g. stable-2.2 or stable-2.2-cluster-scoped)*| | approval | | Automatic | Update approval method. Valid values are Automatic or Manual. | | operatorgroup_create | | true | Create the `OperatorGroup` for the Operator | | operatorgroup_manifest_overrides | | | YAML Manifest to override the generated `OperatorGroup` resource | | subscription_manifest_overrides | | | YAML Manifest to override the generated `Subscription` resource | +\* If the channel indicates version 2.5 or above of AAP, then the new AAP operator platform installation method will be used. + > ℹ️ **NOTE** > > When `approval` is set to `Manual` the operator will be installed with `Automatic` approval and then after installation the approval will be updated to Manual. @@ -78,6 +83,13 @@ If the variable is omitted the corresponding component will not be installed (e. | link_text | | Automation Hub () | Text used for creating the OCP application link | | hub_manifest_overrides | | None | YAML Manifest to override the generated `AutomationHub` resource | | consolelink_manifest_overrides | | None | YAML Manifest to override the generated `ConsoleLink` resource | +| storage_type | | file | Hub storage type (file, S3 or azure)* | +| file_storage_storage_class | | None | OpenShift StorageClass to use for file storage type for hub* | +| file_storage_size | | 10Gi | Storage size for file storage type for hub* | +| object_storage_s3_secret | | None | Name of an OpenShift Secret used to access S3 storage for hub* | +| object_storage_azure_secret | | None | Name of an OpenShift Secret used to access Azure storage for hub* | + +\* These settings are only used for installing AAP 2.5 or later. ### aap_ocp_install_eda keys @@ -90,6 +102,16 @@ If the variable is omitted the corresponding component will not be installed (e. | eda_manifest_overrides | | None | YAML Manifest to override the generated `EDA` resource | | consolelink_manifest_overrides | | None | YAML Manifest to override the generated `ConsoleLink` resource | +### aap_ocp_install_platform keys + +| Key Name | Required | Default Value | Description | +|---------------|:--------:|----------------------------------|-------------------------------------------------| +| instance_name | Yes | None | Name of the AAP Platform instance to create | + +> ℹ️ **NOTE** +> +> These settings are only used when installing AAP 2.5 or later. instance_name and link_text values for individual components (hub, controller, eda) will be ignored when using the platform installation method. + ## Dependencies This role depends on the redhat.openshift and kubernetes.core collections. diff --git a/roles/aap_ocp_install/defaults/main.yml b/roles/aap_ocp_install/defaults/main.yml index 69e5bac..7d04fbb 100644 --- a/roles/aap_ocp_install/defaults/main.yml +++ b/roles/aap_ocp_install/defaults/main.yml @@ -14,6 +14,10 @@ # aap_ocp_install_operator: # channel: +# Variables applicable to the Ansible platform installation +# aap_ocp_install_platform: +# instance_name: + # Variable applicable to the controller installation # aap_ocp_install_controller: # instance_name: @@ -24,6 +28,11 @@ # aap_ocp_install_hub: # instance_name: # link_text: +# storage_type: +# file_storage_storage_class: +# file_storage_size: +# object_storage_s3_secret: +# object_storage_azure_secret: # Variable applicable to the EDA installation # aap_ocp_install_eda: @@ -31,4 +40,8 @@ # instance_name: # replicas: # link_text: + +# Variables applicable to the Lightspeed installation +# aap_ocp_install_lightspeed: +# ... diff --git a/roles/aap_ocp_install/tasks/install-platform.yml b/roles/aap_ocp_install/tasks/install-platform.yml new file mode 100644 index 0000000..859f3f3 --- /dev/null +++ b/roles/aap_ocp_install/tasks/install-platform.yml @@ -0,0 +1,63 @@ +--- +- name: Create platform namespace + kubernetes.core.k8s: + host: "{{ __aap_ocp_install_auth_results['openshift_auth']['host'] }}" + api_key: "{{ __aap_ocp_install_auth_results['openshift_auth']['api_key'] }}" + validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}" + state: present + resource_definition: "{{ lookup('ansible.builtin.template', 'namespace.yaml.j2', template_vars=ns_vars) | from_yaml }}" + apply: true + vars: + ns_vars: + ns_name: "{{ aap_ocp_install_platform['namespace'] }}" + when: + - aap_ocp_install_platform['namespace'] is defined + +- name: Create automation platform instance + kubernetes.core.k8s: + host: "{{ __aap_ocp_install_auth_results['openshift_auth']['host'] }}" + api_key: "{{ __aap_ocp_install_auth_results['openshift_auth']['api_key'] }}" + validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}" + state: present + resource_definition: "{{ lookup('template', 'platform/instance.yaml.j2') | from_yaml }}" + apply: true + +- name: Wait for operator to create the automation platform route + kubernetes.core.k8s_info: + host: "{{ __aap_ocp_install_auth_results['openshift_auth']['host'] }}" + api_key: "{{ __aap_ocp_install_auth_results['openshift_auth']['api_key'] }}" + validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}" + kind: Route + name: "{{ aap_ocp_install_platform['instance_name'] | mandatory }}" + api_version: route.openshift.io/v1 + namespace: "{{ aap_ocp_install_platform['namespace'] | default(aap_ocp_install_namespace) | mandatory }}" + register: __aap_ocp_install_platform_route_result + until: __aap_ocp_install_platform_route_result['resources'] + retries: 60 # Wait for 15 minutes (60*15/60) + delay: 15 + +- name: Store automation platform route + ansible.builtin.set_fact: + __aap_ocp_install_platform_route: "{{ __aap_ocp_install_platform_route_result['resources'][0]['status']['ingress'][0]['host'] }}" + +- name: Ensure automation controller login is available + ansible.builtin.uri: + url: "https://{{ __aap_ocp_install_platform_route }}" + validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}" + method: GET + status_code: + - 200 + register: _aap_ocp_install_platform_available + until: (_aap_ocp_install_platform_available['status'] == 200) and ('migrations_notran' not in _aap_ocp_install_platform_available['url']) + retries: 120 # Wait for 30 minutes (120*15/60) + delay: 15 + +- name: Create automation platform console link + kubernetes.core.k8s: + host: "{{ __aap_ocp_install_auth_results['openshift_auth']['host'] }}" + api_key: "{{ __aap_ocp_install_auth_results['openshift_auth']['api_key'] }}" + validate_certs: "{{ aap_ocp_install_connection['validate_certs'] | default(omit) }}" + state: present + resource_definition: "{{ lookup('template', 'platform/consolelink.yaml.j2') | from_yaml }}" + apply: true +... diff --git a/roles/aap_ocp_install/tasks/main.yml b/roles/aap_ocp_install/tasks/main.yml index 140f516..6b7a44d 100644 --- a/roles/aap_ocp_install/tasks/main.yml +++ b/roles/aap_ocp_install/tasks/main.yml @@ -29,13 +29,23 @@ tags: - operator + - name: Include Ansible Automation Platform platform install tasks + ansible.builtin.include_tasks: + file: install-platform.yml + apply: + tags: + - platform + when: aap_ocp_install_platform is defined and __aap_ocp_install_25_install + tags: + - platform + - name: Include Ansible Automation Platform controller install tasks ansible.builtin.include_tasks: file: install-controller.yml apply: tags: - controller - when: aap_ocp_install_controller is defined + when: aap_ocp_install_controller is defined and not __aap_ocp_install_25_install tags: - controller @@ -45,7 +55,7 @@ apply: tags: - hub - when: aap_ocp_install_hub is defined + when: aap_ocp_install_hub is defined and not __aap_ocp_install_25_install tags: - hub @@ -55,7 +65,7 @@ apply: tags: - eda - when: aap_ocp_install_eda is defined + when: aap_ocp_install_eda is defined and not __aap_ocp_install_25_install tags: - eda diff --git a/roles/aap_ocp_install/tasks/pre-validate-platform.yml b/roles/aap_ocp_install/tasks/pre-validate-platform.yml new file mode 100644 index 0000000..b98fce5 --- /dev/null +++ b/roles/aap_ocp_install/tasks/pre-validate-platform.yml @@ -0,0 +1,198 @@ +--- +- name: Ensure platform instance name variable is set (block) + block: + - name: Ensure paltform instance name variable is set + ansible.builtin.assert: + that: + - aap_ocp_install_platform['instance_name'] | default('', true) | length > 0 + quiet: true + rescue: + - name: Update validation errors fact - platform instance_name + ansible.builtin.set_fact: + __aap_ocp_install_prevalidate_errors: > + {{ __aap_ocp_install_prevalidate_errors + ["aap_ocp_install_platform['instance_name'] must be set"] }} + +- name: Ensure controller admin username variable is set (block) + when: aap_ocp_install_controller['admin_user'] is defined + block: + - name: Ensure controller admin username variable is set + ansible.builtin.assert: + that: + - aap_ocp_install_controller['admin_user'] | default('', true) | length > 0 + quiet: true + rescue: + - name: Update validation errors fact - controller admin_user + ansible.builtin.set_fact: + __aap_ocp_install_prevalidate_errors: > + {{ __aap_ocp_install_prevalidate_errors + ["aap_ocp_install_controller['admin_user'] must be a non-empty string"] }} + +- name: Ensure controller namespace variable is set (block) + when: aap_ocp_install_controller['namespace'] is defined + block: + - name: Ensure controller namespace variable is set + ansible.builtin.assert: + that: + - aap_ocp_install_controller['namespace'] | default("", true) | regex_search('^[a-z0-9]([-a-z0-9]*[a-z0-9])?$') + quiet: true + rescue: + - name: Update validation errors fact - namespace + ansible.builtin.set_fact: + __aap_ocp_install_prevalidate_errors: > + {{ __aap_ocp_install_prevalidate_errors + ["aap_ocp_install_controller['namespace'] must be a lowercase RFC 1123 label consisting of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc'"] }} + +- name: Ensure controller link text variable is set (block) + when: aap_ocp_install_controller['link_text'] is defined + block: + - name: Ensure controller link text variable is set + ansible.builtin.assert: + that: + - aap_ocp_install_controller['link_text'] | default('', true) | length > 0 + quiet: true + rescue: + - name: Update validation errors fact - controller link_text + ansible.builtin.set_fact: + __aap_ocp_install_prevalidate_errors: > + {{ __aap_ocp_install_prevalidate_errors + ["aap_ocp_install_controller['link_text'] must be a non-empty string"] }} + +- name: Ensure controller image pull policy is valid (block) + when: aap_ocp_install_controller['image_pull_policy'] is defined + block: + - name: Ensure controller image pull policy is valid + ansible.builtin.assert: + that: + - aap_ocp_install_controller['image_pull_policy'] is in ['IfNotPresent', 'Always', 'Never'] + quiet: true + rescue: + - name: Update validation errors fact - controller image_pull_policy + ansible.builtin.set_fact: + __aap_ocp_install_prevalidate_errors: > + {{ __aap_ocp_install_prevalidate_errors + ["aap_ocp_install_controller['image_pull_policy'] must be one of: IfNotPresent, Always, or Never"] }} + +- name: Ensure controller create preload data is valid (block) + when: aap_ocp_install_controller['create_preload_data'] is defined + block: + - name: Ensure controller create preload data is valid + ansible.builtin.assert: + that: + - (aap_ocp_install_controller['create_preload_data'] | string | lower) is in ['true', 'false'] + quiet: true + rescue: + - name: Update validation errors fact - controller create_preload_data + ansible.builtin.set_fact: + __aap_ocp_install_prevalidate_errors: > + {{ __aap_ocp_install_prevalidate_errors + ["aap_ocp_install_controller['create_preload_data'] must be one of: true or false"] }} + +- name: Ensure controller garbage collect secrets is valid (block) + when: aap_ocp_install_controller['garbage_collect_secrets'] is defined + block: + - name: Ensure controller garbage collect secrets is valid + ansible.builtin.assert: + that: + - (aap_ocp_install_controller['garbage_collect_secrets'] | string | lower) is in ['true', 'false'] + quiet: true + rescue: + - name: Update validation errors fact - controller garbage_collect_secrets + ansible.builtin.set_fact: + __aap_ocp_install_prevalidate_errors: > + {{ __aap_ocp_install_prevalidate_errors + ["aap_ocp_install_controller['garbage_collect_secrets'] must be one of: true or false"] }} + +- name: Ensure controller projects persistence is valid (block) + when: aap_ocp_install_controller['projects_persistence'] is defined + block: + - name: Ensure controller projects persistence is valid + ansible.builtin.assert: + that: + - (aap_ocp_install_controller['projects_persistence'] | string | lower) is in ['true', 'false'] + quiet: true + rescue: + - name: Update validation errors fact - controller projects_persistence + ansible.builtin.set_fact: + __aap_ocp_install_prevalidate_errors: > + {{ __aap_ocp_install_prevalidate_errors + ["aap_ocp_install_controller['projects_persistence'] must be one of: true or false"] }} + +- name: Ensure controller replicas is valid (block) + when: aap_ocp_install_controller['replicas'] is defined + block: + - name: Ensure controller replicas is valid + ansible.builtin.assert: + that: + - (aap_ocp_install_controller['replicas'] | int) > 0 + quiet: true + rescue: + - name: Update validation errors fact - controller replicas + ansible.builtin.set_fact: + __aap_ocp_install_prevalidate_errors: > + {{ __aap_ocp_install_prevalidate_errors + ["aap_ocp_install_controller['replicas'] must be a number greater than 0"] }} + +- name: Ensure controller projects storage size is valid (block) + when: aap_ocp_install_controller['projects_storage_size'] is defined + block: + - name: Ensure controller projects storage size is valid + ansible.builtin.assert: + that: + - (aap_ocp_install_controller['projects_storage_size'] | regex_replace('^(?P[0-9]+)(?PKi|K|Mi|M|Gi|G|Ti|T|Pi|P|Ei|E)$', '\\g') | int) > 0 + - (aap_ocp_install_controller['projects_storage_size'] | regex_replace('^(?P[0-9]+)(?PKi|K|Mi|M|Gi|G|Ti|T|Pi|P|Ei|E)$', '\\g')) is in ['Ki','K','Mi','M','Gi','G','Ti','T','Pi','P','Ei','E'] + quiet: true + rescue: + - name: Update validation errors fact - projects_storage_size replicas + ansible.builtin.set_fact: + __aap_ocp_install_prevalidate_errors: > + {{ __aap_ocp_install_prevalidate_errors + ["aap_ocp_install_controller['projects_storage_size'] must be a number greater than 0 with a size (e.g. 12Gi or 10000M)"] }} + +- name: Ensure hub storage type is valid (block) + when: aap_ocp_install_hub is defined + block: + - name: Ensure hub storage type is valid + ansible.builtin.assert: + that: + - (aap_ocp_install_hub['storage_type']) is in ['file', 'S3', 'azure'] + quiet: true + rescue: + - name: Update validation errors fact - storage_type + ansible.builtin.set_fact: + __aap_ocp_install_prevalidate_errors: > + {{ __aap_ocp_install_prevalidate_errors + ["aap_ocp_install_hub['storage_type'] must be 'file', 'S3' or 'azure'"] }} + +- name: Ensure hub file storage settings are valid (block) + when: aap_ocp_install_hub['storage_type'] is defined and aap_ocp_install_hub['storage_type'] == 'file' + block: + - name: Ensure hub file storage settings are valid + ansible.builtin.assert: + that: + - (aap_ocp_install_hub['file_storage_size'] is not defined) or (aap_ocp_install_hub['file_storage_size'] | regex_replace('^(?P[0-9]+)(?PKi|K|Mi|M|Gi|G|Ti|T|Pi|P|Ei|E)$', '\\g') | int) > 0 + - (aap_ocp_install_hub['file_storage_size'] is not defined) or (aap_ocp_install_hub['file_storage_size'] | regex_replace('^(?P[0-9]+)(?PKi|K|Mi|M|Gi|G|Ti|T|Pi|P|Ei|E)$', '\\g')) is in ['Ki','K','Mi','M','Gi','G','Ti','T','Pi','P','Ei','E'] + quiet: true + rescue: + - name: Update validation errors fact - file storage_type + ansible.builtin.set_fact: + __aap_ocp_install_prevalidate_errors: > + {{ __aap_ocp_install_prevalidate_errors + ["aap_ocp_install_hub['file_storage_size'] must be a number greater than 0 with a size (e.g. 12Gi or 10000M)"] }} + +- name: Ensure hub S3 storage settings are valid (block) + when: aap_ocp_install_hub['storage_type'] is defined and aap_ocp_install_hub['storage_type'] == 'S3' + block: + - name: Ensure hub S3 storage settings are valid + ansible.builtin.assert: + that: + - (aap_ocp_install_hub['object_storage_s3_secret']) is defined + quiet: true + rescue: + - name: Update validation errors fact - S3 secret + ansible.builtin.set_fact: + __aap_ocp_install_prevalidate_errors: > + {{ __aap_ocp_install_prevalidate_errors + ["aap_ocp_install_hub['object_storage_s3_secret'] must be the name of a valid S3 storage secret name"] }} + +- name: Ensure hub Azure storage settings are valid (block) + when: aap_ocp_install_hub['storage_type'] is defined and aap_ocp_install_hub['storage_type'] == 'azure' + block: + - name: Ensure hub Azure storage settings are valid + ansible.builtin.assert: + that: + - (aap_ocp_install_hub['object_storage_azure_secret']) is defined + quiet: true + rescue: + - name: Update validation errors fact - Azure secret + ansible.builtin.set_fact: + __aap_ocp_install_prevalidate_errors: > + {{ __aap_ocp_install_prevalidate_errors + ["aap_ocp_install_hub['object_storage_azure_secret'] must be the name of a valid Azure storage secret name"] }} +... diff --git a/roles/aap_ocp_install/tasks/pre-validate.yml b/roles/aap_ocp_install/tasks/pre-validate.yml index 18dee1d..ccb183b 100644 --- a/roles/aap_ocp_install/tasks/pre-validate.yml +++ b/roles/aap_ocp_install/tasks/pre-validate.yml @@ -94,17 +94,43 @@ when: - ( 'operator' in ansible_run_tags ) or ( 'all' in ansible_run_tags and aap_ocp_install_operator is defined ) +- name: Retrieve the requested operator channel version numbers + ansible.builtin.set_fact: + __aap_ocp_install_major_version: "{{ aap_ocp_install_operator['channel'] | regex_search(__aap_ocp_install_major_version_re, '\\1') | first }}" + __aap_ocp_install_minor_version: "{{ aap_ocp_install_operator['channel'] | regex_search(__aap_ocp_install_minor_version_re, '\\1') | first }}" + vars: + __aap_ocp_install_major_version_re: '(\d+)\.\d+' + __aap_ocp_install_minor_version_re: '\d+\.(\d+)' + +- name: Set a flag indicating whether to use the new (AAP 2.5+) operator installation method + ansible.builtin.set_fact: + __aap_ocp_install_25_install: "{{ (__aap_ocp_install_major_version | int) > 2 \ + or (( __aap_ocp_install_major_version | int) == 2 \ + and ( __aap_ocp_install_minor_version | int) >= 5) }}" + +- name: Ensure platform variables are set + ansible.builtin.include_tasks: + file: pre-validate-platform.yml + when: + - (( 'platform' in ansible_run_tags ) or ( 'all' in ansible_run_tags and aap_ocp_install_platform is defined )) and __aap_ocp_install_25_install + - name: Ensure controller variables are set ansible.builtin.include_tasks: file: pre-validate-controller.yml when: - - ( 'controller' in ansible_run_tags ) or ( 'all' in ansible_run_tags and aap_ocp_install_controller is defined ) + - (( 'controller' in ansible_run_tags ) or ( 'all' in ansible_run_tags and aap_ocp_install_controller is defined )) and not __aap_ocp_install_25_install - name: Ensure hub variables are set ansible.builtin.include_tasks: file: pre-validate-hub.yml when: - - ( 'hub' in ansible_run_tags ) or ( 'all' in ansible_run_tags and aap_ocp_install_hub is defined ) + - (( 'hub' in ansible_run_tags ) or ( 'all' in ansible_run_tags and aap_ocp_install_hub is defined )) and not __aap_ocp_install_25_install + +- name: Ensure eda variables are set + ansible.builtin.include_tasks: + file: pre-validate-eda.yml + when: + - (( 'eda' in ansible_run_tags ) or ( 'all' in ansible_run_tags and aap_ocp_install_eda is defined )) and not __aap_ocp_install_25_install - name: Ensure eda variables are set ansible.builtin.include_tasks: diff --git a/roles/aap_ocp_install/templates/platform/consolelink.yaml.j2 b/roles/aap_ocp_install/templates/platform/consolelink.yaml.j2 new file mode 100644 index 0000000..1f2d3ab --- /dev/null +++ b/roles/aap_ocp_install/templates/platform/consolelink.yaml.j2 @@ -0,0 +1,17 @@ +--- +apiVersion: console.openshift.io/v1 +kind: ConsoleLink +metadata: + name: {{ aap_ocp_install_platform['instance_name'] }} +spec: + applicationMenu: + section: Red Hat applications + imageURL: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAIAAAAiOjnJAAAc1klEQVR42u2deXAUZfrH++3uuTP3JCFAEnJBQBSQQ1jW6LIJAkYMRwgG5IgskUWMFVJsbYm4/sBdZSFldBVhFQrQaOIVMIAhuFJZEeQQEA8gdzhCJjOTzEzm7uP3By6FSN5M0nN0J++39g/LHSfT7/vp933e530OwLIshoQUaOFoCJAQWEgILCQEFhISAgsJgYWEwEJCQmAhIbCQEFhISAgsJAQWEgILCQmBhYTAQkJgISEhsJAQWEgDTCQagruIZVmKYmkaoyiWYTCWxW4P4AYAAwDgOEaSgCAASWIAoDFDYP0aIIZhvV6qvZ1qb/e1tHjq671Xr1JmM2U202Yz7XAwPh9L0yzD3EwOAAAAHAcEgYtEhEJB6PWkXk/q9eKhQyVJSaK4ODIykoyMBGIxwPGBDNzAA4thGKfTZzK5L150XrzoPn3a3dDga2ykOzsZnw+j6b5/803aNBpRQoI0MVE6YYI8NVWamioyGHC5HMMHltUBBkiWDktR3uZm5/Hj9pMnXWfPupua6LY21ucL7uCKRER0tHTYMNm4ccpJk+RTpojj4wFJIrAEv9MxTqfrp5/sNTXW/fvdFy5QVivGMGE6JuGkWi2991717NnKtDT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utp1/jzd0cGvLU+rlY0Zo8rI0GZlSUaMAP0x6r9/gnXLN8E4na6ffrLX1Fj373dfuEBZrWGLmMBxUq2W3nuvevZsZVqabNQoXC4XlgcBgXV3I8zb3Ow8ftx+8qTr7Fl3UxPd1varWsXBGFyRiIiOlg4bJhs3TjlpknzKFHF8/ACJwB4oYN1uhzFOp89kcl+86Pz5Z/fp0+7GRl9jI93ZyVAUxsXqJ0mcJAmNRpSQIE1IkE6YIB85UpqaKjIYcLl8oJXZGXhg/XqvZBmG9Xqp9nbKaPS1tHgaGrxXr1JmM2U202Yz7XAwPh9L0yzD3BwoAADAcUAQuEhEKBSEXk/q9aReLx46VJKYKIqLI6OiyMhIIBYDHO/HOx0Cq6/AURRLURhNswyDseyvriYBwAAAOI4RBCBJQJIDGSAEFlJozypoCJAQWEgILCQEFhISAgsJgYWEwEJCQmAhIbCQEFhISAgsJAQWEgILCQmBhYTAQkJgISEhsJAQWEgDTP8PYtUOifNZCQcAAAAASUVORK5CYII= + href: 'https://{{ __aap_ocp_install_platform_route }}/' + location: ApplicationMenu +{% if aap_ocp_install_platform['link_text'] is defined %} + text: {{ aap_ocp_install_platform['link_text'] }} +{% else %} + text: Ansible Automation Platform ({{ aap_ocp_install_platform['instance_name'] }}) +{% endif%} +... diff --git a/roles/aap_ocp_install/templates/platform/instance.yaml.j2 b/roles/aap_ocp_install/templates/platform/instance.yaml.j2 new file mode 100644 index 0000000..16f767b --- /dev/null +++ b/roles/aap_ocp_install/templates/platform/instance.yaml.j2 @@ -0,0 +1,57 @@ +--- +apiVersion: aap.ansible.com/v1alpha1 +kind: AnsibleAutomationPlatform +metadata: + name: {{ aap_ocp_install_platform['instance_name'] }} + namespace: {{ aap_ocp_install_namespace }} +spec: + # Platform + image_pull_policy: IfNotPresent + + # Components +{% if aap_ocp_install_controller is defined %} + controller: + disabled: false + create_preload_data: {{ aap_ocp_install_controller['create_preload_data'] | default(true) | bool }} + garbage_collect_secrets: {{ aap_ocp_install_controller['garbage_collect_secrets'] | default(false) | bool }} + image_pull_policy: {{ aap_ocp_install_controller['image_pull_policy'] | default('IfNotPresent') }} + projects_persistence: {{ aap_ocp_install_controller['projects_persistence'] | default(false) | bool }} + projects_storage_size: {{ aap_ocp_install_controller['projects_storage_size'] | default('8Gi') }} + replicas: {{ aap_ocp_install_controller['replicas'] | default(1) | int }} + admin_user: {{ aap_ocp_install_controller['admin_user'] | default('admin') }} +{% else %} + controller: + disabled: true +{% endif %} + +{% if aap_ocp_install_eda is defined %} + eda: + disabled: false + replicas: {{ aap_ocp_install_eda['replicas'] | default(1) | int }} +{% else %} + eda: + disabled: true +{% endif %} + +{% if aap_ocp_install_hub is defined %} + hub: + disabled: false + ## Modify to contain your RWM storage class name + storage_type: {{ aap_ocp_install_hub['storage_type'] | default('file') }} +{% if aap_ocp_install_hub['storage_type'] is defined and aap_ocp_install_hub['storage_type'] == 'file' %} +{% if aap_ocp_install_hub['file_storage_storage_class'] is defined %} + file_storage_storage_class: {{ aap_ocp_install_hub['file_storage_storage_class'] | default('default') }} +{% endif %} + file_storage_size: {{ aap_ocp_install_hub['file_storage_size'] | default('10Gi') }} +{% elif aap_ocp_install_hub['storage_type'] is defined and aap_ocp_install_hub['storage_type'] == 'S3' %} + object_storage_s3_secret: {{ aap_ocp_install_hub['object_storage_s3_secret'] }} +{% elif aap_ocp_install_hub['storage_type'] is defined and aap_ocp_install_hub['storage_type'] == 'azure' %} + object_storage_azure_secret: {{ aap_ocp_install_hub['object_storage_azure_secret'] }} +{% endif %} +{% else %} + hub: + disabled: true +{% endif %} + + lightspeed: + disabled: {{ aap_ocp_install_lightspeed is not defined | bool }}