Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-11474

When using disconnected registries, the Ansible task fails to write registries.conf

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • rhos-18.0.4
    • None
    • edpm-ansible
    • None
    • 2
    • False
    • Hide

      None

      Show
      None
    • False
    • ?
    • ?
    • ?
    • ?
    • None
    • Important

      Writing the registries.conf file fails in disconnected deployments since the Ansible task is trying to use the `template` module and the raw string input as the `src`. We should be using `ansible.builtin.copy` instead with the `content` parameter in this case.

      The error we see from the `download-cache` job is:

      TASK [osp.edpm.edpm_podman : Write containers registries.conf] *****************
      The full traceback is:
      Traceback (most recent call last):
        File "/usr/local/lib/python3.12/site-packages/ansible/plugins/action/template.py", line 93, in run
          source = self._find_needle('templates', source)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/lib/python3.12/site-packages/ansible/plugins/action/__init__.py", line 1435, in _find_needle
          return self._loader.path_dwim_relative_stack(path_stack, dirname, needle)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/lib/python3.12/site-packages/ansible/parsing/dataloader.py", line 351, in path_dwim_relative_stack
          raise AnsibleFileNotFound(file_name=source, paths=[to_native(p) for p in search])
      ansible.errors.AnsibleFileNotFound: Could not find or access 'unqualified-search-registries = ["registry.access.redhat.com", "docker.io"]
      [...] 

      This is because we're passing raw string content of the file to the `src` input which should be a `path` instead.

              rhn-support-bshephar Brendan Shephard
              rhn-support-bshephar Brendan Shephard
              rhos-dfg-df
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: