Closed techietav closed 11 months ago
Hi @techietav , the vault secret holding the registry credentials must have the format of registry_user:registry_password
The error is probably caused by the credentials not including both user and password.
I will make a change to ensure the credentials are validated and a meaningful error is thrown.
Confirmed that I required the user:password in the secret.
Describe the bug Install fails when it tries to connect to a private registry.
TASK [connect-private-image-registry : Try to login to the specified registry at quay.apps.cluster1.hursley.ibm.com] * Sunday 22 October 2023 07:46:42 +0000 (0:00:00.249) 0:01:32.383 ** fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: list object has no element 1\n\nThe error appears to be in '/cloud-pak-deployer/automation-roles/50-install-cloud-pak/connect-private-image-registry/tasks/main.yml': line 46, 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: Try to login to the specified registry at {{ private_registry_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"}
Looking in the file it could be missing quotes at the skopeo login line.
set_fact: private_registry_auth: "{{ secret_value }}" private_registry_url: "{{ lookup('template','get_private_registry.j2') }}" private_registry_url_namespace: "{{ lookup('template','get_private_registry_with_namespace.j2') }}"
name: Try to login to the specified registry at {{ private_registry_url }} shell: | skopeo login {{ private_registry_url }} \ --username "{{ private_registry_auth.split(':')[0] }}" \ --password "{{ private_registry_auth.split(':')[1] }}" \ --tls-verify=false
To Reproduce Run the deployer after specifying a private registry and validating that I can login on the cmdline. registry is defined in the cp4d-473.yaml
global_config: environment_name: fusion env_id: dsic-cluster1 confirm_destroy: False image_registry: