Comment 2 for bug 1886555

Revision history for this message
wes hayutin (weshayutin) wrote :

OK.. I think I see what's going on..

https://review.rdoproject.org/r/#/c/28391/1/playbooks/tripleo-rdo-base/container-login.yaml

        - name: Perform container registry login(s) buildah with sudo
          shell: |-
            sudo buildah login --username=$REGISTRY_USERNAME \
                               --password=$REGISTRY_PASSWORD \
                               --tls-verify={{ tripleo_podman_tls_verify }} \
                               $REGISTRY
          environment:
            REGISTRY_USERNAME: "{{ lookup('dict', item.value).key }}"
            REGISTRY_PASSWORD: "{{ lookup('dict', item.value).value }}"
            REGISTRY: "{{ item.key }}"
          loop: "{{ query('dict', tripleo_container_registry_logins) }}"
          register: registry_login_podman
          when:
            - (ansible_distribution == "CentOS" and ansible_distribution_major_version|int >= 8)
               or (ansible_distribution == "RedHat" and ansible_lsb.major_release|int >= 8)
            - use_kolla is defined and not use_kolla|bool

This code snip is reusing the variable "registry_login_podman" this seems logical, but this is using buildah. Podman login is called from

https://opendev.org/openstack/tripleo-ansible/src/branch/master/tripleo_ansible/roles/tripleo_podman/tasks/main.yml#L50

- name: Podman install
  import_tasks: tripleo_podman_login.yml
  when:
    - tripleo_container_registry_login | bool
    - tripleo_container_registry_logins

The podman login has a "when" to run clause... tripleo_container_registry_login(s) which the buildah task does not.

I suggest working w/ Kevin and or Emilien to move the buildah login along side the podman login for two reasons...

1. to ensure a buildah login is really required
2. to ensure the buildah and podman tasks have the same conditionals.