openshift_hosted.yml 1.3 KB

123456789101112131415161718192021222324252627282930
  1. - name: Create persistent volumes and create hosted services
  2. hosts: oo_first_master
  3. vars:
  4. attach_registry_volume: "{{ openshift.hosted.registry.storage.kind != None }}"
  5. deploy_infra: "{{ openshift.master.infra_nodes | default([]) | length > 0 }}"
  6. persistent_volumes: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volumes(groups) }}"
  7. persistent_volume_claims: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volume_claims }}"
  8. roles:
  9. - role: openshift_persistent_volumes
  10. when: persistent_volumes | length > 0 or persistent_volume_claims | length > 0
  11. - role: openshift_serviceaccounts
  12. openshift_serviceaccounts_names:
  13. - router
  14. - registry
  15. openshift_serviceaccounts_namespace: default
  16. openshift_serviceaccounts_sccs:
  17. - privileged
  18. - role: openshift_registry
  19. registry_volume_claim: "{{ openshift.hosted.registry.storage.volume.name }}-claim"
  20. when: deploy_infra | bool and attach_registry_volume | bool
  21. - role: openshift_metrics
  22. when: openshift.hosted.metrics.deploy | bool
  23. - name: Create Hosted Resources
  24. hosts: oo_first_master
  25. pre_tasks:
  26. - set_fact:
  27. openshift_hosted_router_registryurl: "{{ hostvars[groups.oo_first_master.0].openshift.master.registry_url }}"
  28. roles:
  29. - role: openshift_hosted