noseka1 / openshift-auto-upi

OpenShift Automated User-Provided Infrastructure
Apache License 2.0
99 stars 51 forks source link

Unable to download clients #33

Closed arunabhabanerjee closed 3 years ago

arunabhabanerjee commented 3 years ago

While running clients.yml ansible playbook I facing this issue. Please help.

`TASK [clients : Download openshift-install archive {{ openshift_installer.archive_url }}] **** task path: /root/openshift-auto-upi/roles/clients/tasks/main.yml:8 fatal: [helper]: FAILED! => { "msg": "The task includes an option with an undefined variable. The error was: {u'sha256sum_url': u'{{ openshift_installer_versions[openshift_install_config.distribution][openshift_install_config.version].sha256sum_url }}', u'archive_url': u'{{ openshift_installer_versions[openshift_install_config.distribution][openshift_install_config.version].archive_url }}'}: 'dict object' has no attribute u'4.6.23'\n\nThe error appears to be in '/root/openshift-auto-upi/roles/clients/tasks/main.yml': line 8, 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: Download openshift-install archive {{ openshift_installer.archive_url }}\n ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes. Always quote template expression brackets when they\nstart a value. For instance:\n\n with_items:\n - {{ foo }}\n\nShould be written as:\n\n with_items:\n - \"{{ foo }}\"\n" }

PLAY RECAP *** helper : ok=2 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0`

arunabhabanerjee commented 3 years ago

It works with certain OCP version. I tried with 4.6.21, 4.6.9 and it failed, but when I tried with 4.6.1 it works. Any reason behind this?

noseka1 commented 3 years ago

You will need to add the other (failing) versions to: openshift-auto-upi/inventory/group_vars/all/software/openshift_installer.yml openshift-auto-upi/inventory/group_vars/all/software/openshift_client.yml

Only after you add them to the list, you can use them.

arunabhabanerjee commented 3 years ago

Thank you for your help. This time it works fine. Now I am stuck with this error. Could you please help?

`TASK [openshift_common : Download CoreOS image from https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.6/4.6.8/rhcos-4.6.8-x86_64-openstack.x86_64.qcow2.gz] ***** task path: /root/openshift-auto-upi/roles/openshift_common/tasks/download_coreos.yml:16

ESTABLISH LOCAL CONNECTION FOR USER: root EXEC /bin/sh -c 'echo ~root && sleep 0' EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1623952109.42-14496-137604948720067 `" && echo ansible-tmp-1623952109.42-14496-137604948720067="` echo /root/.ansible/tmp/ansible-tmp-1623952109.42-14496-137604948720067 `" ) && sleep 0' Using module file /usr/lib/python2.7/site-packages/ansible/modules/net_tools/basics/get_url.py PUT /root/.ansible/tmp/ansible-local-139270hJZ3w/tmp5Hbvgh TO /root/.ansible/tmp/ansible-tmp-1623952109.42-14496-137604948720067/AnsiballZ_get_url.py EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1623952109.42-14496-137604948720067/ /root/.ansible/tmp/ansible-tmp-1623952109.42-14496-137604948720067/AnsiballZ_get_url.py && sleep 0' EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1623952109.42-14496-137604948720067/AnsiballZ_get_url.py && sleep 0' EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1623952109.42-14496-137604948720067/ > /dev/null 2>&1 && sleep 0' fatal: [helper]: FAILED! => { "changed": false, "invocation": { "module_args": { "attributes": null, "backup": null, "checksum": "sha256:https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.6/4.6.8/sha256sum.txt", "client_cert": null, "client_key": null, "content": null, "delimiter": null, "dest": "/root/openshift-auto-upi-workspace/rhv-upi/images/rhcos-4.6.8-x86_64-openstack.x86_64.qcow2.gz", "directory_mode": null, "follow": false, "force": false, "force_basic_auth": false, "group": null, "headers": null, "http_agent": "ansible-httpget", "mode": null, "owner": null, "regexp": null, "remote_src": null, "selevel": null, "serole": null, "setype": null, "seuser": null, "sha256sum": "", "src": null, "timeout": 10, "tmp_dest": null, "unsafe_writes": null, "url": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.6/4.6.8/rhcos-4.6.8-x86_64-openstack.x86_64.qcow2.gz", "url_password": null, "url_username": null, "use_proxy": true, "validate_certs": true } }, "msg": "Unable to find a checksum for file 'rhcos-4.6.8-x86_64-openstack.x86_64.qcow2.gz' in 'https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.6/4.6.8/sha256sum.txt'" } PLAY RECAP *********************************************************************************************************************************************************************************************************************************** helper : ok=11 changed=1 unreachable=0 failed=1 skipped=7 rescued=0 ignored=0`
noseka1 commented 3 years ago

That one is probable a bug in Ansible that's been already fixed in the meantime. There are two ways to resolve this.

  1. You can remove the lines like these from the openshft-auto-upi Ansible scripts:
checksum: 'sha256:{{ openshift_installer.sha256sum_url }}'
  1. You can fix your Ansible. Find the get_url.py file in your Ansible installation and overwrite it with the latest version from here: https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/get_url.py
noseka1 commented 3 years ago

I improved the Ansible scripts. Users will be able to specify arbitrary OpenShift version: https://github.com/noseka1/openshift-auto-upi/commit/662bff2f94335eb0286c7d69ea77476033a4acb9

Thanks for reporting this issue!