From 3899365da726f020ca2f5d1281cd15a9155ad2ce Mon Sep 17 00:00:00 2001 From: Yanis Guenane Date: Thu, 17 Jun 2021 10:20:12 +0200 Subject: [PATCH] EE: Allow one to specify extra environment variable --- README.md | 4 ++++ ansible/templates/crd.yml.j2 | 2 ++ deploy/awx-operator.yaml | 2 ++ deploy/crds/awx_v1beta1_crd.yaml | 2 ++ .../manifests/awx-operator.clusterserviceversion.yaml | 6 ++++++ .../awx-operator/manifests/awx.ansible.com_awxs_crd.yaml | 2 ++ roles/installer/defaults/main.yml | 1 + roles/installer/templates/deployment.yaml.j2 | 5 ++++- 8 files changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index db5488e2..e1e1c7cd 100644 --- a/README.md +++ b/README.md @@ -642,6 +642,7 @@ If you need to export custom environment variables to your containers. | ----------------------------- | -------------------------------------------------------- | ------- | | task_extra_env | Environment variables to be added to Task container | '' | | web_extra_env | Environment variables to be added to Web container | '' | +| ee_extra_env | Environment variables to be added to EE container | '' | Example configuration of environment variables @@ -653,6 +654,9 @@ Example configuration of environment variables web_extra_env: | - name: MYCUSTOMVAR value: foo + ee_extra_env: | + - name: MYCUSTOMVAR + value: foo ``` #### Extra Settings diff --git a/ansible/templates/crd.yml.j2 b/ansible/templates/crd.yml.j2 index bd830e10..3ac77c1e 100644 --- a/ansible/templates/crd.yml.j2 +++ b/ansible/templates/crd.yml.j2 @@ -246,6 +246,8 @@ spec: type: string web_extra_env: type: string + ee_extra_env: + type: string ee_extra_volume_mounts: description: Specify volume mounts to be added to Execution container type: string diff --git a/deploy/awx-operator.yaml b/deploy/awx-operator.yaml index 7602f648..93821614 100644 --- a/deploy/awx-operator.yaml +++ b/deploy/awx-operator.yaml @@ -248,6 +248,8 @@ spec: type: string web_extra_env: type: string + ee_extra_env: + type: string ee_extra_volume_mounts: description: Specify volume mounts to be added to Execution container type: string diff --git a/deploy/crds/awx_v1beta1_crd.yaml b/deploy/crds/awx_v1beta1_crd.yaml index bd830e10..3ac77c1e 100644 --- a/deploy/crds/awx_v1beta1_crd.yaml +++ b/deploy/crds/awx_v1beta1_crd.yaml @@ -246,6 +246,8 @@ spec: type: string web_extra_env: type: string + ee_extra_env: + type: string ee_extra_volume_mounts: description: Specify volume mounts to be added to Execution container type: string 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 1913653a..1204c776 100644 --- a/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml +++ b/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml @@ -450,6 +450,12 @@ spec: x-descriptors: - urn:alm:descriptor:com.tectonic.ui:advanced - urn:alm:descriptor:com.tectonic.ui:hidden + - description: Environment variables to be added to EE container + displayName: EE Extra Env + path: ee_extra_env + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:advanced + - urn:alm:descriptor:com.tectonic.ui:hidden - description: Registry path to the Execution Environment container to use on control plane pods displayName: Control Plane EE Image path: control_plane_ee_image 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 99e2b6c4..b97a0469 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 @@ -62,6 +62,8 @@ spec: type: string type: object type: array + ee_extra_env: + type: string ee_pull_credentials_secret: description: Secret where pull credentials for registered ees can be found type: string diff --git a/roles/installer/defaults/main.yml b/roles/installer/defaults/main.yml index d0591849..ffd21427 100644 --- a/roles/installer/defaults/main.yml +++ b/roles/installer/defaults/main.yml @@ -149,6 +149,7 @@ web_resource_requirements: # value: bing task_extra_env: '' web_extra_env: '' +ee_extra_env: '' # Mount extra volumes on the AWX task/web containers. Specify as literal block. # E.g.: diff --git a/roles/installer/templates/deployment.yaml.j2 b/roles/installer/templates/deployment.yaml.j2 index 6f53a2b3..173bfa2e 100644 --- a/roles/installer/templates/deployment.yaml.j2 +++ b/roles/installer/templates/deployment.yaml.j2 @@ -221,13 +221,16 @@ spec: {% if ee_extra_volume_mounts -%} {{ ee_extra_volume_mounts | indent(width=12, indentfirst=True) }} {% endif %} -{% if development_mode | bool %} env: +{% if development_mode | bool %} - name: SDB_NOTIFY_HOST valueFrom: fieldRef: fieldPath: status.podIP {% endif %} +{% if ee_extra_env -%} + {{ ee_extra_env | indent(width=12, indentfirst=True) }} +{% endif %} {% if node_selector %} nodeSelector: {{ node_selector | indent(width=8) }}