No Description
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 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. # TODO can no longer run this!
  16. #- name: Install InfluxDB and Telegraf from official repository
  17. # apt:
  18. # name: "{{ packages }}"
  19. # state: present
  20. # update_cache: yes
  21. # vars:
  22. # packages:
  23. # - influxdb
  24. # - telegraf
  25. # tags:
  26. # - dependencies
  27. #
  28. #- name: Configure InfluxDB
  29. # template:
  30. # src=etc_influxdb_influxdb.j2
  31. # dest=/etc/influxdb/influxdb.conf
  32. # owner=root
  33. # group=root
  34. # notify: restart influxdb
  35. - name: Create InfluxDB data directories
  36. file: state=directory path={{ item }} owner=influxdb group=influxdb
  37. with_items:
  38. - /data/influxdb
  39. - /data/influxdb/meta
  40. - /data/influxdb/data
  41. - /data/influxdb/wal
  42. - name: Configure Telegraf
  43. template:
  44. src=etc_telegraf_telegraf.j2
  45. dest=/etc/telegraf/telegraf.conf
  46. owner=root
  47. group=root
  48. notify: restart telegraf
  49. - name: Set firewall rules for InfluxDB
  50. ufw: rule=allow port={{ item }} proto=tcp
  51. with_items:
  52. - 8086 # http
  53. - 8088 # rpc
  54. tags: ufw
  55. # TODO influxdb should get following set in
  56. # /etc/systemd/system/influxdb.service.d/override.conf
  57. #
  58. # [Service]
  59. # TimeoutStartSec=60m
  60. - name: Register new InfluxDB and Telegraf service
  61. systemd: name={{ item }} daemon_reload=yes enabled=yes
  62. with_items:
  63. - influxdb
  64. - telegraf
  65. - name: Start new InfluxDB and Telegraf instance
  66. service: name={{ item }} state=started
  67. with_items:
  68. - influxdb
  69. - telegraf