summaryrefslogtreecommitdiffstats
path: root/roles/docker/tasks/registry_auth.yml
blob: d05b7f2b84c1604e5de06f016302576ce1078d19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
---
- 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 }}"
  register: openshift_docker_credentials_create_res
  retries: 3
  delay: 5
  until: openshift_docker_credentials_create_res.rc == 0
  when:
  - oreg_auth_user is defined
  - (not docker_cli_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool