registry_auth.yml 529 B

123456789101112
  1. ---
  2. - name: Check for credentials file for registry auth
  3. stat:
  4. path: "{{ docker_cli_auth_config_path }}/config.json"
  5. when: oreg_auth_user is defined
  6. register: docker_cli_auth_credentials_stat
  7. - name: Create credentials for docker cli registry auth
  8. command: "docker --config={{ docker_cli_auth_config_path }} login -u {{ oreg_auth_user }} -p {{ oreg_auth_password }} {{ oreg_host }}"
  9. when:
  10. - oreg_auth_user is defined
  11. - (not docker_cli_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool