generate_routes.yaml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. ---
  2. - set_fact: kibana_key={{ lookup('file', openshift_logging_kibana_key) | b64encode }}
  3. when: openshift_logging_kibana_key | trim | length > 0
  4. changed_when: false
  5. - set_fact: kibana_cert={{ lookup('file', openshift_logging_kibana_cert)| b64encode }}
  6. when: openshift_logging_kibana_cert | trim | length > 0
  7. changed_when: false
  8. - set_fact: kibana_ca={{ lookup('file', openshift_logging_kibana_ca)| b64encode }}
  9. when: openshift_logging_kibana_ca | trim | length > 0
  10. changed_when: false
  11. - set_fact: kibana_ca={{key_pairs | entry_from_named_pair('ca_file') }}
  12. when: kibana_ca is not defined
  13. changed_when: false
  14. - name: Generating logging routes
  15. template: src=route_reencrypt.j2 dest={{mktemp.stdout}}/templates/logging-logging-kibana-route.yaml
  16. tags: routes
  17. vars:
  18. obj_name: "logging-kibana"
  19. route_host: "{{openshift_logging_kibana_hostname}}"
  20. service_name: "logging-kibana"
  21. tls_key: "{{kibana_key | default('') | b64decode}}"
  22. tls_cert: "{{kibana_cert | default('') | b64decode}}"
  23. tls_ca_cert: "{{kibana_ca | b64decode}}"
  24. tls_dest_ca_cert: "{{key_pairs | entry_from_named_pair('ca_file')| b64decode }}"
  25. edge_term_policy: "{{openshift_logging_kibana_edge_term_policy | default('') }}"
  26. labels:
  27. component: support
  28. logging-infra: support
  29. provider: openshift
  30. changed_when: no
  31. - set_fact: kibana_ops_key={{ lookup('file', openshift_logging_kibana_ops_key) | b64encode }}
  32. when:
  33. - openshift_logging_use_ops | bool
  34. - "{{ openshift_logging_kibana_ops_key | trim | length > 0 }}"
  35. changed_when: false
  36. - set_fact: kibana_ops_cert={{ lookup('file', openshift_logging_kibana_ops_cert)| b64encode }}
  37. when:
  38. - openshift_logging_use_ops | bool
  39. - "{{openshift_logging_kibana_ops_cert | trim | length > 0}}"
  40. changed_when: false
  41. - set_fact: kibana_ops_ca={{ lookup('file', openshift_logging_kibana_ops_ca)| b64encode }}
  42. when:
  43. - openshift_logging_use_ops | bool
  44. - "{{openshift_logging_kibana_ops_ca | trim | length > 0}}"
  45. changed_when: false
  46. - set_fact: kibana_ops_ca={{key_pairs | entry_from_named_pair('ca_file') }}
  47. when:
  48. - openshift_logging_use_ops | bool
  49. - kibana_ops_ca is not defined
  50. changed_when: false
  51. - name: Generating logging ops routes
  52. template: src=route_reencrypt.j2 dest={{mktemp.stdout}}/templates/logging-logging-kibana-ops-route.yaml
  53. tags: routes
  54. vars:
  55. obj_name: "logging-kibana-ops"
  56. route_host: "{{openshift_logging_kibana_ops_hostname}}"
  57. service_name: "logging-kibana-ops"
  58. tls_key: "{{kibana_ops_key | default('') | b64decode}}"
  59. tls_cert: "{{kibana_ops_cert | default('') | b64decode}}"
  60. tls_ca_cert: "{{kibana_ops_ca | b64decode}}"
  61. tls_dest_ca_cert: "{{key_pairs | entry_from_named_pair('ca_file')| b64decode }}"
  62. edge_term_policy: "{{openshift_logging_kibana_edge_term_policy | default('') }}"
  63. labels:
  64. component: support
  65. logging-infra: support
  66. provider: openshift
  67. when: openshift_logging_use_ops | bool
  68. changed_when: no
  69. - set_fact: es_key={{ lookup('file', openshift_logging_es_key) | b64encode }}
  70. when:
  71. - openshift_logging_es_key | trim | length > 0
  72. - openshift_logging_es_allow_external | bool
  73. changed_when: false
  74. - set_fact: es_cert={{ lookup('file', openshift_logging_es_cert)| b64encode }}
  75. when:
  76. - openshift_logging_es_cert | trim | length > 0
  77. - openshift_logging_es_allow_external | bool
  78. changed_when: false
  79. - set_fact: es_ca={{ lookup('file', openshift_logging_es_ca_ext)| b64encode }}
  80. when:
  81. - openshift_logging_es_ca_ext | trim | length > 0
  82. - openshift_logging_es_allow_external | bool
  83. changed_when: false
  84. - set_fact: es_ca={{key_pairs | entry_from_named_pair('ca_file') }}
  85. when:
  86. - es_ca is not defined
  87. - openshift_logging_es_allow_external | bool
  88. changed_when: false
  89. - name: Generating Elasticsearch logging routes
  90. template: src=route_reencrypt.j2 dest={{mktemp.stdout}}/templates/logging-logging-es-route.yaml
  91. tags: routes
  92. vars:
  93. obj_name: "logging-es"
  94. route_host: "{{openshift_logging_es_hostname}}"
  95. service_name: "logging-es"
  96. tls_key: "{{es_key | default('') | b64decode}}"
  97. tls_cert: "{{es_cert | default('') | b64decode}}"
  98. tls_ca_cert: "{{es_ca | b64decode}}"
  99. tls_dest_ca_cert: "{{key_pairs | entry_from_named_pair('ca_file')| b64decode }}"
  100. edge_term_policy: "{{openshift_logging_es_edge_term_policy | default('') }}"
  101. labels:
  102. component: support
  103. logging-infra: support
  104. provider: openshift
  105. changed_when: no
  106. when: openshift_logging_es_allow_external | bool
  107. - set_fact: es_ops_key={{ lookup('file', openshift_logging_es_ops_key) | b64encode }}
  108. when:
  109. - openshift_logging_es_ops_allow_external | bool
  110. - openshift_logging_use_ops | bool
  111. - "{{ openshift_logging_es_ops_key | trim | length > 0 }}"
  112. changed_when: false
  113. - set_fact: es_ops_cert={{ lookup('file', openshift_logging_es_ops_cert)| b64encode }}
  114. when:
  115. - openshift_logging_es_ops_allow_external | bool
  116. - openshift_logging_use_ops | bool
  117. - "{{openshift_logging_es_ops_cert | trim | length > 0}}"
  118. changed_when: false
  119. - set_fact: es_ops_ca={{ lookup('file', openshift_logging_es_ops_ca_ext)| b64encode }}
  120. when:
  121. - openshift_logging_es_ops_allow_external | bool
  122. - openshift_logging_use_ops | bool
  123. - "{{openshift_logging_es_ops_ca_ext | trim | length > 0}}"
  124. changed_when: false
  125. - set_fact: es_ops_ca={{key_pairs | entry_from_named_pair('ca_file') }}
  126. when:
  127. - openshift_logging_es_ops_allow_external | bool
  128. - openshift_logging_use_ops | bool
  129. - es_ops_ca is not defined
  130. changed_when: false
  131. - name: Generating Elasticsearch logging ops routes
  132. template: src=route_reencrypt.j2 dest={{mktemp.stdout}}/templates/logging-logging-es-ops-route.yaml
  133. tags: routes
  134. vars:
  135. obj_name: "logging-es-ops"
  136. route_host: "{{openshift_logging_es_ops_hostname}}"
  137. service_name: "logging-es-ops"
  138. tls_key: "{{es_ops_key | default('') | b64decode}}"
  139. tls_cert: "{{es_ops_cert | default('') | b64decode}}"
  140. tls_ca_cert: "{{es_ops_ca | b64decode}}"
  141. tls_dest_ca_cert: "{{key_pairs | entry_from_named_pair('ca_file')| b64decode }}"
  142. edge_term_policy: "{{openshift_logging_es_ops_edge_term_policy | default('') }}"
  143. labels:
  144. component: support
  145. logging-infra: support
  146. provider: openshift
  147. when:
  148. - openshift_logging_es_ops_allow_external | bool
  149. - openshift_logging_use_ops | bool
  150. changed_when: no