RedHatOfficial / ocp4-vsphere-upi-automation

Automates most of the manual steps of deploying OCP4.x cluster on vSphere
MIT License
131 stars 107 forks source link

"govc: please specify a datacenter" #52

Closed VonNao closed 4 years ago

VonNao commented 4 years ago

Hello,

while running the playbook we encounter the following problem during the task "TASK [static_ips : Upload all the custom generated ISOs to the datastore]"

Problem:

/ocp4-vsphere-upi-automation/downloads/ISOs/okdmaster03.iso", "okdmaster03.iso"], "delta": "0:00:00.025456", "end": "2020-09-21 16:31:38.623916", "item": {"ipaddr": "OUR IP", "macaddr": "OUR MAC", "name": "okdmaster03"}, "msg": "non-zero return code", "rc": 1, "start": "2020-09-21 16:31:38.598460", "stderr": "govc: please specify a datacenter", "stderr_lines": ["govc: please specify a datacenter"], "stdout": "", "stdout_lines": []}

We encountered the problem on a centos 7.7 machine aswell as a centos 8.2 machine. Both patched to the latest version of ansible.

We defined the datacenter in the /group_vars/all.yml file. Which doesn't help. The datastore which is also defined in the file works flawlessly.

mallmen commented 4 years ago

Can you share your group_vars/all.yaml?

VonNao commented 4 years ago

Hey mallmen,

sure. I think the vcenter part will be enough?

vcenter: ip: OUR_VCENTER datastore: OUR_DS network: OUR_LAN service_account_username: OUR_USER service_account_password: OUR_PW admin_username: OUR_USER admin_password: OUR_PW datacenter: OUR_DATACENTER folder_absolute_path: vm_power_state: poweredon template_name: rhcos-vmware

I fixed the playbook bei adding the govc_env to the static_ips.yaml and referenced the datacenter var from the all.yaml

environment: PATH: "{{ playbook_dir }}/bin:{{ ansible_env.PATH }}" GOVC_USERNAME: "{{ vcenter.admin_username }}" GOVC_PASSWORD: "{{ vcenter.admin_password }}" GOVC_URL: "https://{{ vcenter.ip }}" GOVC_DATACENTER: "{{ datacenter }}" GOVC_INSECURE: 1

mallmen commented 4 years ago

Added with PR 54