From 997d179b7cc1ebbc95acca6bda41ed40afa9f130 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 13 May 2019 16:21:16 +0200 Subject: [PATCH] dashboard: rename template files add .j2 to all templates file related to dashboard roles. Signed-off-by: Guillaume Abrioux (cherry picked from commit 3578d576a4c16b9be68c403addf07d3c30c67117) --- .../ceph-grafana/tasks/configure_grafana.yml | 6 +++--- roles/ceph-grafana/tasks/setup_container.yml | 4 ++-- ...d.yml => dashboards-ceph-dashboard.yml.j2} | 0 ....yml => datasources-ceph-dashboard.yml.j2} | 0 .../templates/grafana-server.service | 19 ------------------- .../templates/grafana-server.service.j2 | 19 +++++++++++++++++++ .../templates/{grafana.ini => grafana.ini.j2} | 0 .../tasks/setup_container.yml | 4 ++-- ...orter.service => node_exporter.service.j2} | 0 roles/ceph-prometheus/tasks/main.yml | 4 ++-- .../ceph-prometheus/tasks/setup_container.yml | 4 ++-- ...anager.service => alertmanager.service.j2} | 0 .../{alertmanager.yml => alertmanager.yml.j2} | 0 ...ometheus.service => prometheus.service.j2} | 0 .../{prometheus.yml => prometheus.yml.j2} | 0 15 files changed, 30 insertions(+), 30 deletions(-) rename roles/ceph-grafana/templates/{dashboards-ceph-dashboard.yml => dashboards-ceph-dashboard.yml.j2} (100%) rename roles/ceph-grafana/templates/{datasources-ceph-dashboard.yml => datasources-ceph-dashboard.yml.j2} (100%) delete mode 100644 roles/ceph-grafana/templates/grafana-server.service create mode 100644 roles/ceph-grafana/templates/grafana-server.service.j2 rename roles/ceph-grafana/templates/{grafana.ini => grafana.ini.j2} (100%) rename roles/ceph-node-exporter/templates/{node_exporter.service => node_exporter.service.j2} (100%) rename roles/ceph-prometheus/templates/{alertmanager.service => alertmanager.service.j2} (100%) rename roles/ceph-prometheus/templates/{alertmanager.yml => alertmanager.yml.j2} (100%) rename roles/ceph-prometheus/templates/{prometheus.service => prometheus.service.j2} (100%) rename roles/ceph-prometheus/templates/{prometheus.yml => prometheus.yml.j2} (100%) diff --git a/roles/ceph-grafana/tasks/configure_grafana.yml b/roles/ceph-grafana/tasks/configure_grafana.yml index e031e171a..80522e42f 100644 --- a/roles/ceph-grafana/tasks/configure_grafana.yml +++ b/roles/ceph-grafana/tasks/configure_grafana.yml @@ -20,19 +20,19 @@ - name: write grafana.ini template: - src: grafana.ini + src: grafana.ini.j2 dest: /etc/grafana/grafana.ini mode: 0640 - name: write datasources provisioning config file template: - src: datasources-ceph-dashboard.yml + src: datasources-ceph-dashboard.yml.j2 dest: /etc/grafana/provisioning/datasources/ceph-dashboard.yml mode: 0640 - name: Write dashboards provisioning config file template: - src: dashboards-ceph-dashboard.yml + src: dashboards-ceph-dashboard.yml.j2 dest: /etc/grafana/provisioning/dashboards/ceph-dashboard.yml mode: 0640 diff --git a/roles/ceph-grafana/tasks/setup_container.yml b/roles/ceph-grafana/tasks/setup_container.yml index 3bb8dfcc2..7889d7194 100644 --- a/roles/ceph-grafana/tasks/setup_container.yml +++ b/roles/ceph-grafana/tasks/setup_container.yml @@ -48,8 +48,8 @@ - name: ship systemd service template: - src: grafana-server.service - dest: "/etc/systemd/system/" + src: grafana-server.service.j2 + dest: "/etc/systemd/system/grafana-server.service" owner: root group: root mode: 0644 diff --git a/roles/ceph-grafana/templates/dashboards-ceph-dashboard.yml b/roles/ceph-grafana/templates/dashboards-ceph-dashboard.yml.j2 similarity index 100% rename from roles/ceph-grafana/templates/dashboards-ceph-dashboard.yml rename to roles/ceph-grafana/templates/dashboards-ceph-dashboard.yml.j2 diff --git a/roles/ceph-grafana/templates/datasources-ceph-dashboard.yml b/roles/ceph-grafana/templates/datasources-ceph-dashboard.yml.j2 similarity index 100% rename from roles/ceph-grafana/templates/datasources-ceph-dashboard.yml rename to roles/ceph-grafana/templates/datasources-ceph-dashboard.yml.j2 diff --git a/roles/ceph-grafana/templates/grafana-server.service b/roles/ceph-grafana/templates/grafana-server.service deleted file mode 100644 index b242a18f8..000000000 --- a/roles/ceph-grafana/templates/grafana-server.service +++ /dev/null @@ -1,19 +0,0 @@ -# This file is managed by ansible, don't make changes here - they will be -# overwritten. -[Unit] -Description=grafana-server -{% if container_binary == 'docker' %} -After=docker.service -{% endif %} - -[Service] -EnvironmentFile=-/etc/environment -ExecStart=/usr/bin/{{ container_binary }} start --attach grafana-server -ExecStop=-/usr/bin/{{ container_binary }} stop grafana-server -Restart=always -RestartSec=10s -TimeoutStartSec=120 -TimeoutStopSec=15 - -[Install] -WantedBy=multi-user.target diff --git a/roles/ceph-grafana/templates/grafana-server.service.j2 b/roles/ceph-grafana/templates/grafana-server.service.j2 new file mode 100644 index 000000000..dd647495d --- /dev/null +++ b/roles/ceph-grafana/templates/grafana-server.service.j2 @@ -0,0 +1,19 @@ +# This file is managed by ansible, don't make changes here - they will be +# overwritten. +[Unit] +Description=grafana-server +{% if container_binary == 'docker' %} +After=docker.service +{% endif %} + + [Service] +EnvironmentFile=-/etc/environment +ExecStart=/usr/bin/{{ container_binary }} start --attach grafana-server +ExecStop=-/usr/bin/{{ container_binary }} stop grafana-server +Restart=always +RestartSec=10s +TimeoutStartSec=120 +TimeoutStopSec=15 + + [Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/roles/ceph-grafana/templates/grafana.ini b/roles/ceph-grafana/templates/grafana.ini.j2 similarity index 100% rename from roles/ceph-grafana/templates/grafana.ini rename to roles/ceph-grafana/templates/grafana.ini.j2 diff --git a/roles/ceph-node-exporter/tasks/setup_container.yml b/roles/ceph-node-exporter/tasks/setup_container.yml index a72e5c20c..6a557f23c 100644 --- a/roles/ceph-node-exporter/tasks/setup_container.yml +++ b/roles/ceph-node-exporter/tasks/setup_container.yml @@ -29,8 +29,8 @@ - name: ship systemd service template: - src: node_exporter.service - dest: "/etc/systemd/system/" + src: node_exporter.service.j2 + dest: "/etc/systemd/system/node_exporter.service" owner: root group: root mode: 0644 diff --git a/roles/ceph-node-exporter/templates/node_exporter.service b/roles/ceph-node-exporter/templates/node_exporter.service.j2 similarity index 100% rename from roles/ceph-node-exporter/templates/node_exporter.service rename to roles/ceph-node-exporter/templates/node_exporter.service.j2 diff --git a/roles/ceph-prometheus/tasks/main.yml b/roles/ceph-prometheus/tasks/main.yml index 39f15008e..71affd66b 100644 --- a/roles/ceph-prometheus/tasks/main.yml +++ b/roles/ceph-prometheus/tasks/main.yml @@ -10,7 +10,7 @@ - name: write prometheus config file template: - src: prometheus.yml + src: prometheus.yml.j2 dest: "{{ prometheus_conf_dir }}/" owner: "{{ prometheus_user_id }}" notify: service handler @@ -40,7 +40,7 @@ - name: write alertmanager config file template: - src: alertmanager.yml + src: alertmanager.yml.j2 dest: "{{ alertmanager_conf_dir }}/" owner: "root" notify: service handler diff --git a/roles/ceph-prometheus/tasks/setup_container.yml b/roles/ceph-prometheus/tasks/setup_container.yml index fddbed7d4..b78134cf3 100644 --- a/roles/ceph-prometheus/tasks/setup_container.yml +++ b/roles/ceph-prometheus/tasks/setup_container.yml @@ -62,8 +62,8 @@ - name: ship systemd services template: - src: "{{ item }}" - dest: "/etc/systemd/system/" + src: "{{ item }}.j2" + dest: "/etc/systemd/system/{{ item }}" owner: root group: root mode: 0644 diff --git a/roles/ceph-prometheus/templates/alertmanager.service b/roles/ceph-prometheus/templates/alertmanager.service.j2 similarity index 100% rename from roles/ceph-prometheus/templates/alertmanager.service rename to roles/ceph-prometheus/templates/alertmanager.service.j2 diff --git a/roles/ceph-prometheus/templates/alertmanager.yml b/roles/ceph-prometheus/templates/alertmanager.yml.j2 similarity index 100% rename from roles/ceph-prometheus/templates/alertmanager.yml rename to roles/ceph-prometheus/templates/alertmanager.yml.j2 diff --git a/roles/ceph-prometheus/templates/prometheus.service b/roles/ceph-prometheus/templates/prometheus.service.j2 similarity index 100% rename from roles/ceph-prometheus/templates/prometheus.service rename to roles/ceph-prometheus/templates/prometheus.service.j2 diff --git a/roles/ceph-prometheus/templates/prometheus.yml b/roles/ceph-prometheus/templates/prometheus.yml.j2 similarity index 100% rename from roles/ceph-prometheus/templates/prometheus.yml rename to roles/ceph-prometheus/templates/prometheus.yml.j2 -- 2.39.5