From: Zack Cerza Date: Fri, 20 Apr 2018 23:39:22 +0000 (-0500) Subject: ceph-prometheus: Allow installation via packages X-Git-Tag: v2.0~33^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5e113b136106b9eb16407c4a7cbfd275da569fce;p=cephmetrics.git ceph-prometheus: Allow installation via packages Signed-off-by: Zack Cerza --- diff --git a/ansible/roles/ceph-prometheus/tasks/install_packages.yml b/ansible/roles/ceph-prometheus/tasks/install_packages.yml new file mode 100644 index 0000000..a4f9db2 --- /dev/null +++ b/ansible/roles/ceph-prometheus/tasks/install_packages.yml @@ -0,0 +1,6 @@ +--- +- name: Install prometheus + package: + name: prometheus + state: latest + notify: Service handler diff --git a/ansible/roles/ceph-prometheus/tasks/main.yml b/ansible/roles/ceph-prometheus/tasks/main.yml index 0f5761b..6c58e61 100644 --- a/ansible/roles/ceph-prometheus/tasks/main.yml +++ b/ansible/roles/ceph-prometheus/tasks/main.yml @@ -7,10 +7,6 @@ meta: end_play when: backend.metrics != 'mgr' or backend.storage != 'prometheus' -- include: sanity.yml - tags: - - sanity - - name: Create prometheus data directory file: path: "{{ prometheus.data_dir }}" @@ -27,11 +23,5 @@ - include: setup_container.yml when: containerized -- name: Ship systemd service - copy: - src: prometheus.service - dest: "/etc/systemd/system/" - owner: root - group: root - mode: 0644 - notify: Service handler +- import_tasks: install_packages.yml + when: not containerized diff --git a/ansible/roles/ceph-prometheus/tasks/sanity.yml b/ansible/roles/ceph-prometheus/tasks/sanity.yml deleted file mode 100644 index c091c28..0000000 --- a/ansible/roles/ceph-prometheus/tasks/sanity.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: Fail when containerized is False - fail: - msg: "This role only supports a containerized deployment at this time" - when: not containerized diff --git a/ansible/roles/ceph-prometheus/tasks/setup_container.yml b/ansible/roles/ceph-prometheus/tasks/setup_container.yml index 228b95c..0991acc 100644 --- a/ansible/roles/ceph-prometheus/tasks/setup_container.yml +++ b/ansible/roles/ceph-prometheus/tasks/setup_container.yml @@ -22,3 +22,12 @@ keep_volumes: true pull: true notify: Service handler + +- name: Ship systemd service + copy: + src: prometheus.service + dest: "/etc/systemd/system/" + owner: root + group: root + mode: 0644 + notify: Service handler