--- - name: Configure ElasticSearch servers hosts: log-store roles: - role: swap-file tags: swap-file - 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 - name: Configure ElasticSearch servers hosts: log-dash pre_tasks: - name: Fetch available elasticsearch nodes uri: url: '{{ consul_catalog_url }}/service/elasticsearch?dc={{ data_center }}&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", hostname) | list | json_query( '[].{ name: Node, addr: ServiceAddress, port: to_string(ServiceMeta.cluster_port) }') }} roles: - role: elasticsearch-lb tags: elasticsearch-lb - role: logclean-job tags: logclean-job - role: kibana tags: kibana - role: kibana-logtrail tags: kibana-logtrail - role: oauth-proxy tags: oauth-proxy - role: origin-certs tags: origin-certs - role: nginx tags: nginx - role: open-ports tags: open-ports