registry_auth.yml 1003 B

12345678910111213141516171819202122232425
  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. - name: Create credentials for registry auth
  8. command: "docker --config={{ oreg_auth_credentials_path }} login -u {{ oreg_auth_user }} -p {{ oreg_auth_password }} {{ oreg_host }}"
  9. when:
  10. - oreg_auth_user is defined
  11. - (not master_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool
  12. register: master_oreg_auth_credentials_create
  13. notify:
  14. - restart master api
  15. - restart master controllers
  16. # Container images may need the registry credentials
  17. - name: Setup ro mount of /root/.docker for containerized hosts
  18. set_fact:
  19. l_bind_docker_reg_auth: True
  20. when:
  21. - openshift.common.is_containerized | bool
  22. - oreg_auth_user is defined
  23. - (master_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace or master_oreg_auth_credentials_create.changed) | bool