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

postgres.yaml error in viya install #441

Closed hannamurphy closed 1 year ago

hannamurphy commented 1 year ago

Running the following code:

docker run --rm \
  --group-add root \
  --user $(id -u):$(id -g) \
  --volume $HOME/scep2023-deployment:/data \
  --volume $HOME/scep2023-deployment/ansible-vars.yaml:/config/config \
  --volume $HOME/scep2023-deployment/terraform.tfstate:/config/tfstate \
  --volume $HOME/.ssh/id_rsa:/config/jump_svr_private_key \
  viya4-deployment --tags "viya,install" 

& receiving the following error:

TASK [vdm : set_fact] **********************************************************
fatal: [localhost]: FAILED! => 
  msg: |-
    The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'internal'

    The error appears to be in '/viya4-deployment/roles/vdm/tasks/postgres/postgres.yaml': line 1, column 3, but may
    be elsewhere in the file depending on the exact syntax problem.

    The offending line appears to be:

    - set_fact:
      ^ here

PLAY RECAP *********************************************************************
localhost                  : ok=60   changed=9    unreachable=0    failed=1    skipped=61   rescued=0    ignored=0

All code is pulled from the most recent versions of viya4-deployment and viya4-iac-aws.

dhoucgitter commented 1 year ago

Hi @hannamurphy, if you did not specify configuration in the terraform-input.tfvars file that you provided as input to viya4-iac-aws to install a cloud based instance of Postgres (aka external instance), you would typically allow viya4-deployment to create an internal Postgres instance within the namespace of the cluster you are deploying Viya to. In other words, for your Viya deployment to be successful, you will need either an external, cloud based Postgres instance or an internal Postgres instance deployed alongside Viya.

To get the internal Postgres instance deployed, at a minimum, your ansible-vars.yaml file will need to contain a block like this:

## Postgres
V4_CFG_POSTGRES_SERVERS:
  default:
    internal: true

Also, you need to preserve the indentation indicated above as you are defining the map structure documented here: https://github.com/sassoftware/viya4-deployment/blob/main/docs/CONFIG-VARS.md#postgresql I'm anticipating that you only need the single "default" postgres server instance unless the set of Viya products you are installing specifically require a second postgres instance.

hannamurphy commented 1 year ago

Thanks I will add that & rerun. I used the IAC for AWS & didn't realize I needed to add anything more to the ansible-vars-iac.yaml file (there's nothing under the Postgres section).

dhoucgitter commented 1 year ago

Hi @hannamurphy, would like to close out this issue as resolved, could you confirm?

hannamurphy commented 1 year ago

That’s fine