diff --git a/roles/o11y_agent/templates/agent-deb.yaml.j2 b/roles/o11y_agent/templates/agent-deb.yaml.j2 index df0d914..fc19285 100644 --- a/roles/o11y_agent/templates/agent-deb.yaml.j2 +++ b/roles/o11y_agent/templates/agent-deb.yaml.j2 @@ -10,8 +10,8 @@ metrics: host: {{ ansible_hostname }} {% if group_names|intersect(['maas_region_controller', 'maas_rack_controller']) %} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} {% endif %} remote_write: - url: {{o11y_prometheus_url}} @@ -61,8 +61,8 @@ logs: labels: job: "maas-audit" maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} maas_module: "audit" relabel_configs: - source_labels: ['__syslog_message_hostname'] @@ -84,8 +84,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-console" {% if 'maas_rack_controller' in group_names %} @@ -95,8 +95,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-dhcpd" {% endif %} @@ -106,8 +106,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-metadata" - job_name: maas-named @@ -116,8 +116,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-named" - job_name: maas-ntpd @@ -126,8 +126,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-ntpd" - job_name: maas-proxy @@ -136,8 +136,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-proxy" - job_name: maas-temporal @@ -146,8 +146,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-temporal" - job_name: maas-apiserver @@ -156,8 +156,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-apiserver" - job_name: maas-agent @@ -166,8 +166,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-agent" {% endif %} {% if 'maas_postgres' in group_names %} diff --git a/roles/o11y_agent/templates/agent-snap.yaml.j2 b/roles/o11y_agent/templates/agent-snap.yaml.j2 index 02a349b..e730c07 100644 --- a/roles/o11y_agent/templates/agent-snap.yaml.j2 +++ b/roles/o11y_agent/templates/agent-snap.yaml.j2 @@ -10,8 +10,8 @@ metrics: host: {{ ansible_hostname }} {% if group_names|intersect(['maas_region_controller', 'maas_rack_controller']) %} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} {% endif %} remote_write: - url: {{o11y_prometheus_url}} @@ -61,8 +61,8 @@ logs: labels: job: "maas-audit" maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} maas_module: "audit" relabel_configs: - source_labels: ['__syslog_message_hostname'] @@ -84,8 +84,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-console" {% if 'maas_rack_controller' in group_names %} @@ -95,8 +95,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-dhcpd" {% endif %} @@ -106,8 +106,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-metadata" - job_name: maas-named @@ -116,8 +116,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-named" - job_name: maas-ntpd @@ -126,8 +126,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-ntpd" - job_name: maas-proxy @@ -136,8 +136,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-proxy" - job_name: maas-temporal @@ -146,8 +146,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-temporal" - job_name: maas-apiserver @@ -156,8 +156,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-apiserver" - job_name: maas-agent @@ -166,8 +166,8 @@ logs: labels: host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-agent" {% endif %} {% if 'maas_postgres' in group_names %} diff --git a/roles/o11y_agent/templates/grafana-agent.yaml.j2 b/roles/o11y_agent/templates/grafana-agent.yaml.j2 index d784e04..5ca8b6f 100644 --- a/roles/o11y_agent/templates/grafana-agent.yaml.j2 +++ b/roles/o11y_agent/templates/grafana-agent.yaml.j2 @@ -10,8 +10,8 @@ metrics: host: {{ ansible_hostname }} {% if group_names|intersect(['maas_region_controller', 'maas_rack_controller']) %} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} {% endif %} remote_write: - url: {{o11y_prometheus_url}} @@ -61,8 +61,8 @@ logs: labels: job: "maas-audit" maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} maas_module: "audit" relabel_configs: - source_labels: ['__syslog_message_hostname'] @@ -84,8 +84,8 @@ logs: __path__: {{ maas_log_dir }}/{regiond,rackd}.log host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-console" pipeline_stages: - regex: @@ -115,8 +115,8 @@ logs: __path__: {{ maas_log_dir }}/dhcpd*.log host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-dhcpd" {% endif %} @@ -126,8 +126,8 @@ logs: __path__: {{ maas_log_dir }}/http/access.log host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-metadata" pipeline_stages: - regex: @@ -147,8 +147,8 @@ logs: __path__: {{ maas_log_dir }}/named.log host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-named" - job_name: maas-ntpd @@ -157,8 +157,8 @@ logs: __path__: {{ maas_log_dir }}/chrony.log host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-ntpd" - job_name: maas-proxy @@ -167,8 +167,8 @@ logs: __path__: {{ maas_log_dir }}/proxy.log host: {{ ansible_hostname }} maas_az: {{ maas_availability_zone | default('default') }} - maas_region: {{ 'True' if 'maas_region_controller' in group_names else 'False' }} - maas_rack: {{ 'True' if 'maas_rack_controller' in group_names else 'False' }} + maas_region: {{ 'maas_region_controller' in group_names }} + maas_rack: {{ 'maas_rack_controller' in group_names }} job: "maas-proxy" {% endif %} {% if 'maas_postgres' in group_names %}