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/docker | |
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/docker')
-rw-r--r-- | roles/docker/defaults/main.yml | 5 | ||||
-rw-r--r-- | roles/docker/tasks/package_docker.yml | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/roles/docker/defaults/main.yml b/roles/docker/defaults/main.yml index ed97d539c..7e206ded1 100644 --- a/roles/docker/defaults/main.yml +++ b/roles/docker/defaults/main.yml @@ -1 +1,6 @@ --- +docker_cli_auth_config_path: '/root/.docker' + +oreg_url: '' +oreg_host: "{{ oreg_url.split('/')[0] if '.' in oreg_url.split('/')[0] else '' }}" +oreg_auth_credentials_replace: False diff --git a/roles/docker/tasks/package_docker.yml b/roles/docker/tasks/package_docker.yml index bc52ab60c..145b552a6 100644 --- a/roles/docker/tasks/package_docker.yml +++ b/roles/docker/tasks/package_docker.yml @@ -117,6 +117,18 @@ notify: - restart docker +- name: Check for credentials file for registry auth + stat: + path: "{{ docker_cli_auth_config_path }}/config.json" + when: oreg_auth_user is defined + register: docker_cli_auth_credentials_stat + +- name: Create credentials for docker cli registry auth + command: "docker --config={{ docker_cli_auth_config_path }} login -u {{ oreg_auth_user }} -p {{ oreg_auth_password }} {{ oreg_host }}" + when: + - oreg_auth_user is defined + - (not docker_cli_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool + - name: Start the Docker service systemd: name: docker |