Jakub Sokołowski 757b097c81 add versioncheck.py script to verify Ansible role versions
Since Ansible or Ansible Galaxy doesn't actually check role versions
itself, we have to do it ourselves. This script goes through contents of
`ansible/requirements.txt` and verifies each role is installed and has
correct version.

It also checks the version of Ansible itself.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2021-04-13 08:07:26 +02:00

67 lines
1.6 KiB
YAML

---
- name: 'Verify Ansible versions'
hosts: all
run_once: true
connection: local
tags: always
gather_facts: false
tasks:
- local_action: command ./versioncheck.py
changed_when: false
- name: Configure ElasticSearch servers
become: true
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
become: true
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: oauth-proxy
tags: oauth-proxy
- role: origin-certs
tags: origin-certs
- role: nginx
tags: nginx
- role: open-ports
tags: open-ports