48 lines
1.6 KiB
YAML
48 lines
1.6 KiB
YAML
---
|
|
- name: Verify Ansible versions
|
|
hosts: all
|
|
tags: always
|
|
become: false
|
|
run_once: true
|
|
gather_facts: false
|
|
tasks:
|
|
- local_action: command ./roles.py --check
|
|
changed_when: false
|
|
|
|
- name: Configure ElasticSearch servers
|
|
become: true
|
|
hosts: logs.nimbus
|
|
roles:
|
|
- { role: infra-role-swap-file, tags: swap-file }
|
|
- { role: infra-role-open-ports, tags: open-ports }
|
|
- { role: infra-role-elasticsearch, tags: elasticsearch }
|
|
|
|
- name: Configure ElasticSearch servers
|
|
become: true
|
|
hosts: dash.nimbus
|
|
pre_tasks:
|
|
- name: Fetch available elasticsearch nodes
|
|
uri:
|
|
url: '{{ consul_catalog_url }}/service/elasticsearch?dc={{ es_lb_cluster_dc }}&tag={{ es_lb_cluster_name }}'
|
|
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", inventory_hostname)
|
|
| list
|
|
| json_query(
|
|
'[].{
|
|
name: Node,
|
|
addr: ServiceAddress,
|
|
port: to_string(ServiceMeta.cluster_port)
|
|
}') }}
|
|
roles:
|
|
- { 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: logclean-job, tags: logclean-job }
|
|
- { role: infra-role-kibana, tags: kibana }
|
|
- { role: infra-role-oauth-proxy, tags: oauth-proxy }
|