From: Zack Cerza Date: Wed, 18 Apr 2018 03:44:06 +0000 (-0600) Subject: ceph-prometheus: Rename container to 'prometheus' X-Git-Tag: v2.0~37^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F160%2Fhead;p=cephmetrics.git ceph-prometheus: Rename container to 'prometheus' This change requires some manual steps: - docker rename cephmetrics-prometheus prometheus - mv /etc/systemd/system/cephmetrics-prometheus.service /etc/systemd/system/prometheus.service - systemctl daemon-reload And finally, rerun the playbook. Signed-off-by: Zack Cerza --- diff --git a/ansible/roles/ceph-grafana/tasks/configure_grafana.yml b/ansible/roles/ceph-grafana/tasks/configure_grafana.yml index f1ba0bd..8b17c6a 100644 --- a/ansible/roles/ceph-grafana/tasks/configure_grafana.yml +++ b/ansible/roles/ceph-grafana/tasks/configure_grafana.yml @@ -80,7 +80,7 @@ { "name":"{{ grafana.datasource }}", "type":"prometheus", - "url":"http://cephmetrics-prometheus:9090", + "url":"http://prometheus:9090", "access":"proxy", "basicAuth":false, "isDefault":true diff --git a/ansible/roles/ceph-prometheus/files/cephmetrics-prometheus.service b/ansible/roles/ceph-prometheus/files/cephmetrics-prometheus.service deleted file mode 100644 index 4af2c4b..0000000 --- a/ansible/roles/ceph-prometheus/files/cephmetrics-prometheus.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=cephmetrics-prometheus -After=docker.service - -[Service] -EnvironmentFile=-/etc/environment -ExecStart=/usr/bin/docker start --attach cephmetrics-prometheus -ExecStop=-/usr/bin/docker stop cephmetrics-prometheus -Restart=always -RestartSec=10s -TimeoutStartSec=120 -TimeoutStopSec=15 - -[Install] -WantedBy=multi-user.target diff --git a/ansible/roles/ceph-prometheus/files/prometheus.service b/ansible/roles/ceph-prometheus/files/prometheus.service new file mode 100644 index 0000000..ff2c87d --- /dev/null +++ b/ansible/roles/ceph-prometheus/files/prometheus.service @@ -0,0 +1,15 @@ +[Unit] +Description=prometheus +After=docker.service + +[Service] +EnvironmentFile=-/etc/environment +ExecStart=/usr/bin/docker start --attach prometheus +ExecStop=-/usr/bin/docker stop prometheus +Restart=always +RestartSec=10s +TimeoutStartSec=120 +TimeoutStopSec=15 + +[Install] +WantedBy=multi-user.target diff --git a/ansible/roles/ceph-prometheus/handlers/main.yml b/ansible/roles/ceph-prometheus/handlers/main.yml index e1b7dfd..421bea5 100644 --- a/ansible/roles/ceph-prometheus/handlers/main.yml +++ b/ansible/roles/ceph-prometheus/handlers/main.yml @@ -3,7 +3,7 @@ # We use the systemd module here so we can use the daemon_reload feature, # since we're shipping the .service file ourselves systemd: - name: cephmetrics-prometheus + name: prometheus daemon_reload: true enabled: true state: restarted diff --git a/ansible/roles/ceph-prometheus/tasks/main.yml b/ansible/roles/ceph-prometheus/tasks/main.yml index c0cc0d0..8a9a572 100644 --- a/ansible/roles/ceph-prometheus/tasks/main.yml +++ b/ansible/roles/ceph-prometheus/tasks/main.yml @@ -29,7 +29,7 @@ - name: Ship systemd service copy: - src: cephmetrics-prometheus.service + src: prometheus.service dest: "/etc/systemd/system/" owner: root group: root diff --git a/ansible/roles/ceph-prometheus/tasks/setup_container.yml b/ansible/roles/ceph-prometheus/tasks/setup_container.yml index 25822d7..7e68116 100644 --- a/ansible/roles/ceph-prometheus/tasks/setup_container.yml +++ b/ansible/roles/ceph-prometheus/tasks/setup_container.yml @@ -8,7 +8,7 @@ - name: Start docker container docker_container: - name: cephmetrics-prometheus + name: prometheus image: "{{ prometheus.container_name }}:{{ prometheus.version }}" command: "--config.file=/prometheus/prometheus.yml" restart_policy: no