registry_auth.yml 976 B

123456789101112131415161718192021222324252627
  1. ---
  2. - name: Check for credentials file for registry auth
  3. stat:
  4. path: "{{ oreg_auth_credentials_path }}"
  5. when: oreg_auth_user is defined
  6. register: master_oreg_auth_credentials_stat
  7. # Container images may need the registry credentials
  8. - name: Setup ro mount of /root/.docker for containerized hosts
  9. set_fact:
  10. l_bind_docker_reg_auth: True
  11. when:
  12. - openshift.common.is_containerized | bool
  13. - oreg_auth_user is defined
  14. - (not master_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool
  15. notify:
  16. - restart master api
  17. - restart master controllers
  18. - name: Create credentials for registry auth
  19. command: "docker --config={{ oreg_auth_credentials_path }} login -u {{ oreg_auth_user }} -p {{ oreg_auth_password }} {{ oreg_host }}"
  20. when:
  21. - oreg_auth_user is defined
  22. - (not master_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool
  23. notify:
  24. - restart master api
  25. - restart master controllers