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_master/tasks | |
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_master/tasks')
-rw-r--r-- | roles/openshift_master/tasks/main.yml | 16 | ||||
-rw-r--r-- | roles/openshift_master/tasks/registry_auth.yml | 27 |
2 files changed, 28 insertions, 15 deletions
diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml index 121261e94..894fe8e2b 100644 --- a/roles/openshift_master/tasks/main.yml +++ b/roles/openshift_master/tasks/main.yml @@ -229,21 +229,7 @@ - restart master controllers when: openshift_master_bootstrap_enabled | default(False) -- name: Check for credentials file for registry auth - stat: - path: "{{oreg_auth_credentials_path }}" - when: - - oreg_auth_user is defined - register: master_oreg_auth_credentials_stat - -- 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 master_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool - notify: - - restart master api - - restart master controllers +- include: registry_auth.yml - include: set_loopback_context.yml when: diff --git a/roles/openshift_master/tasks/registry_auth.yml b/roles/openshift_master/tasks/registry_auth.yml new file mode 100644 index 000000000..96b6c614e --- /dev/null +++ b/roles/openshift_master/tasks/registry_auth.yml @@ -0,0 +1,27 @@ +--- +- name: Check for credentials file for registry auth + stat: + path: "{{ oreg_auth_credentials_path }}" + when: oreg_auth_user is defined + register: master_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 master_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool + notify: + - restart master api + - restart master controllers + +- 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 master_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool + notify: + - restart master api + - restart master controllers |