Harden existing-host observability deploy defaults

This commit is contained in:
Haitao Pan 2026-03-14 19:51:43 +08:00
parent c3fe0324ea
commit 7382073910
3 changed files with 15 additions and 7 deletions

View File

@ -118,11 +118,19 @@
register: observability_dns_public
until:
- observability_dns_public.status == 200
- observability_dns_public.json.Status == 0
- >
(observability_dns_public.json.Answer | default([])
| selectattr('data', 'equalto', observability_dns_target ~ '.')
| list | length) > 0
(
observability_dns_public.json.Status
if (observability_dns_public.json is defined)
else ((observability_dns_public.content | from_json).Status | default(1))
) == 0
- >
(
observability_dns_public.json.Answer
if (observability_dns_public.json is defined)
else ((observability_dns_public.content | from_json).Answer | default([]))
) | selectattr('data', 'equalto', observability_dns_target ~ '.')
| list | length > 0
retries: "{{ dns_wait_retries }}"
delay: "{{ dns_wait_delay }}"

View File

@ -268,7 +268,7 @@
- name: setup nginx exporter
ignore_errors: true
tags: nginx_exporter
when: nginx_exporter_enabled|bool
when: nginx_enabled|bool and nginx_exporter_enabled|bool
block:
- name: copy nginx_exporter systemd service
template: src=nginx/nginx_exporter.svc dest={{ systemd_dir }}/nginx_exporter.service owner=root group=root mode='0644'

View File

@ -107,7 +107,7 @@ proxy_env: # global proxy env when downloading packages
#-----------------------------------------------------------------
# NGINX (Reference)
#-----------------------------------------------------------------
nginx_enabled: true # enable nginx on this infra node?
nginx_enabled: false # enable nginx on this infra node?
nginx_home: /www # nginx content dir, `/www` by default (soft link to nginx_data)
nginx_data: /data/nginx # nginx actual data dir, /data/nginx by default
#-----------------------------------------------------------------
@ -119,4 +119,4 @@ repo_name: pigsty # repo name, pigsty by default
# CA (Reference)
#-----------------------------------------------------------------
cert_validity: 7300d # cert validity, 20 years by default
...
...