install_logging.yaml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. ---
  2. - name: Gather OpenShift Logging Facts
  3. openshift_logging_facts:
  4. oc_bin: "{{openshift.common.client_binary}}"
  5. openshift_logging_namespace: "{{openshift_logging_namespace}}"
  6. - name: Set logging project
  7. oc_project:
  8. state: present
  9. name: "{{ openshift_logging_namespace }}"
  10. - name: Install logging mux
  11. include: "{{ role_path }}/tasks/install_mux.yaml"
  12. when: openshift_logging_use_mux
  13. - find: paths={{ mktemp.stdout }}/templates patterns=*.yaml
  14. register: object_def_files
  15. changed_when: no
  16. - name: Create logging cert directory
  17. file:
  18. path: "{{ openshift.common.config_base }}/logging"
  19. state: directory
  20. mode: 0755
  21. changed_when: False
  22. check_mode: no
  23. - include: generate_certs.yaml
  24. vars:
  25. generated_certs_dir: "{{openshift.common.config_base}}/logging"
  26. ## Elasticsearch
  27. # TODO: add more vars
  28. # We don't allow scaling down of ES nodes currently
  29. - include_role:
  30. name: openshift_logging_elasticsearch
  31. vars:
  32. generated_certs_dir: "{{openshift.common.config_base}}/logging"
  33. openshift_logging_elasticsearch_deployment_name: "{{ item.0 }}"
  34. openshift_logging_elasticsearch_pvc_name: "{{ item.1 }}"
  35. openshift_logging_elasticsearch_replica_count: "{{ openshift_logging_es_cluster_size | int }}"
  36. #openshift_logging_elasticsearch_storage_type: "{{ }}"
  37. openshift_logging_elasticsearch_pvc_size: "{{ openshift_logging_es_pvc_size }}"
  38. openshift_logging_elasticsearch_pvc_dynamic: "{{ openshift_logging_es_pvc_dynamic }}"
  39. openshift_logging_elasticsearch_pvc_pv_selector: "{{ openshift_logging_es_pv_selector }}"
  40. with_together:
  41. - "{{ openshift_logging_facts.elasticsearch.deploymentconfigs }}"
  42. - "{{ openshift_logging_facts.elasticsearch.pvcs }}"
  43. # Create any new DC that may be required
  44. - include_role:
  45. name: openshift_logging_elasticsearch
  46. vars:
  47. generated_certs_dir: "{{openshift.common.config_base}}/logging"
  48. openshift_logging_elasticsearch_pvc_name: "{{ openshift_logging_es_pvc_prefix }}-{{ item | int + openshift_logging_facts.elasticsearch.deploymentconfigs | count }}"
  49. openshift_logging_elasticsearch_replica_count: "{{ openshift_logging_es_cluster_size | int }}"
  50. with_sequence: count={{ openshift_logging_es_cluster_size | int - openshift_logging_facts.elasticsearch.deploymentconfigs.keys() | count }}
  51. # TODO: add more vars
  52. - include_role:
  53. name: openshift_logging_elasticsearch
  54. vars:
  55. generated_certs_dir: "{{openshift.common.config_base}}/logging"
  56. openshift_logging_elasticsearch_deployment_name: "{{ item.0 }}"
  57. openshift_logging_elasticsearch_pvc_name: "{{ item.1 }}"
  58. openshift_logging_elasticsearch_ops_deployment: true
  59. openshift_logging_elasticsearch_replica_count: "{{ openshift_logging_es_ops_cluster_size | int }}"
  60. #openshift_logging_elasticsearch_storage_type: "{{ }}"
  61. openshift_logging_elasticsearch_pvc_size: "{{ openshift_logging_es_pvc_size }}"
  62. openshift_logging_elasticsearch_pvc_dynamic: "{{ openshift_logging_es_pvc_dynamic }}"
  63. openshift_logging_elasticsearch_pvc_pv_selector: "{{ openshift_logging_es_pv_selector }}"
  64. with_together:
  65. - "{{ openshift_logging_facts.elasticsearch_ops.deploymentconfigs }}"
  66. - "{{ openshift_logging_facts.elasticsearch_ops.pvcs }}"
  67. when:
  68. - openshift_logging_use_ops | bool
  69. # Create any new DC that may be required
  70. - include_role:
  71. name: openshift_logging_elasticsearch
  72. vars:
  73. generated_certs_dir: "{{openshift.common.config_base}}/logging"
  74. openshift_logging_elasticsearch_pvc_name: "{{ openshift_logging_es_pvc_prefix }}-{{ item | int + openshift_logging_facts.elasticsearch_ops.deploymentconfigs | count }}"
  75. openshift_logging_elasticsearch_ops_deployment: true
  76. openshift_logging_elasticsearch_replica_count: "{{ openshift_logging_es_ops_cluster_size | int }}"
  77. with_sequence: count={{ ( ( openshift_logging_es_ops_cluster_size | int ) - ( openshift_logging_facts.elasticsearch_ops.deploymentconfigs.keys() | count ) ) }}
  78. when:
  79. - openshift_logging_use_ops | bool
  80. ## Kibana
  81. - include_role:
  82. name: openshift_logging_kibana
  83. vars:
  84. generated_certs_dir: "{{openshift.common.config_base}}/logging"
  85. openshift_logging_kibana_namespace: "{{ openshift_logging_namespace }}"
  86. openshift_logging_kibana_master_url: "{{ openshift_logging_master_url }}"
  87. openshift_logging_kibana_master_public_url: "{{ openshift_logging_master_public_url }}"
  88. openshift_logging_kibana_image_prefix: "{{ openshift_logging_image_prefix }}"
  89. openshift_logging_kibana_image_version: "{{ openshift_logging_image_version }}"
  90. openshift_logging_kibana_replicas: "{{ openshift_logging_kibana_replica_count }}"
  91. openshift_logging_kibana_es_host: "{{ openshift_logging_es_host }}"
  92. openshift_logging_kibana_es_port: "{{ openshift_logging_es_port }}"
  93. openshift_logging_kibana_image_pull_secret: "{{ openshift_logging_image_pull_secret }}"
  94. - include_role:
  95. name: openshift_logging_kibana
  96. vars:
  97. generated_certs_dir: "{{openshift.common.config_base}}/logging"
  98. openshift_logging_kibana_ops_deployment: true
  99. openshift_logging_kibana_namespace: "{{ openshift_logging_namespace }}"
  100. openshift_logging_kibana_master_url: "{{ openshift_logging_master_url }}"
  101. openshift_logging_kibana_master_public_url: "{{ openshift_logging_master_public_url }}"
  102. openshift_logging_kibana_image_prefix: "{{ openshift_logging_image_prefix }}"
  103. openshift_logging_kibana_image_version: "{{ openshift_logging_image_version }}"
  104. openshift_logging_kibana_image_pull_secret: "{{ openshift_logging_image_pull_secret }}"
  105. openshift_logging_kibana_es_host: "{{ openshift_logging_es_ops_host }}"
  106. openshift_logging_kibana_es_port: "{{ openshift_logging_es_ops_port }}"
  107. openshift_logging_kibana_nodeselector: "{{ openshift_logging_kibana_ops_nodeselector }}"
  108. openshift_logging_kibana_cpu_limit: "{{ openshift_logging_kibana_ops_cpu_limit }}"
  109. openshift_logging_kibana_memory_limit: "{{ openshift_logging_kibana_ops_memory_limit }}"
  110. openshift_logging_kibana_hostname: "{{ openshift_logging_kibana_ops_hostname }}"
  111. openshift_logging_kibana_replicas: "{{ openshift_logging_kibana_ops_replica_count }}"
  112. openshift_logging_kibana_proxy_debug: "{{ openshift_logging_kibana_ops_proxy_debug }}"
  113. openshift_logging_kibana_proxy_cpu_limit: "{{ openshift_logging_kibana_ops_proxy_cpu_limit }}"
  114. openshift_logging_kibana_proxy_memory_limit: "{{ openshift_logging_kibana_ops_proxy_memory_limit }}"
  115. openshift_logging_kibana_cert: "{{ openshift_logging_kibana_ops_cert }}"
  116. openshift_logging_kibana_key: "{{ openshift_logging_kibana_ops_key }}"
  117. openshift_logging_kibana_ca: "{{ openshift_logging_kibana_ops_ca}}"
  118. when:
  119. - openshift_logging_use_ops | bool
  120. ## Curator
  121. - include_role:
  122. name: openshift_logging_curator
  123. vars:
  124. generated_certs_dir: "{{openshift.common.config_base}}/logging"
  125. openshift_logging_curator_namespace: "{{ openshift_logging_namespace }}"
  126. openshift_logging_curator_master_url: "{{ openshift_logging_master_url }}"
  127. openshift_logging_curator_image_prefix: "{{ openshift_logging_image_prefix }}"
  128. openshift_logging_curator_image_version: "{{ openshift_logging_image_version }}"
  129. openshift_logging_curator_image_pull_secret: "{{ openshift_logging_image_pull_secret }}"
  130. - include_role:
  131. name: openshift_logging_curator
  132. vars:
  133. generated_certs_dir: "{{openshift.common.config_base}}/logging"
  134. openshift_logging_curator_ops_deployment: true
  135. openshift_logging_curator_namespace: "{{ openshift_logging_namespace }}"
  136. openshift_logging_curator_master_url: "{{ openshift_logging_master_url }}"
  137. openshift_logging_curator_image_prefix: "{{ openshift_logging_image_prefix }}"
  138. openshift_logging_curator_image_version: "{{ openshift_logging_image_version }}"
  139. openshift_logging_curator_image_pull_secret: "{{ openshift_logging_image_pull_secret }}"
  140. openshift_logging_curator_cpu_limit: "{{ openshift_logging_curator_ops_cpu_limit }}"
  141. openshift_logging_curator_memory_limit: "{{ openshift_logging_curator_ops_memory_limit }}"
  142. openshift_logging_curator_nodeselector: "{{ openshift_logging_curator_ops_nodeselector }}"
  143. when:
  144. - openshift_logging_use_ops | bool
  145. ## Fluentd
  146. - include_role:
  147. name: openshift_logging_fluentd
  148. vars:
  149. generated_certs_dir: "{{openshift.common.config_base}}/logging"
  150. openshift_logging_fluentd_ops_host: "{{ ( openshift_logging_use_ops | bool ) | ternary('logging-es-ops', 'logging-es') }}"
  151. openshift_logging_fluentd_use_journal: "{{ openshift.docker.options | search('journald') }}"
  152. - include: update_master_config.yaml