diff --git a/ansible/templates/crd.yml.j2 b/ansible/templates/crd.yml.j2 index 78d5ec91..72cb649c 100644 --- a/ansible/templates/crd.yml.j2 +++ b/ansible/templates/crd.yml.j2 @@ -26,9 +26,6 @@ spec: deployment_type: description: Name of the deployment type type: string - api_version: - description: API version identified - type: string tower_task_privileged: description: If a privileged security context should be enabled type: boolean @@ -236,6 +233,9 @@ spec: towerVersion: description: Version of the deployed instance type: string + towerImage: + description: URL of the image used for the deployed instance + type: string conditions: description: The resulting conditions when a Service Telemetry is instantiated items: diff --git a/deploy/awx-operator.yaml b/deploy/awx-operator.yaml index 9bd17fa2..fba7c2d0 100644 --- a/deploy/awx-operator.yaml +++ b/deploy/awx-operator.yaml @@ -167,9 +167,6 @@ spec: deployment_type: description: Name of the deployment type type: string - api_version: - description: API version identified - type: string tower_task_privileged: description: If a privileged security context should be enabled type: boolean @@ -377,6 +374,9 @@ spec: towerVersion: description: Version of the deployed instance type: string + towerImage: + description: URL of the image used for the deployed instance + type: string conditions: description: The resulting conditions when a Service Telemetry is instantiated items: diff --git a/deploy/crds/awx_v1beta1_crd.yaml b/deploy/crds/awx_v1beta1_crd.yaml index 78d5ec91..72cb649c 100644 --- a/deploy/crds/awx_v1beta1_crd.yaml +++ b/deploy/crds/awx_v1beta1_crd.yaml @@ -26,9 +26,6 @@ spec: deployment_type: description: Name of the deployment type type: string - api_version: - description: API version identified - type: string tower_task_privileged: description: If a privileged security context should be enabled type: boolean @@ -236,6 +233,9 @@ spec: towerVersion: description: Version of the deployed instance type: string + towerImage: + description: URL of the image used for the deployed instance + type: string conditions: description: The resulting conditions when a Service Telemetry is instantiated items: diff --git a/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml b/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml index 0ffd8adf..09c593d9 100644 --- a/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml +++ b/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml @@ -81,6 +81,11 @@ spec: x-descriptors: - urn:alm:descriptor:com.tectonic.ui:advanced - urn:alm:descriptor:com.tectonic.ui:text + - displayName: Admin account username + path: tower_admin_user + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:advanced + - urn:alm:descriptor:com.tectonic.ui:text - displayName: Admin email address path: tower_admin_email x-descriptors: @@ -108,11 +113,23 @@ spec: - urn:alm:descriptor:com.tectonic.ui:select:none - urn:alm:descriptor:com.tectonic.ui:select:Ingress - urn:alm:descriptor:com.tectonic.ui:select:Route + - displayName: Tower Ingress Annotations + path: tower_ingress_annotations + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:advanced + - urn:alm:descriptor:com.tectonic.ui:text + - urn:alm:descriptor:com.tectonic.ui:fieldDependency:tower_ingress_type:Ingress + - displayName: Tower Ingress TLS Secret + path: tower_ingress_tls_secret + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:advanced + - urn:alm:descriptor:io.kubernetes:Secret + - urn:alm:descriptor:com.tectonic.ui:fieldDependency:tower_ingress_type:Ingress - displayName: Route DNS host path: tower_route_host x-descriptors: - urn:alm:descriptor:com.tectonic.ui:advanced - - urn:alm:descriptor:com.tectonic.ui:label + - urn:alm:descriptor:com.tectonic.ui:text - urn:alm:descriptor:com.tectonic.ui:fieldDependency:tower_ingress_type:Route - displayName: Route TLS termination mechanism path: tower_route_tls_termination_mechanism @@ -142,6 +159,11 @@ spec: x-descriptors: - urn:alm:descriptor:com.tectonic.ui:advanced - urn:alm:descriptor:com.tectonic.ui:resourceRequirements + - displayName: PostgreSQL container resource requirements (when using a managed instance) + path: tower_postgres_resource_requirements + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:advanced + - urn:alm:descriptor:com.tectonic.ui:resourceRequirements - displayName: Replicas path: tower_replicas x-descriptors: @@ -157,6 +179,26 @@ spec: x-descriptors: - urn:alm:descriptor:com.tectonic.ui:advanced - urn:alm:descriptor:com.tectonic.ui:booleanSwitch + - displayName: Deployment Type + path: deployment_type + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:advanced + - urn:alm:descriptor:com.tectonic.ui:hidden + - displayName: Tower Image + path: tower_image + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:advanced + - urn:alm:descriptor:com.tectonic.ui:hidden + - displayName: Tower Postgres Storage Class + path: tower_postgres_storage_class + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:advanced + - urn:alm:descriptor:com.tectonic.ui:hidden + - displayName: Certificate Authorirty Trust Bundle + path: ca_trust_bundle + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:advanced + - urn:alm:descriptor:com.tectonic.ui:hidden statusDescriptors: - displayName: URL description: Route to access the instance deployed @@ -167,7 +209,7 @@ spec: description: Admin user for the instance deployed path: towerAdminUser x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:label + - urn:alm:descriptor:com.tectonic.ui:text - displayName: Admin Password description: Admin password for the instance deployed path: towerAdminPasswordSecret @@ -177,7 +219,12 @@ spec: description: Version of the instance deployed path: towerVersion x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:label + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: Image + description: Image of the instance deployed + path: towerImage + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text description: AWX operator displayName: AWX icon: diff --git a/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml b/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml index 625c06f0..6c79eb96 100644 --- a/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml +++ b/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml @@ -24,6 +24,13 @@ spec: properties: spec: properties: + deployment_type: + description: Name of the deployment type + type: string + tower_admin_user: + description: Username to use for the admin account + type: string + default: admin tower_hostname: description: The hostname of the instance type: string @@ -48,6 +55,12 @@ spec: - ingress - Route - route + tower_ingress_annotations: + description: Annotations to add to the ingress + type: string + tower_ingress_tls_secret: + description: Secret where the ingress TLS secret can be found + type: string tower_route_host: description: The DNS to use to points to the instance type: string @@ -63,6 +76,9 @@ spec: tower_route_tls_secret: description: Secret where the TLS related credentials are stored type: string + tower_image: + description: Registry path to the application container to use + type: string tower_image_pull_policy: description: The image pull policy type: string @@ -131,6 +147,34 @@ spec: description: Whether or not to preload data upon Tower instance creation default: true type: boolean + tower_postgres_resource_requirements: + description: Resource requirements for the PostgreSQL container + properties: + requests: + properties: + cpu: + type: string + memory: + type: string + storage: + type: string + type: object + limits: + properties: + cpu: + type: string + memory: + type: string + storage: + type: string + type: object + type: object + tower_postgres_storage_class: + description: Storage class to use for the PostgreSQL PVC + type: string + ca_trust_bundle: + description: Path where the trusted CA bundle is available + type: string type: object status: properties: @@ -146,6 +190,9 @@ spec: towerVersion: description: Version of the deployed instance type: string + towerImage: + description: URL of the image used for the deployed instance + type: string conditions: description: The resulting conditions when a Service Telemetry is instantiated items: diff --git a/roles/installer/defaults/main.yml b/roles/installer/defaults/main.yml index a5124e65..d5e40abe 100644 --- a/roles/installer/defaults/main.yml +++ b/roles/installer/defaults/main.yml @@ -1,6 +1,5 @@ --- deployment_type: awx -api_version: '{{ deployment_type }}.ansible.com/v1beta1' tower_task_privileged: false tower_ingress_type: none diff --git a/roles/installer/tasks/update_status.yml b/roles/installer/tasks/update_status.yml index 9e5e1daa..f8120fd5 100644 --- a/roles/installer/tasks/update_status.yml +++ b/roles/installer/tasks/update_status.yml @@ -1,8 +1,13 @@ --- +- name: Set apiVersion and kind variables + set_fact: + api_version: '{{ hostvars["localhost"]["inventory_file"].split("/")[4:6] | join("/") }}' + kind: '{{ hostvars["localhost"]["inventory_file"].split("/")[6] }}' + - name: Update admin password status operator_sdk.util.k8s_status: api_version: '{{ api_version }}' - kind: "{{ deployment_type | upper }}" + kind: "{{ kind }}" name: "{{ meta.name }}" namespace: "{{ meta.namespace }}" status: @@ -11,7 +16,7 @@ - name: Update admin user status operator_sdk.util.k8s_status: api_version: '{{ api_version }}' - kind: "{{ deployment_type | upper }}" + kind: "{{ kind }}" name: "{{ meta.name }}" namespace: "{{ meta.namespace }}" status: @@ -30,12 +35,21 @@ - name: Update version status operator_sdk.util.k8s_status: api_version: '{{ api_version }}' - kind: "{{ deployment_type | upper }}" + kind: "{{ kind }}" name: "{{ meta.name }}" namespace: "{{ meta.namespace }}" status: towerVersion: "{{ instance_version.stdout | trim }}" +- name: Update image status + operator_sdk.util.k8s_status: + api_version: '{{ api_version }}' + kind: "{{ kind }}" + name: "{{ meta.name }}" + namespace: "{{ meta.namespace }}" + status: + towerImage: "{{ tower_image }}" + - block: - name: Retrieve route URL community.kubernetes.k8s_info: @@ -47,7 +61,7 @@ - name: Update URL status operator_sdk.util.k8s_status: api_version: '{{ api_version }}' - kind: "{{ deployment_type | upper }}" + kind: "{{ kind }}" name: "{{ meta.name }}" namespace: "{{ meta.namespace }}" status: