From e02b0a097abd2525ecdad8c62d9f512d3b06487f Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 12 Feb 2016 18:18:11 +0100 Subject: [PATCH] library/roles/tick: Bits of an influxdata (influxdb) group of roles. d4science-ghn-cluster: Fix the playbook for the next update of data.d4science.org. infrastructure-services/monitoring_and_metrics.yml: Install influxdb and the chronograf dashboard. --- tick/chronograf/defaults/main.yml | 5 +++++ tick/chronograf/tasks/main.yml | 14 ++++++++++++++ tick/influxdb/defaults/main.yml | 7 +++++++ tick/influxdb/tasks/main.yml | 19 +++++++++++++++++++ tick/telegraf/defaults/main.yml | 5 +++++ tick/telegraf/tasks/main.yml | 14 ++++++++++++++ 6 files changed, 64 insertions(+) create mode 100644 tick/chronograf/defaults/main.yml create mode 100644 tick/chronograf/tasks/main.yml create mode 100644 tick/influxdb/defaults/main.yml create mode 100644 tick/influxdb/tasks/main.yml create mode 100644 tick/telegraf/defaults/main.yml create mode 100644 tick/telegraf/tasks/main.yml diff --git a/tick/chronograf/defaults/main.yml b/tick/chronograf/defaults/main.yml new file mode 100644 index 00000000..c310920c --- /dev/null +++ b/tick/chronograf/defaults/main.yml @@ -0,0 +1,5 @@ +--- +chronograf_deb_file: chronograf_0.10.0_amd64.deb +chronograf_deb_url: 'https://s3.amazonaws.com/get.influxdb.org/chronograf/{{ chronograf_deb_file }}' + +chronograf_enabled: True diff --git a/tick/chronograf/tasks/main.yml b/tick/chronograf/tasks/main.yml new file mode 100644 index 00000000..8e1f8689 --- /dev/null +++ b/tick/chronograf/tasks/main.yml @@ -0,0 +1,14 @@ +--- +- name: Download the chronograf deb file + get_url: url={{ chronograf_deb_url }} dest=/srv/{{ chronograf_deb_file }} + tags: [ 'influxdata', 'chronograf', 'tick' ] + +- name: Install the chronograf package + apt: deb=/srv/{{ chronograf_deb_file }} + tags: [ 'influxdata', 'chronograf', 'tick' ] + +- name: Ensure that chronograf is enabled and running + service: name=chronograf state=started enabled=yes + when: chronograf_enabled + tags: [ 'influxdata', 'chronograf', 'tick' ] + diff --git a/tick/influxdb/defaults/main.yml b/tick/influxdb/defaults/main.yml new file mode 100644 index 00000000..6bf60375 --- /dev/null +++ b/tick/influxdb/defaults/main.yml @@ -0,0 +1,7 @@ +--- +influxdb_repo_key: https://repos.influxdata.com/influxdb.key +influxdb_repo: 'deb https://repos.influxdata.com/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} stable' +influxdb_packages: + - influxdb + +influxdb_enabled: True diff --git a/tick/influxdb/tasks/main.yml b/tick/influxdb/tasks/main.yml new file mode 100644 index 00000000..155b6e91 --- /dev/null +++ b/tick/influxdb/tasks/main.yml @@ -0,0 +1,19 @@ +--- +- name: Install the influxdb repo key + apt_key: url={{ influxdb_repo_key }} state=present + tags: [ 'influxdata', 'influxdb', 'tick' ] + +- name: Install the influxdb deb repository + apt_repository: repo='{{ influxdb_repo }}' state=present update_cache=yes + tags: [ 'influxdata', 'influxdb', 'tick' ] + +- name: Install the influxdb deb packages + apt: name='{{ item }}' state=present + with_items: '{{ influxdb_packages }}' + tags: [ 'influxdata', 'influxdb', 'tick' ] + +- name: Ensure that influxdb is enabled and running + service: name=influxdb state=started enabled=yes + when: influxdb_enabled + tags: [ 'influxdata', 'influxdb', 'tick' ] + diff --git a/tick/telegraf/defaults/main.yml b/tick/telegraf/defaults/main.yml new file mode 100644 index 00000000..d986fd8a --- /dev/null +++ b/tick/telegraf/defaults/main.yml @@ -0,0 +1,5 @@ +--- +telegraf_deb_file: telegraf_0.10.2-1_amd64.deb +telegraf_deb_url: 'http://get.influxdb.org/telegraf/{{ telegraf_deb_file }}' + +telegraf_enabled: True diff --git a/tick/telegraf/tasks/main.yml b/tick/telegraf/tasks/main.yml new file mode 100644 index 00000000..68e47b64 --- /dev/null +++ b/tick/telegraf/tasks/main.yml @@ -0,0 +1,14 @@ +--- +- name: Download the telegraf deb file + get_url: url={{ telegraf_deb_url }} dest=/srv/{{ telegraf_deb_file }} + tags: [ 'influxdata', 'telegraf', 'tick' ] + +- name: Install the telegraf package + apt: deb=/srv/{{ telegraf_deb_file }} + tags: [ 'influxdata', 'telegraf', 'tick' ] + +- name: Ensure that telegraf is enabled and running + service: name=telegraf state=started enabled=yes + when: telegraf_enabled + tags: [ 'influxdata', 'telegraf', 'tick' ] +