registry_auth.yml 910 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: node_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 node_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool
  15. notify:
  16. - restart node
  17. - name: Create credentials for registry auth
  18. command: "docker --config={{ oreg_auth_credentials_path }} login -u {{ oreg_auth_user }} -p {{ oreg_auth_password }} {{ oreg_host }}"
  19. when:
  20. - oreg_auth_user is defined
  21. - (not node_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool
  22. notify:
  23. - restart node