Infra: Ansible Nomad 05/27405/2
authorpmikus <pmikus@cisco.com>
Wed, 3 Jun 2020 10:29:25 +0000 (10:29 +0000)
committerPeter Mikus <pmikus@cisco.com>
Wed, 3 Jun 2020 13:44:26 +0000 (13:44 +0000)
+ Prometheus Telemetry stanza
- ARM Softirons

Signed-off-by: pmikus <pmikus@cisco.com>
Change-Id: Ib7bf577ed0460ab5b79700ff0f8d52d5704cec59

resources/tools/testbed-setup/ansible/inventories/lf_inventory/hosts
resources/tools/testbed-setup/ansible/roles/nomad/defaults/main.yaml
resources/tools/testbed-setup/ansible/roles/nomad/tasks/main.yaml
resources/tools/testbed-setup/ansible/roles/nomad/templates/telemetry.hcl.j2 [new file with mode: 0644]

index e95dc62..7a12a2b 100644 (file)
@@ -52,8 +52,6 @@ all:
         10.30.51.30: #s40-nomad - haswell
         10.30.51.32: #s42-nomad - ivy bridge
         10.30.51.33: #s43-nomad - ivy bridge
-        10.30.51.13: #s44-nomad - arm
-        10.30.51.14: #s45-nomad - arm
         10.32.8.14: #s46-nomad - skylake
         10.32.8.15: #s47-nomad - skylake
         10.32.8.16: #s48-nomad - skylake
index 0efbc6a..640021d 100644 (file)
@@ -89,5 +89,15 @@ nomad_bootstrap_expect: 2
 nomad_encrypt: ""
 nomad_retry_join: true
 
+# Conf - telemetry.hcl
+nomad_disable_hostname: false
+nomad_collection_interval: 60s
+nomad_use_node_name: false
+nomad_publish_allocation_metrics: true
+nomad_publish_node_metrics: true
+nomad_backwards_compatible_metrics: false
+nomad_telemetry_provider_parameters:
+  prometheus_metrics: true
+
 # Conf - custom.hcl
 # empty
index fa95d64..a8bf90f 100644 (file)
   tags:
     - nomad-conf
 
+- name: Conf - Telemetry Configuration
+  template:
+    src: telemetry.hcl.j2
+    dest: "{{ nomad_config_dir }}/telemetry.hcl"
+    owner: "{{ nomad_user }}"
+    group: "{{ nomad_group }}"
+    mode: 0644
+  tags:
+    - nomad-conf
+
 - name: Conf - Custom Configuration
   template:
     src: custom.json.j2
diff --git a/resources/tools/testbed-setup/ansible/roles/nomad/templates/telemetry.hcl.j2 b/resources/tools/testbed-setup/ansible/roles/nomad/templates/telemetry.hcl.j2
new file mode 100644 (file)
index 0000000..256c699
--- /dev/null
@@ -0,0 +1,20 @@
+telemetry {
+    # Telemetry provider parameters
+    {% for key, value in nomad_telemetry_provider_parameters.items() -%}
+    {% if value|bool -%}
+    {{ key }} = {{ value | bool | lower }}
+    {% elif value|string or value == "" -%}
+    {{ key }} = "{{ value }}"
+    {% else %}
+    {{ key }} = {{ value }}
+    {% endif -%}
+    {% endfor -%}
+
+    # Common parameters
+    disable_hostname = {{ nomad_disable_hostname | bool | lower }}
+    collection_interval = "{{ nomad_collection_interval }}"
+    use_node_name = {{ nomad_use_node_name | bool | lower }}
+    publish_allocation_metrics = {{ nomad_publish_allocation_metrics | bool | lower }}
+    publish_node_metrics = {{ nomad_publish_node_metrics | bool | lower }}
+    backwards_compatible_metrics = {{ nomad_backwards_compatible_metrics | bool | lower }}
+}