diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2017-09-23 14:24:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-23 14:24:37 -0700 |
commit | a4448918cd816cd06f0ae65aea9c912632731d52 (patch) | |
tree | 14bf57d3a1924b1e2858f4bb7ba2237a7e87682d /roles/openshift_node/tasks | |
parent | e0504eec9738b69c4c82b693aa661804a8b20c26 (diff) | |
parent | 3d9af759fe9e69f0b4a83e69e16d7a5bd0d56b6f (diff) | |
download | openshift-a4448918cd816cd06f0ae65aea9c912632731d52.tar.gz openshift-a4448918cd816cd06f0ae65aea9c912632731d52.tar.bz2 openshift-a4448918cd816cd06f0ae65aea9c912632731d52.tar.xz openshift-a4448918cd816cd06f0ae65aea9c912632731d52.zip |
Merge pull request #5502 from mgugino-upstream-stage/fix-undefined-reg-auth
Automatic merge from submit-queue
Fix registry_auth logic for upgrades
Currently, the logic for registry authentication is
not implemented correctly to account for upgrades of
containerized hosts.
Additionally, the logic to account for multiple runs
of openshift-ansible might cause registry authentication
credentials to not be mounted inside of containerized hosts.
This commit adds the necessary logic to ensure containerized
hosts retain registry credentials.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1494470
Diffstat (limited to 'roles/openshift_node/tasks')
-rw-r--r-- | roles/openshift_node/tasks/registry_auth.yml | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/roles/openshift_node/tasks/registry_auth.yml b/roles/openshift_node/tasks/registry_auth.yml index f370bb260..3d2831742 100644 --- a/roles/openshift_node/tasks/registry_auth.yml +++ b/roles/openshift_node/tasks/registry_auth.yml @@ -5,21 +5,20 @@ when: oreg_auth_user is defined register: node_oreg_auth_credentials_stat -# Container images may need the registry credentials -- name: Setup ro mount of /root/.docker for containerized hosts - set_fact: - l_bind_docker_reg_auth: True +- name: Create credentials for registry auth + command: "docker --config={{ oreg_auth_credentials_path }} login -u {{ oreg_auth_user }} -p {{ oreg_auth_password }} {{ oreg_host }}" when: - - openshift.common.is_containerized | bool - oreg_auth_user is defined - (not node_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool + register: node_oreg_auth_credentials_create notify: - restart node -- name: Create credentials for registry auth - command: "docker --config={{ oreg_auth_credentials_path }} login -u {{ oreg_auth_user }} -p {{ oreg_auth_password }} {{ oreg_host }}" +# Container images may need the registry credentials +- name: Setup ro mount of /root/.docker for containerized hosts + set_fact: + l_bind_docker_reg_auth: True when: + - openshift.common.is_containerized | bool - oreg_auth_user is defined - - (not node_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool - notify: - - restart node + - (node_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace or oreg_auth_credentials_replace.changed) | bool |