openshift_hosted.yml 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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_cli
  29. - role: openshift_hosted_facts
  30. - role: openshift_projects
  31. # TODO: Move standard project definitions to openshift_hosted/vars/main.yml
  32. # Vars are not accessible in meta/main.yml in ansible-1.9.x
  33. openshift_projects: "{{ openshift_additional_projects | default({}) | oo_merge_dicts({'default':{'default_node_selector':''},'openshift-infra':{'default_node_selector':''},'logging':{'default_node_selector':''}}) }}"
  34. - role: openshift_serviceaccounts
  35. openshift_serviceaccounts_names:
  36. - router
  37. openshift_serviceaccounts_namespace: default
  38. openshift_serviceaccounts_sccs:
  39. - hostnetwork
  40. when: openshift.common.version_gte_3_2_or_1_2
  41. - role: openshift_serviceaccounts
  42. openshift_serviceaccounts_names:
  43. - router
  44. - registry
  45. openshift_serviceaccounts_namespace: default
  46. openshift_serviceaccounts_sccs:
  47. - privileged
  48. when: not openshift.common.version_gte_3_2_or_1_2
  49. - role: openshift_hosted
  50. - role: openshift_metrics
  51. when: openshift_hosted_metrics_deploy | default(false) | bool
  52. - role: openshift_hosted_logging
  53. when: openshift_hosted_logging_deploy | default(false) | bool
  54. openshift_hosted_logging_hostname: "{{ logging_hostname }}"
  55. openshift_hosted_logging_ops_hostname: "{{ logging_ops_hostname }}"
  56. openshift_hosted_logging_master_public_url: "{{ logging_master_public_url }}"
  57. openshift_hosted_logging_elasticsearch_cluster_size: "{{ logging_elasticsearch_cluster_size }}"
  58. openshift_hosted_logging_elasticsearch_pvc_dynamic: "{{ 'true' if openshift_hosted_logging_storage_kind | default(none) == 'dynamic' else '' }}"
  59. openshift_hosted_logging_elasticsearch_pvc_size: "{{ openshift.hosted.logging.storage.volume.size if openshift_hosted_logging_storage_kind | default(none) in ['dynamic','nfs'] else '' }}"
  60. openshift_hosted_logging_elasticsearch_pvc_prefix: "{{ 'logging-es' if openshift_hosted_logging_storage_kind | default(none) == 'dynamic' else '' }}"
  61. openshift_hosted_logging_elasticsearch_ops_cluster_size: "{{ logging_elasticsearch_ops_cluster_size }}"
  62. openshift_hosted_logging_elasticsearch_ops_pvc_dynamic: "{{ 'true' if openshift_hosted_logging_storage_kind | default(none) == 'dynamic' else '' }}"
  63. 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 '' }}"
  64. openshift_hosted_logging_elasticsearch_ops_pvc_prefix: "{{ 'logging-es' if openshift_hosted_logging_storage_kind | default(none) =='dynamic' else '' }}"
  65. - role: cockpit-ui
  66. when: ( openshift.common.version_gte_3_3_or_1_3 | bool ) and ( openshift_hosted_manage_registry | default(true) | bool )