Just-Insane / just-insane.github.io

1 stars 0 forks source link

blog/configuration%20management/ansible-part-2-installing-telegraf/ #3

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Ansible Part 2: Installing Telegraf - Homelab.blog

In part two of this series, we will look at creating a playbook to deploy and configure Telegraf, the popular devops service for getting your system’s metrics into a time series database, for use with tools like Grafana.

https://homelab.blog/blog/configuration%20management/ansible-part-2-installing-telegraf/

matsonkepson commented 3 years ago

Thanks for the post. Your script helped me a bit but I had to modify it

maybe someone will also benefit form it

---
- name: Add telegraf repository
  yum_repository:
    name: influxdb
    description: InfluxDB Repository - RHEL \$releasever
    baseurl: https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
    gpgcheck: yes
    enabled: yes
    gpgkey: https://repos.influxdata.com/influxdb.key

- name: Install telegraf
  yum:
    name: telegraf
    state: latest

- name: Copy telegraf config
  copy:
    src: ./files/telegraf.conf
    dest: /etc/telegraf/telegraf.conf
    owner: root
    group: root
    mode: 0644
    backup: yes
    # force: no

- name: Restart and enable the telegraf daemon
  service: name=telegraf state=restarted enabled=yes