Skip to content

Commit

Permalink
Merge pull request #166 from zmc/wip-prom-pkg
Browse files Browse the repository at this point in the history
Allow installing prometheus and node_exporter from packages

Reviewed-by: Boris Ranto <branto@redhat.com>
  • Loading branch information
b-ranto authored May 10, 2018
2 parents ccbb9ca + 07eda2f commit e11714b
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 25 deletions.
2 changes: 2 additions & 0 deletions ansible/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
become: true
roles:
- ceph-node-exporter
tags:
- node-exporter

- hosts:
# These are roles used by ceph-ansible
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/ceph-node-exporter/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ defaults:
apt:
- prometheus-node-exporter
yum:
- golang-github-prometheus-node_exporter
- prometheus-node_exporter
6 changes: 0 additions & 6 deletions ansible/roles/ceph-node-exporter/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,11 @@
- include: create_user.yml
when:
- devel_mode
tags:
- node_exporter

- include: download.yml
when:
- devel_mode
tags:
- node_exporter

- include: create_service.yml
when:
- devel_mode
tags:
- node_exporter
6 changes: 6 additions & 0 deletions ansible/roles/ceph-prometheus/tasks/install_packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: Install prometheus
package:
name: prometheus
state: latest
notify: Service handler
14 changes: 2 additions & 12 deletions ansible/roles/ceph-prometheus/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -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
5 changes: 0 additions & 5 deletions ansible/roles/ceph-prometheus/tasks/sanity.yml

This file was deleted.

9 changes: 9 additions & 0 deletions ansible/roles/ceph-prometheus/tasks/setup_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ commands=ansible-lint -x ANSIBLE0010,ANSIBLE0012,ANSIBLE0017 ansible/playbook.ym
[testenv:ansible-syntax]
install_command = pip install --upgrade {opts} {packages}
deps=
ansible==2.2.3.0
ansible
changedir=ansible
commands=
ansible-playbook -i '127.0.0.1,' playbook.yml --syntax-check -vv
Expand Down

0 comments on commit e11714b

Please sign in to comment.