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
71 stars 64 forks source link

'PROVIDER' is undefined #151

Closed SASDAVIRO closed 3 years ago

SASDAVIRO commented 3 years ago

we are deploying SAS Viya 4, and running the asnible with baseline, we have this error: TASK [baseline : Include cluster-autoscaler] ** task path: /Users/hector.pineda/adl_github/viya/luis_21/devops-anly-viya-aws/environments/dev/templates/viya/viya4-deployment-villas/roles/baseline/tasks/main.yaml:38 fatal: [localhost]: FAILED! => { "msg": "The conditional check 'PROVIDER == \"aws\"' failed. The error was: error while evaluating conditional (PROVIDER == \"aws\"): 'PROVIDER' is undefined\n\nThe error appears to be in '/Users/hector.pineda/adl_github/viya/luis_21/devops-anly-viya-aws/environments/dev/templates/viya/viya4-deployment-villas/roles/baseline/tasks/main.yaml': line 38, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Include cluster-autoscaler\n ^ here\n" }

PLAY RECAP **** localhost : ok=2 changed=0 unreachable=0 failed=1 skipped=4 rescued=0 ignored=0

--

thpang commented 3 years ago

If you're not using this deployment with the viya4-iac- repos you'll need to include that file in your ansible vars file. Here's the doc link : https://github.com/sassoftware/viya4-deployment/blob/main/docs/CONFIG-VARS.md#cloud

SASDAVIRO commented 3 years ago

Yes, we have configured aws on ansible vars file.

thpang commented 3 years ago

So guessing from the last comment you made it past your issue. Closing this one out.

SASDAVIRO commented 3 years ago

No, the file was configured before the deployment, the problem still

thpang commented 3 years ago

OK. So if you can answer these questions:

  1. Did you use the viya4-iac-aws repo to stand up you cluster?
  2. If you did are you using this sample file for the viya4-deployment - https://github.com/sassoftware/viya4-deployment/blob/main/examples/ansible-vars-iac.yaml
  3. If you did not are you using this sample file for the viya4-deployment - https://github.com/sassoftware/viya4-deployment/blob/main/examples/ansible-vars.yaml
  4. If your answer was YES to 2 above the tfstate file will provide the PROVIDER variable and its contents
  5. If your answer was YES to 3 above then you have to provide the PROVIDER variable.

In the future the more information you can provide up-front the more help we can provide.

I am reopening the issue. Please provide answers above.

thpang commented 3 years ago

Also need to know if you're using Docker or Ansible to run the viya4-deployment code base.

SASDAVIRO commented 3 years ago

Did you use the viya4-iac-aws repo to stand up you cluster? Yes If you did are you using this sample file for the viya4-deployment - https://github.com/sassoftware/viya4-deployment/blob/main/examples/ansible-vars-iac.yaml If you did not are you using this sample file for the viya4-deployment - https://github.com/sassoftware/viya4-deployment/blob/main/examples/ansible-vars.yaml If your answer was YES to 2 above the tfstate file will provide the PROVIDER variable and its contents If your answer was YES to 3 above then you have to provide the PROVIDER variable.

This is the configuration on ansible vars:

Cluster

NAMESPACE: xxxx-xxx-xxx PROVIDER: aws CLUSTER_NAME: xxxx-xxx-xxx-eks

thpang commented 3 years ago

If you are using the IAC code base did you use the https://github.com/sassoftware/viya4-deployment/blob/main/examples/ansible-vars-iac.yaml file as your example file?

If you did, there is no reason to set any of the values you're showing.

Also from your viya4-iac-aws location your can type terraform output and you should see the value of provider listed there with a value.

iyepes commented 3 years ago

Yes we used ansible-vars-iac.yaml as example file and: Namespace, provider and cluster_name are defined in it.

Currently we can't get an output from terraform output

provider-no-output

SASDAVIRO commented 3 years ago

please open again

thpang commented 3 years ago

Ok, so where did you run terraform apply or did your use the docker run with a docker image created from the Dockerfile? Looking for the location where you cloned the viya4-iac code base and created your infrastructure.

Also the more information you can provide the better. Right now you're only providing very small chunks and it's hard to answer questions with this little information.

thpang commented 3 years ago

No activity here. Closing.