From b5034abf5b87bf760c983c5864b19d4fee4dd100 Mon Sep 17 00:00:00 2001 From: Sven Ketelsen Date: Thu, 22 Jun 2023 10:49:40 +0200 Subject: [PATCH] DEV-1111 updates - gitea 1.19 - pgadmin4 7.1 - traefik 2.10.1 - elastic stack 7.16.3 --- group_vars/all/versions.yml | 12 +++---- roles/elastic/tasks/main.yaml | 28 ++++----------- roles/elastic/tasks/update_settings.yml | 48 +++++++++++++++++++++++++ roles/prometheus/tasks/main.yml | 24 ------------- 4 files changed, 60 insertions(+), 52 deletions(-) create mode 100644 roles/elastic/tasks/update_settings.yml diff --git a/group_vars/all/versions.yml b/group_vars/all/versions.yml index ff87010..f2eaf0f 100644 --- a/group_vars/all/versions.yml +++ b/group_vars/all/versions.yml @@ -1,12 +1,12 @@ --- -elastic_elasticsearch_version: "7.16.1" +elastic_elasticsearch_version: "7.16.3" elastic_elasticsearch_exporter_version: "v1.5.0" elastic_filebeat_version: "7.16.3" -elastic_kibana_version: "7.16.1" +elastic_kibana_version: "7.16.3" elastic_logstash_version: "7.16.3" elastic_metricbeat_version: "7.16.3" -gitea_version: "1.15" +gitea_version: "1.19" prom_grafana_version: "9.1.5" @@ -14,14 +14,14 @@ harbor_version: "v2.4.1" keycloak_version: "21.0.2.7" -pgadmin4_version: "7.1" +pgadmin4_version: "7.3" prom_alertmanager_version: "v0.25.0" -prom_blackbox_exporter_version: "v0.23.0" +prom_blackbox_exporter_version: "v0.24.0" prom_prometheus_version: "v2.44.0" prom_prom2teams_version: "3.2.3" # TODO 4.2.1 -traefik_version: "v2.10.1" +traefik_version: "v2.10.3" connect_version: "10.5" iam_version: "10.5" diff --git a/roles/elastic/tasks/main.yaml b/roles/elastic/tasks/main.yaml index 49a0e67..35f0f58 100644 --- a/roles/elastic/tasks/main.yaml +++ b/roles/elastic/tasks/main.yaml @@ -3,6 +3,7 @@ ### tags: ### update_certs ### update_config +### update_settings ### update_deployment - name: "Check if {{ elastic_id }}/docker-compose.yml exists" @@ -81,25 +82,8 @@ - update_config - update_deployment -- name: "Set VAR" - set_fact: - es_cluster_settings: - persistent: - cluster.max_shards_per_node: "{{ elastic_cluster_settings_max_shards }}" - -- name: "Set cluster config" - uri: - url: "https://localhost:9200/_cluster/settings" - method: PUT - ca_path: "{{ service_base_path }}/{{ elastic_id }}/certs/ca/ca.crt" - user: "{{ elastic_admin_username }}" - password: "{{ elastic_admin_password }}" - headers: - Content-Type: "application/json" - Accept: "application/json" - body_format: "json" - body: "{{ es_cluster_settings |to_json }}" - force_basic_auth: true - status_code: 200 - when: - - inventory_hostname == groups['elastic'][0] +- name: "Update elastic settings" + include_tasks: update_settings.yml + tags: + - update_config + - update_settings diff --git a/roles/elastic/tasks/update_settings.yml b/roles/elastic/tasks/update_settings.yml new file mode 100644 index 0000000..c1123b4 --- /dev/null +++ b/roles/elastic/tasks/update_settings.yml @@ -0,0 +1,48 @@ +--- +### tags: +### update_settings + +- name: "Wait for " + ansible.builtin.uri: + url: "https://{{ inventory_hostname }}:9200" + user: "{{ elastic_admin_username }}" + password: "{{ elastic_admin_password }}" + ca_path: "{{ service_base_path }}/{{ elastic_id }}/certs/ca/ca.crt" + method: GET + status_code: 200 + return_content: yes + register: elastic_stats + until: elastic_stats.status == 200 + retries: 15 + delay: 6 + tags: + - update_config + - update_settings + +- name: "Set VAR" + ansible.builtin.set_fact: + es_cluster_settings: + persistent: + cluster.max_shards_per_node: "{{ elastic_cluster_settings_max_shards }}" + tags: + - update_config + - update_settings + +- name: "Set cluster config" + ansible.builtin.uri: + url: "https://localhost:9200/_cluster/settings" + method: PUT + ca_path: "{{ service_base_path }}/{{ elastic_id }}/certs/ca/ca.crt" + user: "{{ elastic_admin_username }}" + password: "{{ elastic_admin_password }}" + headers: + Content-Type: "application/json" + Accept: "application/json" + body: "{{ es_cluster_settings | to_json }}" + force_basic_auth: true + status_code: 200 + when: + - inventory_hostname == groups['elastic'][0] + tags: + - update_config + - update_settings diff --git a/roles/prometheus/tasks/main.yml b/roles/prometheus/tasks/main.yml index 61adea8..3fefff9 100644 --- a/roles/prometheus/tasks/main.yml +++ b/roles/prometheus/tasks/main.yml @@ -210,27 +210,3 @@ job: /root/hetzner_api.py tags: - update-hetzner-metrics - -# remove after 31.12.2022 -- name: "Remove old cronjob to exec digitalocean api metric script" - ansible.builtin.cron: - name: "update replication table" - state: "absent" - tags: - - update-digitalocean-metrics - -# remove after 31.12.2022 -- name: "Remove old digitalocean api metric script" - ansible.builtin.file: - path: /root/do_too_many_req_metrics.sh - state: absent - tags: - - update-digitalocean-metrics - -# remove after 31.12.2022 -- name: "Remove old hetzner api metric script" - ansible.builtin.file: - path: /root/hetzner_unattached_volumes.py - state: absent - tags: - - update-hetzner-metrics