registry_auth.yml 968 B

123456789101112131415161718192021222324
  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. - 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 node_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool
  12. register: node_oreg_auth_credentials_create
  13. notify:
  14. - restart node
  15. # Container images may need the registry credentials
  16. - name: Setup ro mount of /root/.docker for containerized hosts
  17. set_fact:
  18. l_bind_docker_reg_auth: True
  19. when:
  20. - openshift.common.is_containerized | bool
  21. - oreg_auth_user is defined
  22. - (node_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace or node_oreg_auth_credentials_create.changed) | bool