diff options
author | OpenShift Bot <eparis+openshiftbot@redhat.com> | 2017-09-13 17:15:39 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-13 17:15:39 -0400 |
commit | a0086cbeefc583ec624ae7b00548cd6f3cfbfadf (patch) | |
tree | 625571856345872ae16bcf861ac9465e712a2647 /roles/openshift_node/tasks/registry_auth.yml | |
parent | 581d5d2dd18688bcf70722d6126730691cdd82fa (diff) | |
parent | db30a2eb386930e0b20c8106e334d605e2ae770a (diff) | |
download | openshift-a0086cbeefc583ec624ae7b00548cd6f3cfbfadf.tar.gz openshift-a0086cbeefc583ec624ae7b00548cd6f3cfbfadf.tar.bz2 openshift-a0086cbeefc583ec624ae7b00548cd6f3cfbfadf.tar.xz openshift-a0086cbeefc583ec624ae7b00548cd6f3cfbfadf.zip |
Merge pull request #5359 from mgugino-upstream-stage/version-docker-auth-config
Merged by openshift-bot
Diffstat (limited to 'roles/openshift_node/tasks/registry_auth.yml')
-rw-r--r-- | roles/openshift_node/tasks/registry_auth.yml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/roles/openshift_node/tasks/registry_auth.yml b/roles/openshift_node/tasks/registry_auth.yml new file mode 100644 index 000000000..f370bb260 --- /dev/null +++ b/roles/openshift_node/tasks/registry_auth.yml @@ -0,0 +1,25 @@ +--- +- name: Check for credentials file for registry auth + stat: + path: "{{ oreg_auth_credentials_path }}" + 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 + 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 + +- 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: + - oreg_auth_user is defined + - (not node_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool + notify: + - restart node |