2020-02-03 11:00:27 +00:00
|
|
|
---
|
|
|
|
- name: Configure ElasticSearch servers
|
2021-02-09 19:27:13 +00:00
|
|
|
become: true
|
2020-02-03 11:00:27 +00:00
|
|
|
hosts: log-store
|
|
|
|
roles:
|
2021-01-20 19:35:33 +00:00
|
|
|
- role: swap-file
|
|
|
|
tags: swap-file
|
2020-02-03 11:00:27 +00:00
|
|
|
- role: origin-certs
|
|
|
|
tags: origin-certs
|
|
|
|
- role: elasticsearch
|
|
|
|
tags: elasticsearch
|
|
|
|
- role: elasticsearch-hq
|
|
|
|
tags: elasticsearch-hq
|
|
|
|
- role: oauth-proxy
|
|
|
|
tags: oauth-proxy
|
|
|
|
- role: nginx
|
|
|
|
tags: nginx
|
|
|
|
- role: open-ports
|
|
|
|
tags: open-ports
|
2020-02-05 12:39:43 +00:00
|
|
|
|
|
|
|
- name: Configure ElasticSearch servers
|
2021-02-09 19:27:13 +00:00
|
|
|
become: true
|
2020-02-05 12:39:43 +00:00
|
|
|
hosts: log-dash
|
|
|
|
pre_tasks:
|
|
|
|
- name: Fetch available elasticsearch nodes
|
|
|
|
uri:
|
2020-02-19 10:51:09 +00:00
|
|
|
url: '{{ consul_catalog_url }}/service/elasticsearch?dc={{ data_center }}&tag={{ es_lb_cluster_name }}'
|
2020-02-05 12:39:43 +00:00
|
|
|
register: es_services
|
|
|
|
- name: Extract ElasticSearch hostnames
|
|
|
|
set_fact:
|
|
|
|
# we also need to remove our own node from the list
|
|
|
|
es_lb_master_nodes: |
|
|
|
|
{{ es_services.json
|
|
|
|
| rejectattr("Node", "equalto", hostname)
|
|
|
|
| list
|
|
|
|
| json_query(
|
|
|
|
'[].{
|
|
|
|
name: Node,
|
|
|
|
addr: ServiceAddress,
|
|
|
|
port: to_string(ServiceMeta.cluster_port)
|
|
|
|
}') }}
|
|
|
|
roles:
|
|
|
|
- role: elasticsearch-lb
|
|
|
|
tags: elasticsearch-lb
|
2020-02-07 13:11:17 +00:00
|
|
|
- role: logclean-job
|
|
|
|
tags: logclean-job
|
2020-02-05 12:39:43 +00:00
|
|
|
- role: kibana
|
|
|
|
tags: kibana
|
|
|
|
- role: oauth-proxy
|
|
|
|
tags: oauth-proxy
|
|
|
|
- role: origin-certs
|
|
|
|
tags: origin-certs
|
|
|
|
- role: nginx
|
|
|
|
tags: nginx
|
|
|
|
- role: open-ports
|
|
|
|
tags: open-ports
|