2020-02-03 11:00:27 +00:00
|
|
|
---
|
2021-05-10 13:29:38 +00:00
|
|
|
- name: Verify Ansible versions
|
2021-04-09 06:18:59 +00:00
|
|
|
hosts: all
|
|
|
|
tags: always
|
2021-05-10 13:29:38 +00:00
|
|
|
become: false
|
|
|
|
run_once: true
|
2021-04-09 06:18:59 +00:00
|
|
|
gather_facts: false
|
|
|
|
tasks:
|
2024-06-13 15:19:32 +00:00
|
|
|
- local_action: command ./roles.py --check
|
2021-04-09 06:18:59 +00:00
|
|
|
changed_when: false
|
|
|
|
|
2020-02-03 11:00:27 +00:00
|
|
|
- name: Configure ElasticSearch servers
|
2021-02-09 19:27:13 +00:00
|
|
|
become: true
|
2022-02-03 20:38:55 +00:00
|
|
|
hosts: logs.nimbus
|
2020-02-03 11:00:27 +00:00
|
|
|
roles:
|
2024-03-10 12:26:14 +00:00
|
|
|
- { role: infra-role-swap-file, tags: swap-file }
|
|
|
|
- { role: infra-role-open-ports, tags: open-ports }
|
|
|
|
- { role: infra-role-elasticsearch, tags: elasticsearch }
|
2020-02-05 12:39:43 +00:00
|
|
|
|
|
|
|
- name: Configure ElasticSearch servers
|
2021-02-09 19:27:13 +00:00
|
|
|
become: true
|
2022-02-03 20:38:55 +00:00
|
|
|
hosts: dash.nimbus
|
2020-02-05 12:39:43 +00:00
|
|
|
pre_tasks:
|
|
|
|
- name: Fetch available elasticsearch nodes
|
|
|
|
uri:
|
2022-02-03 20:38:55 +00:00
|
|
|
url: '{{ consul_catalog_url }}/service/elasticsearch?dc={{ es_lb_cluster_dc }}&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:
|
2024-03-10 12:26:14 +00:00
|
|
|
- { role: infra-role-swap-file, tags: swap-file }
|
|
|
|
- { role: infra-role-open-ports, tags: open-ports }
|
|
|
|
- { role: infra-role-elasticsearch-lb, tags: elasticsearch-lb }
|
|
|
|
- { role: infra-role-logclean-job, tags: logclean-job }
|
|
|
|
- { role: infra-role-kibana, tags: kibana }
|
|
|
|
- { role: infra-role-oauth-proxy, tags: oauth-proxy }
|