sassoftware / viya4-deployment

This project contains Ansible code that creates a baseline in an existing Kubernetes environment for use with the SAS Viya Platform, generates the manifest for an order, and then can also deploy that order into the Kubernetes environment specified.
Apache License 2.0
70 stars 64 forks source link

Setting V4_CFG_ELASTICSEARCH_ENABLED to false doesn't work #486

Closed bek-afs closed 9 months ago

bek-afs commented 12 months ago

Viya4 Deployment Version Details

6.8.0

I understand this is not the latest version, but it doesn't seem like anything with ElasticSearch/OpenSearch/OpenDistro was changed since 6.8.0

Ansible Variable File Details

V4_CFG_ELASTICSEARCH_ENABLE: "false"

Steps to Reproduce

docker run --rm --network host --group-add root --user $(id -u):$(id -g) \
--volume $CODEBUILD_SRC_DIR_SAS:/data \
--volume $CODEBUILD_SRC_DIR_SAS/$VIYA4_DEPLOYMENT_VARS:/config/config \
--volume $CODEBUILD_SRC_DIR_SAS/$SITE_DEFAULT:/config/v4_cfg_sitedefault \
--volume ~/.kube/config:/config/kubeconfig \
--volume $CODEBUILD_SRC_DIR_SAS/$SAS_DEPLOYMENT_ASSETS:/config/v4_cfg_deployment_assets \
--volume $CODEBUILD_SRC_DIR_SAS/$SAS_LICENSE:/config/v4_cfg_license \
--volume $CODEBUILD_SRC_DIR_SAS/$SAS_CERTS:/config/v4_cfg_certs \
--volume $CODEBUILD_SRC_DIR_CERTS/$TLS_PUBLIC_CERT:/config/v4_cfg_tls_cert \
--volume $CODEBUILD_SRC_DIR_CERTS/$TLS_PRIVATE_KEY:/config/v4_cfg_tls_key \
--volume $CODEBUILD_SRC_DIR_CERTS/$TLS_CA_CERT:/config/v4_cfg_tls_trusted_ca_certs $NEW_TAG_IMAGE_NAME \
--tags "viya,install"

Expected Behavior

The following lines are NOT in the kustomization.yaml:

resources:

transformers:

The following pods are NOT provisioned: sas-opendistro-default-0
sas-opendistro-exporter
sas-opendistro-operator

Actual Behavior

The following lines are still in the kustomization.yaml:

resources:

transformers:

The following pods are still provisioned: sas-opendistro-default-0
sas-opendistro-exporter
sas-opendistro-operator

Additional Context

No response

References

No response

Code of Conduct

jarpat commented 9 months ago

Hey @bek-afs,

The double quotes around in V4_CFG_ELASTICSEARCH_ENABLE: "false" makes ansible interpret the false value as a string. Strings in general are "truthy" which is why the elasticsearch transformers and resource are being included in the kustomization.yaml. If you remove the double quotes it should work as expected and the elasticsearch items will not be included in your deployment.

Scroll to the bottom for Ansible boolean conversion doc: https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html

bek-afs commented 9 months ago

@jarpat Thanks for the clarification!