main.yml 1.0 KB

123456789101112131415161718192021222324
  1. ---
  2. - name: Deploy OpenShift Registry
  3. command: >
  4. {{ openshift.common.admin_binary }} registry
  5. --create --replicas={{ openshift.master.infra_nodes | length }}
  6. --service-account=registry {{ oreg_selector }}
  7. --credentials={{ openshift_master_config_dir }}/openshift-registry.kubeconfig {{ oreg_images }}
  8. register: oreg_results
  9. changed_when: "'service exists' not in oreg_results.stdout"
  10. - name: Determine if volume is already attached to dc/docker-registry
  11. command: "{{ openshift.common.client_binary }} get -o template dc/docker-registry --template=\\{\\{.spec.template.spec.volumes\\}\\}"
  12. changed_when: false
  13. register: registry_volumes_output
  14. - set_fact:
  15. volume_attached: "{{ registry_volume_claim in registry_volumes_output.stdout }}"
  16. - name: Add volume to dc/docker-registry
  17. command: >
  18. {{ openshift.common.client_binary }} volume dc/docker-registry
  19. --add --overwrite -t persistentVolumeClaim --claim-name={{ registry_volume_claim }}
  20. --name=registry-storage
  21. when: not volume_attached | bool