Brak opisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

influx.yml 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. ---
  2. # Installs InfluxDB and Telegraf as described in:
  3. # https://docs.influxdata.com/influxdb/v1.7/introduction/installation
  4. # https://docs.influxdata.com/influxdb/v1.7/administration/config/
  5. # https://docs.influxdata.com/telegraf/v1.10/introduction/installation/
  6. # https://docs.influxdata.com/telegraf/v1.10/administration/configuration/
  7. - name: Ensure repository key for InfluxDB is in place
  8. apt_key: url=https://repos.influxdata.com/influxdb.key state=present
  9. tags:
  10. - dependencies
  11. - name: Add InfluxDB repository
  12. apt_repository: repo="deb https://repos.influxdata.com/debian {{ ansible_distribution_release }} stable"
  13. tags:
  14. - dependencies
  15. - name: Install InfluxDB and Telegraf from official repository
  16. apt:
  17. name: "{{ packages }}"
  18. state: present
  19. update_cache: yes
  20. vars:
  21. packages:
  22. - influxdb
  23. - telegraf
  24. tags:
  25. - dependencies
  26. - name: Configure InfluxDB
  27. template:
  28. src=etc_influxdb_influxdb.j2
  29. dest=/etc/influxdb/influxdb.conf
  30. owner=root
  31. group=root
  32. notify: restart influxdb
  33. - name: Create InfluxDB data directories
  34. file: state=directory path={{ item }} owner=influxdb group=influxdb
  35. with_items:
  36. - /data/influxdb
  37. - /data/influxdb/meta
  38. - /data/influxdb/data
  39. - /data/influxdb/wal
  40. - name: Configure Telegraf
  41. template:
  42. src=etc_telegraf_telegraf.j2
  43. dest=/etc/telegraf/telegraf.conf
  44. owner=root
  45. group=root
  46. notify: restart telegraf
  47. - name: Set firewall rules for InfluxDB
  48. ufw: rule=allow port={{ item }} proto=tcp
  49. with_items:
  50. - 8086 # http
  51. - 8088 # rpc
  52. tags: ufw
  53. - name: Register new InfluxDB and Telegraf service
  54. systemd: name={{ item }} daemon_reload=yes enabled=yes
  55. with_items:
  56. - influxdb
  57. - telegraf
  58. - name: Start new InfluxDB and Telegraf instance
  59. service: name={{ item }} state=started
  60. with_items:
  61. - influxdb
  62. - telegraf