main.yaml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. ---
  2. - name: Ensure that ElasticSearch has nodes to run on
  3. import_role:
  4. name: openshift_control_plane
  5. tasks_from: ensure_nodes_matching_selector.yml
  6. vars:
  7. openshift_master_ensure_nodes_selector: "{{ openshift_logging_elasticsearch_nodeselector | map_to_pairs }}"
  8. openshift_master_ensure_nodes_service: Elasticsearch
  9. - name: Validate Elasticsearch cluster size
  10. fail: msg="The openshift_logging_es_cluster_size may only be scaled down manually. Please see official documentation on how to do this."
  11. when: openshift_logging_facts.elasticsearch.deploymentconfigs | length > openshift_logging_es_cluster_size|int
  12. - name: Validate Elasticsearch Ops cluster size
  13. fail: msg="The openshift_logging_es_ops_cluster_size may only be scaled down manually. Please see official documentation on how to do this."
  14. when: openshift_logging_facts.elasticsearch_ops.deploymentconfigs | length > openshift_logging_es_ops_cluster_size|int
  15. - fail:
  16. msg: Invalid deployment type, one of ['data-master', 'data-client', 'master', 'client'] allowed
  17. when: not openshift_logging_elasticsearch_deployment_type in __allowed_es_types
  18. - set_fact:
  19. elasticsearch_name: "{{ 'logging-elasticsearch' ~ ( (openshift_logging_elasticsearch_ops_deployment | default(false) | bool) | ternary('-ops', '')) }}"
  20. es_component: "{{ 'es' ~ ( (openshift_logging_elasticsearch_ops_deployment | default(false) | bool) | ternary('-ops', '') ) }}"
  21. - include_tasks: get_es_version.yml
  22. run_once: true
  23. - set_fact:
  24. full_restart_cluster: True
  25. when:
  26. - _es_installed_version is defined
  27. - _es_installed_version.split('.')[0] | int < __es_major_version
  28. - not openshift_logging_elasticsearch_ops_deployment | default(false) | bool
  29. - set_fact:
  30. full_restart_cluster: True
  31. when:
  32. - _es_ops_installed_version is defined
  33. - _es_ops_installed_version.split('.')[0] | int < __es_major_version
  34. - openshift_logging_elasticsearch_ops_deployment | default(false) | bool
  35. # allow passing in a tempdir
  36. - name: Create temp directory for doing work in
  37. command: mktemp -d /tmp/openshift-logging-ansible-XXXXXX
  38. register: mktemp
  39. changed_when: False
  40. - set_fact:
  41. tempdir: "{{ mktemp.stdout }}"
  42. # This may not be necessary in this role
  43. - name: Create templates subdirectory
  44. file:
  45. state: directory
  46. path: "{{ tempdir }}/templates"
  47. mode: 0755
  48. changed_when: False
  49. # we want to make sure we have all the necessary components here
  50. # service account
  51. - name: Create ES service account
  52. oc_serviceaccount:
  53. state: present
  54. name: "aggregated-logging-elasticsearch"
  55. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  56. image_pull_secrets: "{{ openshift_logging_image_pull_secret }}"
  57. when: openshift_logging_image_pull_secret != ''
  58. - name: Create ES service account
  59. oc_serviceaccount:
  60. state: present
  61. name: "aggregated-logging-elasticsearch"
  62. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  63. when:
  64. - openshift_logging_image_pull_secret == ''
  65. # rolebinding reader
  66. - name: Create rolebinding-reader role
  67. oc_clusterrole:
  68. state: present
  69. name: rolebinding-reader
  70. rules:
  71. - apiGroups: [""]
  72. resources: ["clusterrolebindings"]
  73. verbs: ["get"]
  74. # SA roles
  75. - name: Set rolebinding-reader permissions for ES
  76. oc_adm_policy_user:
  77. state: present
  78. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  79. resource_kind: cluster-role
  80. resource_name: rolebinding-reader
  81. user: "system:serviceaccount:{{ openshift_logging_elasticsearch_namespace }}:aggregated-logging-elasticsearch"
  82. - oc_adm_policy_user:
  83. state: present
  84. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  85. resource_kind: cluster-role
  86. resource_name: system:auth-delegator
  87. user: "system:serviceaccount:{{ openshift_logging_elasticsearch_namespace}}:aggregated-logging-elasticsearch"
  88. # logging-metrics-reader role
  89. - template:
  90. src: "logging-metrics-role.j2"
  91. dest: "{{mktemp.stdout}}/templates/logging-metrics-role.yml"
  92. vars:
  93. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  94. - template:
  95. src: "logging-metrics-rolebinding.j2"
  96. dest: "{{mktemp.stdout}}/templates/logging-metrics-rolebinding.yml"
  97. vars:
  98. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  99. role_namespace: "{{ openshift_logging_elasticsearch_prometheus_sa | serviceaccount_namespace(openshift_logging_elasticsearch_namespace) }}"
  100. role_user: "{{ openshift_logging_elasticsearch_prometheus_sa | serviceaccount_name }}"
  101. - name: Create logging-metrics-reader-role
  102. oc_obj:
  103. state: present
  104. name: "prometheus-metrics-viewer"
  105. kind: role
  106. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  107. files:
  108. - "{{mktemp.stdout}}/templates/logging-metrics-role.yml"
  109. delete_after: true
  110. - name: Create logging-metrics-reader-rolebinding
  111. oc_obj:
  112. state: present
  113. name: "prometheus-metrics-viewer"
  114. kind: rolebinding
  115. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  116. files:
  117. - "{{mktemp.stdout}}/templates/logging-metrics-rolebinding.yml"
  118. delete_after: true
  119. - name: Checking for passwd.yml
  120. stat:
  121. path: "{{ generated_certs_dir }}/passwd.yml"
  122. get_checksum: false
  123. get_attributes: false
  124. get_mime: false
  125. register: passwd_file
  126. check_mode: no
  127. - when: passwd_file.stat.exists
  128. slurp:
  129. src: "{{ generated_certs_dir }}/passwd.yml"
  130. register: _logging_metrics_proxy_passwd
  131. - when: not passwd_file.stat.exists or openshift_logging_elasticsearch_prometheus_sa not in ( _logging_metrics_proxy_passwd['content'] | b64decode | from_yaml )
  132. template:
  133. src: passwd.j2
  134. dest: "{{ generated_certs_dir }}/passwd.yml"
  135. vars:
  136. logging_user_name: "{{ openshift_logging_elasticsearch_prometheus_sa }}"
  137. logging_user_passwd: "{{ 16 | lib_utils_oo_random_word | b64encode }}"
  138. - slurp:
  139. src: "{{ generated_certs_dir }}/passwd.yml"
  140. register: _logging_metrics_proxy_passwd
  141. # View role and binding
  142. - name: Generate logging-elasticsearch-view-role
  143. template:
  144. src: "rolebinding.j2"
  145. dest: "{{mktemp.stdout}}/logging-elasticsearch-view-role.yaml"
  146. vars:
  147. obj_name: logging-elasticsearch-view-role
  148. roleRef:
  149. name: view
  150. subjects:
  151. - kind: ServiceAccount
  152. name: aggregated-logging-elasticsearch
  153. changed_when: no
  154. - name: Set logging-elasticsearch-view-role role
  155. oc_obj:
  156. state: present
  157. name: "logging-elasticsearch-view-role"
  158. kind: rolebinding
  159. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  160. files:
  161. - "{{ tempdir }}/logging-elasticsearch-view-role.yaml"
  162. delete_after: true
  163. # configmap
  164. - assert:
  165. that:
  166. - openshift_logging_elasticsearch_kibana_index_mode in __kibana_index_modes
  167. msg: "The openshift_logging_elasticsearch_kibana_index_mode '{{ openshift_logging_elasticsearch_kibana_index_mode }}' only supports one of: {{ __kibana_index_modes | join(', ') }}"
  168. - assert:
  169. that:
  170. - "{{ openshift_logging_es_log_appenders | length > 0 }}"
  171. msg: "The openshift_logging_es_log_appenders '{{ openshift_logging_es_log_appenders }}' has an unrecognized option and only supports the following as a list: {{ __es_log_appenders | join(', ') }}"
  172. - template:
  173. src: "elasticsearch.yml.j2"
  174. dest: "{{ tempdir }}/elasticsearch.yml"
  175. vars:
  176. allow_cluster_reader: "{{ openshift_logging_elasticsearch_ops_allow_cluster_reader | lower | default('false') }}"
  177. es_kibana_index_mode: "{{ openshift_logging_elasticsearch_kibana_index_mode | default('unique') }}"
  178. es_unicast_host: "logging-{{ es_component }}-cluster"
  179. changed_when: no
  180. # create diff between current configmap files and our current files
  181. - template:
  182. src: "log4j2.properties.j2"
  183. dest: "{{ tempdir }}/log4j2.properties"
  184. vars:
  185. root_logger: "{{ openshift_logging_es_log_appenders | list }}"
  186. changed_when: no
  187. - include_role:
  188. name: openshift_logging
  189. tasks_from: patch_configmap_files.yaml
  190. vars:
  191. configmap_name: "{{ elasticsearch_name }}"
  192. configmap_namespace: "{{ openshift_logging_namespace }}"
  193. configmap_file_names:
  194. - current_file: "elasticsearch.yml"
  195. new_file: "{{ tempdir }}/elasticsearch.yml"
  196. - current_file: "log4j2.properties"
  197. new_file: "{{ tempdir }}/log4j2.properties"
  198. when: not full_restart_cluster | default(false) | bool
  199. - slurp:
  200. src: "{{ tempdir }}/elasticsearch.yml"
  201. register: _patched_elasticsearch_config
  202. - copy:
  203. content: "{{ config_source | combine(override_config, recursive=True) | to_nice_yaml(indent=2) }}"
  204. dest: "{{ tempdir }}/elasticsearch.yml"
  205. vars:
  206. config_source: "{{ _patched_elasticsearch_config['content'] | b64decode | from_yaml }}"
  207. override_config: "{{ openshift_logging_es_config | default({}) | from_yaml }}"
  208. - name: Set ES configmap
  209. oc_configmap:
  210. state: present
  211. name: "{{ elasticsearch_name }}"
  212. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  213. from_file:
  214. elasticsearch.yml: "{{ tempdir }}/elasticsearch.yml"
  215. log4j2.properties: "{{ tempdir }}/log4j2.properties"
  216. register: es_config_creation
  217. notify: "restart elasticsearch"
  218. - when: es_config_creation.changed | bool
  219. block:
  220. - set_fact:
  221. _restart_logging_components: "{{ _restart_logging_components | default([]) + [es_component] | unique }}"
  222. - shell: >
  223. {{ openshift_client_binary }} --config={{ openshift.common.config_base }}/master/admin.kubeconfig get dc -l component="{{ es_component }}" -n "{{ openshift_logging_elasticsearch_namespace }}" -o name | cut -d'/' -f2
  224. register: _es_dcs
  225. - set_fact:
  226. _restart_logging_nodes: "{{ _restart_logging_nodes | default([]) + [_es_dcs.stdout] | unique }}"
  227. when: _es_dcs.stdout != ""
  228. # secret
  229. - name: Set ES secret
  230. oc_secret:
  231. state: present
  232. name: "logging-elasticsearch"
  233. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  234. files:
  235. - name: key
  236. path: "{{ generated_certs_dir }}/logging-es.jks"
  237. - name: truststore
  238. path: "{{ generated_certs_dir }}/truststore.jks"
  239. - name: searchguard.key
  240. path: "{{ generated_certs_dir }}/elasticsearch.jks"
  241. - name: searchguard.truststore
  242. path: "{{ generated_certs_dir }}/truststore.jks"
  243. - name: admin-key
  244. path: "{{ generated_certs_dir }}/system.admin.key"
  245. - name: admin-cert
  246. path: "{{ generated_certs_dir }}/system.admin.crt"
  247. - name: admin-ca
  248. path: "{{ generated_certs_dir }}/ca.crt"
  249. - name: admin.jks
  250. path: "{{ generated_certs_dir }}/system.admin.jks"
  251. - name: passwd.yml
  252. path: "{{ generated_certs_dir }}/passwd.yml"
  253. # services
  254. - name: Set logging-{{ es_component }}-cluster service
  255. oc_service:
  256. state: present
  257. name: "logging-{{ es_component }}-cluster"
  258. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  259. clusterip: 'None'
  260. annotations:
  261. service.alpha.kubernetes.io/tolerate-unready-endpoints: 'true'
  262. selector:
  263. component: "{{ es_component }}"
  264. provider: openshift
  265. labels:
  266. logging-infra: 'support'
  267. ports:
  268. - port: 9300
  269. # equivalent to the unready-endpoints annotation
  270. - name: Edit logging-{{ es_component }}-cluster service
  271. oc_edit:
  272. state: present
  273. kind: service
  274. name: "logging-{{ es_component }}-cluster"
  275. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  276. content:
  277. spec.publishNotReadyAddresses: "{{ true | bool }}"
  278. - name: Set logging-{{ es_component }} service
  279. oc_service:
  280. state: present
  281. name: "logging-{{ es_component }}"
  282. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  283. selector:
  284. component: "{{ es_component }}"
  285. provider: openshift
  286. labels:
  287. logging-infra: 'support'
  288. ports:
  289. - port: 9200
  290. targetPort: "restapi"
  291. - name: Set logging-{{ es_component}}-prometheus service
  292. oc_service:
  293. state: present
  294. name: "logging-{{es_component}}-prometheus"
  295. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  296. labels:
  297. logging-infra: 'support'
  298. ports:
  299. - name: proxy
  300. port: 443
  301. targetPort: 4443
  302. selector:
  303. component: "{{ es_component }}"
  304. provider: openshift
  305. - oc_edit:
  306. kind: service
  307. name: "logging-{{es_component}}-prometheus"
  308. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  309. separator: '#'
  310. content:
  311. metadata#annotations#service.alpha.openshift.io/serving-cert-secret-name: "prometheus-tls"
  312. metadata#annotations#prometheus.io/scrape: "true"
  313. metadata#annotations#prometheus.io/scheme: "https"
  314. metadata#annotations#prometheus.io/path: "/_prometheus/metrics"
  315. metadata#annotations#prometheus.io/port: "4443"
  316. - name: Check to see if PVC already exists
  317. oc_obj:
  318. state: list
  319. kind: pvc
  320. name: "{{ openshift_logging_elasticsearch_pvc_name }}"
  321. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  322. register: logging_elasticsearch_pvc
  323. # logging_elasticsearch_pvc.results.results | length > 0 returns a false positive
  324. # so we check for the presence of 'stderr' to determine if the obj exists or not
  325. # the RC for existing and not existing is both 0
  326. - when:
  327. - logging_elasticsearch_pvc.results.stderr is defined
  328. - openshift_logging_elasticsearch_storage_type == "pvc"
  329. block:
  330. # storageclasses are used by default but if static then disable
  331. # storageclasses with the storageClassName set to "" in pvc.j2
  332. - name: Creating ES storage template - static
  333. template:
  334. src: "pvc.j2"
  335. dest: "{{ tempdir }}/templates/logging-es-pvc.yml"
  336. vars:
  337. obj_name: "{{ openshift_logging_elasticsearch_pvc_name }}"
  338. size: "{{ (openshift_logging_elasticsearch_pvc_size | trim | length == 0) | ternary('10Gi', openshift_logging_elasticsearch_pvc_size) }}"
  339. access_modes: "{{ openshift_logging_elasticsearch_pvc_access_modes | list }}"
  340. pv_selector: "{{ openshift_logging_elasticsearch_pvc_pv_selector }}"
  341. storage_class_name: "{{ openshift_logging_elasticsearch_pvc_storage_class_name | default('', true) }}"
  342. when:
  343. - not openshift_logging_elasticsearch_pvc_dynamic | bool
  344. # Storageclasses are used by default if configured
  345. - name: Creating ES storage template - dynamic
  346. template:
  347. src: "pvc.j2"
  348. dest: "{{ tempdir }}/templates/logging-es-pvc.yml"
  349. vars:
  350. obj_name: "{{ openshift_logging_elasticsearch_pvc_name }}"
  351. size: "{{ (openshift_logging_elasticsearch_pvc_size | trim | length == 0) | ternary('10Gi', openshift_logging_elasticsearch_pvc_size) }}"
  352. access_modes: "{{ openshift_logging_elasticsearch_pvc_access_modes | list }}"
  353. pv_selector: "{{ openshift_logging_elasticsearch_pvc_pv_selector }}"
  354. when:
  355. - openshift_logging_elasticsearch_pvc_dynamic | bool
  356. - name: Set ES storage
  357. oc_obj:
  358. state: present
  359. kind: pvc
  360. name: "{{ openshift_logging_elasticsearch_pvc_name }}"
  361. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  362. files:
  363. - "{{ tempdir }}/templates/logging-es-pvc.yml"
  364. delete_after: true
  365. - set_fact:
  366. es_deploy_name: "logging-{{ es_component }}-{{ openshift_logging_elasticsearch_deployment_type }}-{{ 8 | lib_utils_oo_random_word('abcdefghijklmnopqrstuvwxyz0123456789') }}"
  367. when: openshift_logging_elasticsearch_deployment_name == ""
  368. - set_fact:
  369. es_deploy_name: "{{ openshift_logging_elasticsearch_deployment_name }}"
  370. when: openshift_logging_elasticsearch_deployment_name != ""
  371. # DC
  372. - name: Set ES dc templates
  373. template:
  374. src: "es.j2"
  375. dest: "{{ tempdir }}/templates/logging-es-dc.yml"
  376. vars:
  377. es_cluster_name: "{{ es_component }}"
  378. component: "{{ es_component }}"
  379. logging_component: elasticsearch
  380. deploy_name: "{{ es_deploy_name }}"
  381. es_cpu_limit: "{{ openshift_logging_elasticsearch_cpu_limit | default('') }}"
  382. es_cpu_request: "{{ openshift_logging_elasticsearch_cpu_request | min_cpu(openshift_logging_elasticsearch_cpu_limit | default(none)) }}"
  383. es_memory_limit: "{{ openshift_logging_elasticsearch_memory_limit }}"
  384. es_node_selector: "{{ openshift_logging_elasticsearch_nodeselector | default({}) }}"
  385. es_storage_groups: "{{ openshift_logging_elasticsearch_storage_group | default([]) }}"
  386. es_container_security_context: "{{ _es_containers.elasticsearch.securityContext if _es_containers is defined and 'elasticsearch' in _es_containers and 'securityContext' in _es_containers.elasticsearch else None }}"
  387. deploy_type: "{{ openshift_logging_elasticsearch_deployment_type }}"
  388. es_replicas: 1
  389. basic_auth_passwd: "{{ ( _logging_metrics_proxy_passwd['content'] | b64decode | from_yaml )[openshift_logging_elasticsearch_prometheus_sa]['passwd'] | b64decode }}"
  390. es_number_of_shards: "{{ openshift_logging_es_number_of_shards | default(1) }}"
  391. es_number_of_replicas: "{{ openshift_logging_es_number_of_replicas| default(0) }}"
  392. - name: Set ES dc
  393. oc_obj:
  394. state: present
  395. name: "{{ es_deploy_name }}"
  396. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  397. kind: dc
  398. files:
  399. - "{{ tempdir }}/templates/logging-es-dc.yml"
  400. delete_after: true
  401. register: es_dc_creation
  402. notify: "restart elasticsearch"
  403. - set_fact:
  404. _restart_logging_components: "{{ _restart_logging_components | default([]) + [es_component] | unique }}"
  405. _restart_logging_nodes: "{{ _restart_logging_nodes | default([]) + [es_deploy_name] | unique }}"
  406. when: es_dc_creation.changed | bool
  407. - name: Retrieving the cert to use when generating secrets for the {{ es_component }} component
  408. slurp:
  409. src: "{{ generated_certs_dir }}/{{ item.file }}"
  410. register: key_pairs
  411. with_items:
  412. - { name: "ca_file", file: "ca.crt" }
  413. - { name: "es_key", file: "system.logging.es.key" }
  414. - { name: "es_cert", file: "system.logging.es.crt" }
  415. when: openshift_logging_es_allow_external | bool
  416. - set_fact:
  417. es_key: "{{ lookup('file', openshift_logging_es_key) | b64encode }}"
  418. when:
  419. - openshift_logging_es_key | trim | length > 0
  420. - openshift_logging_es_allow_external | bool
  421. changed_when: false
  422. - set_fact:
  423. es_cert: "{{ lookup('file', openshift_logging_es_cert) | b64encode }}"
  424. when:
  425. - openshift_logging_es_cert | trim | length > 0
  426. - openshift_logging_es_allow_external | bool
  427. changed_when: false
  428. - set_fact:
  429. es_ca: "{{ lookup('file', openshift_logging_es_ca_ext) | b64encode }}"
  430. when:
  431. - openshift_logging_es_ca_ext | trim | length > 0
  432. - openshift_logging_es_allow_external | bool
  433. changed_when: false
  434. - set_fact:
  435. es_ca: "{{ key_pairs | entry_from_named_pair('ca_file') }}"
  436. when:
  437. - es_ca is not defined
  438. - openshift_logging_es_allow_external | bool
  439. changed_when: false
  440. - name: Generating Elasticsearch {{ es_component }} route template
  441. template:
  442. src: "route_reencrypt.j2"
  443. dest: "{{mktemp.stdout}}/templates/logging-{{ es_component }}-route.yaml"
  444. vars:
  445. obj_name: "logging-{{ es_component }}"
  446. route_host: "{{ openshift_logging_es_hostname }}"
  447. service_name: "logging-{{ es_component }}"
  448. tls_key: "{{ es_key | default('') | b64decode }}"
  449. tls_cert: "{{ es_cert | default('') | b64decode }}"
  450. tls_ca_cert: "{{ es_ca | b64decode }}"
  451. tls_dest_ca_cert: "{{ key_pairs | entry_from_named_pair('ca_file') | b64decode }}"
  452. edge_term_policy: "{{ openshift_logging_es_edge_term_policy | default('') }}"
  453. labels:
  454. component: support
  455. logging-infra: support
  456. provider: openshift
  457. changed_when: no
  458. when: openshift_logging_es_allow_external | bool
  459. # This currently has an issue if the host name changes
  460. - name: Setting Elasticsearch {{ es_component }} route
  461. oc_obj:
  462. state: present
  463. name: "logging-{{ es_component }}"
  464. namespace: "{{ openshift_logging_elasticsearch_namespace }}"
  465. kind: route
  466. files:
  467. - "{{ tempdir }}/templates/logging-{{ es_component }}-route.yaml"
  468. when: openshift_logging_es_allow_external | bool
  469. ## Placeholder for migration when necessary ##
  470. - name: Delete temp directory
  471. file:
  472. name: "{{ tempdir }}"
  473. state: absent
  474. changed_when: False