Skip to content

Commit

Permalink
Merge pull request dj-wasabi#25 from tszym/rpm-repo
Browse files Browse the repository at this point in the history
Use yum repository to install telegraf on RedHat
  • Loading branch information
Werner Dijkerman authored Feb 22, 2017
2 parents 6f7472b + b60f95f commit ca2e870
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ Role Variables
The following parameters can be set for the Telegraf agent:

* `telegraf_agent_version`: The version of Telegraf to install. Default: `1.0.0`
* `telegraf_agent_rpm_url`: The full path to the RPM file located on a webserver.
* `telegraf_agent_deb_url`: The full path to the DEB file located on a webserver.
* `telegraf_agent_interval`: The interval configured for sending data to the server. Default: `10`
* `telegraf_agent_debug`: Run Telegraf in debug mode. Default: `False`
* `telegraf_agent_round_interval`: Rounds collection interval to 'interval' Default: True
Expand Down Expand Up @@ -81,7 +79,7 @@ With the property `telegraf_plugins_default` it is set to use the default set of
- plugin: swap
- plugin: netstat

Every telegraf agent has these as an default configuration.
Every telegraf agent has these as a default configuration.

The 2nd parameter `telegraf_plugins_extra` can be used to add plugins specific to the servers goal. Following is an example for using this parameter for MySQL database servers:

Expand Down
5 changes: 0 additions & 5 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#telegraf_agent_version: 0.10.1
telegraf_agent_version: 1.0.0
telegraf_agent_hostname: "{{ ansible_fqdn }}"
telegraf_agent_version_sub_l: _beta2
telegraf_agent_version_sub_u: -beta2
telegraf_agent_interval: 10
telegraf_agent_debug: False
telegraf_agent_round_interval: True
Expand All @@ -22,9 +20,6 @@ telegraf_agent_quiet: False
telegraf_agent_logfile: ""
telegraf_agent_omit_hostname: False

telegraf_agent_rpm_url: https://dl.influxdata.com/telegraf/releases/telegraf-{{ telegraf_agent_version }}{{ telegraf_agent_version_sub_l }}.x86_64.rpm
telegraf_agent_deb_url: https://dl.influxdata.com/telegraf/releases/telegraf_{{ telegraf_agent_version }}{{ telegraf_agent_version_sub_u }}_amd64.deb

telegraf_agent_tags:

telegraf_agent_output:
Expand Down
14 changes: 8 additions & 6 deletions tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@
- pyopenssl
- ndg-httpsclient

- name: "Fetch telegraf installation package | RedHat"
action: get_url
url="{{ telegraf_agent_rpm_url }}"
dest=/tmp/telegraf_{{ telegraf_agent_version }}.x86_64.rpm
mode=0440
- name: "Add yum repository | RedHat"
yum_repository:
name: influxdb
description: InfluxDB Repository - RHEL $releasever
baseurl: https://repos.influxdata.com/rhel/$releasever/$basearch/stable
gpgcheck: yes
gpgkey: https://repos.influxdata.com/influxdb.key

- name: "Install telegraf package | RedHat"
action: yum
name=/tmp/telegraf_{{ telegraf_agent_version }}.x86_64.rpm
name="telegraf-{{ telegraf_agent_version }}"
state=installed
notify: "Restart Telegraf"

0 comments on commit ca2e870

Please sign in to comment.