openshift_hosted.yml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ---
  2. - name: Create persistent volumes
  3. hosts: oo_first_master
  4. tags:
  5. - hosted
  6. vars:
  7. persistent_volumes: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volumes(groups) }}"
  8. persistent_volume_claims: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volume_claims }}"
  9. roles:
  10. - role: openshift_persistent_volumes
  11. when: persistent_volumes | length > 0 or persistent_volume_claims | length > 0
  12. - name: Create Hosted Resources
  13. hosts: oo_first_master
  14. tags:
  15. - hosted
  16. pre_tasks:
  17. - set_fact:
  18. openshift_hosted_router_registryurl: "{{ hostvars[groups.oo_first_master.0].openshift.master.registry_url }}"
  19. openshift_hosted_registry_registryurl: "{{ hostvars[groups.oo_first_master.0].openshift.master.registry_url }}"
  20. when: "'master' in hostvars[groups.oo_first_master.0].openshift and 'registry_url' in hostvars[groups.oo_first_master.0].openshift.master"
  21. - set_fact:
  22. logging_hostname: "{{ openshift_hosted_logging_hostname | default('kibana.' ~ (openshift_master_default_subdomain | default('router.default.svc.cluster.local', true))) }}"
  23. logging_ops_hostname: "{{ openshift_hosted_logging_ops_hostname | default('kibana-ops.' ~ (openshift_master_default_subdomain | default('router.default.svc.cluster.local', true))) }}"
  24. logging_master_public_url: "{{ openshift_hosted_logging_master_public_url | default(openshift.master.public_api_url) }}"
  25. logging_elasticsearch_cluster_size: "{{ openshift_hosted_logging_elasticsearch_cluster_size | default(1) }}"
  26. logging_elasticsearch_ops_cluster_size: "{{ openshift_hosted_logging_elasticsearch_ops_cluster_size | default(1) }}"
  27. roles:
  28. - role: openshift_default_storage_class
  29. when: openshift_cloudprovider_kind is defined and (openshift_cloudprovider_kind == 'aws' or openshift_cloudprovider_kind == 'gce')
  30. - role: openshift_hosted
  31. - role: openshift_metrics
  32. when: openshift_hosted_metrics_deploy | default(false) | bool
  33. - role: openshift_logging
  34. when: openshift_hosted_logging_deploy | default(false) | bool
  35. openshift_hosted_logging_hostname: "{{ logging_hostname }}"
  36. openshift_hosted_logging_ops_hostname: "{{ logging_ops_hostname }}"
  37. openshift_hosted_logging_master_public_url: "{{ logging_master_public_url }}"
  38. openshift_hosted_logging_elasticsearch_cluster_size: "{{ logging_elasticsearch_cluster_size }}"
  39. openshift_hosted_logging_elasticsearch_pvc_dynamic: "{{ 'true' if openshift_hosted_logging_storage_kind | default(none) == 'dynamic' else '' }}"
  40. openshift_hosted_logging_elasticsearch_pvc_size: "{{ openshift.hosted.logging.storage.volume.size if openshift_hosted_logging_storage_kind | default(none) in ['dynamic','nfs'] else '' }}"
  41. openshift_hosted_logging_elasticsearch_pvc_prefix: "{{ 'logging-es' if openshift_hosted_logging_storage_kind | default(none) == 'dynamic' else '' }}"
  42. openshift_hosted_logging_elasticsearch_ops_cluster_size: "{{ logging_elasticsearch_ops_cluster_size }}"
  43. openshift_hosted_logging_elasticsearch_ops_pvc_dynamic: "{{ 'true' if openshift_hosted_loggingops_storage_kind | default(none) == 'dynamic' else '' }}"
  44. openshift_hosted_logging_elasticsearch_ops_pvc_size: "{{ openshift.hosted.logging.storage.volume.size if openshift_hosted_logging_storage_kind | default(none) in ['dynamic','nfs' ] else '' }}"
  45. openshift_hosted_logging_elasticsearch_ops_pvc_prefix: "{{ 'logging-es-ops' if openshift_hosted_loggingops_storage_kind | default(none) =='dynamic' else '' }}"
  46. - role: cockpit-ui
  47. when: ( openshift.common.version_gte_3_3_or_1_3 | bool ) and ( openshift_hosted_manage_registry | default(true) | bool ) and not (openshift.docker.hosted_registry_insecure | default(false) | bool)
  48. - name: Update master-config for publicLoggingURL
  49. hosts: oo_masters_to_config:!oo_first_master
  50. tags:
  51. - hosted
  52. pre_tasks:
  53. - set_fact:
  54. openshift_logging_kibana_hostname: "{{ openshift_hosted_logging_hostname | default('kibana.' ~ (openshift_master_default_subdomain | default('router.default.svc.cluster.local', true))) }}"
  55. - set_fact:
  56. openshift_metrics_hawkular_hostname: "{{ g_metrics_hostname | default('hawkular-metrics.' ~ (openshift_master_default_subdomain | default('router.default.svc.cluster.local', true))) }}"
  57. tasks:
  58. - block:
  59. - include_role:
  60. name: openshift_logging
  61. tasks_from: update_master_config
  62. when: openshift_hosted_logging_deploy | default(false) | bool
  63. - block:
  64. - include_role:
  65. name: openshift_metrics
  66. tasks_from: update_master_config
  67. when: openshift_hosted_metrics_deploy | default(false) | bool