diff --git a/group_vars/README.md b/group_vars/README.md index 9a9e653..2ab491c 100644 --- a/group_vars/README.md +++ b/group_vars/README.md @@ -716,82 +716,6 @@ Used by [ansible.posix.authorized_keys](https://docs.ansible.com/ansible/latest/collections/ansible/posix/authorized_key_module.html) module. -## telegraf_influxdb_database - -Name of the InfluxDB database used by telegraf to send metrics. - -```yaml -telegraf_influxdb_database: metrics -``` - -## telegraf_influxdb_password - -Password of the InfluxDB user used by telegraf to send metrics. - -```yaml -telegraf_influxdb_password: *** -``` - -## telegraf_influxdb_urls - -List of InfluxDB endpoints used by telegraf to send metrics. - -```yaml -telegraf_influxdb_urls: - - https://192.168.0.1:8088 -``` - -## telegraf_influxdb_username - -Name of the InfluxDB user used by telegraf to send metrics. - -```yaml -telegraf_influxdb_username: telegraf -``` - -## telegraf_mqtt_consumer_password - -Password used to authenticate to the MQTT broker for telegraf. - -```yaml -telegraf_mqtt_consumer_password: *** -``` - -## telegraf_mqtt_consumer_servers - -List of MQTT brokers for telegraf. - -```yaml -telegraf_mqtt_consumer_servers: - - tcp://localhost:1883 -``` - -## telegraf_mqtt_consumer_topics - -List of MQTT topics to consume for telegraf. - -```yaml -telegraf_mqtt_consumer_topics: - - sensors/humidity - - sensors/temperature -``` - -## telegraf_mqtt_consumer_username - -Name used to authenticate to the MQTT broker for telegraf. - -```yaml -telegraf_mqtt_consumer_username: telegraf -``` - -## telegraf_ping_ip - -IP address of the host to ping for latency metrics. - -```yaml -telegraf_ping_ip: 192.168.0.1 -``` - ## timezone Alias of the time zone. diff --git a/main.yml b/main.yml index e202e8d..a8f5b15 100644 --- a/main.yml +++ b/main.yml @@ -45,9 +45,6 @@ - name: Configure serial2mqtt ansible.builtin.include_tasks: tasks/serial2mqtt.yml - - name: Configure telegraf - ansible.builtin.include_tasks: tasks/telegraf.yml - - name: Configure vim ansible.builtin.include_tasks: tasks/vim.yml diff --git a/tasks/telegraf.yml b/tasks/telegraf.yml deleted file mode 100644 index 842258c..0000000 --- a/tasks/telegraf.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -- name: Configure telegraf repository - ansible.builtin.template: - src: telegraf/influxdata.list.j2 - dest: /etc/apt/sources.list.d/influxdata.list - mode: '0644' - -- name: Download influxdata APT key - ansible.builtin.apt_key: - url: https://repos.influxdata.com/influxdata-archive_compat.key - state: present - -- name: Install telegraf and dependencies - ansible.builtin.apt: - name: - - telegraf - - lm-sensors - update_cache: true - -- name: Generate telegraf configurations - ansible.builtin.template: - src: "telegraf/{{ item }}.conf.j2" - dest: "/etc/telegraf/telegraf.d/{{ item }}.conf" - mode: '0640' - owner: root - group: telegraf - loop: - - inputs - - output - -- name: Restart telegraf service - ansible.builtin.service: - name: telegraf - state: restarted diff --git a/templates/telegraf/influxdata.list.j2 b/templates/telegraf/influxdata.list.j2 deleted file mode 100644 index 0ed418c..0000000 --- a/templates/telegraf/influxdata.list.j2 +++ /dev/null @@ -1,2 +0,0 @@ -{{ ansible_managed | comment }} -deb https://repos.influxdata.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable diff --git a/templates/telegraf/inputs.conf.j2 b/templates/telegraf/inputs.conf.j2 deleted file mode 100644 index c7d6412..0000000 --- a/templates/telegraf/inputs.conf.j2 +++ /dev/null @@ -1,39 +0,0 @@ -{{ ansible_managed | comment }} - -[[inputs.cpu]] - percpu = false - totalcpu = true - collect_cpu_time = false - report_active = false - -[[inputs.disk]] - mount_points = ["/", "/boot"] - -[[inputs.diskio]] - devices = ["mmcblk0"] - -[[inputs.kernel]] -[[inputs.mem]] -[[inputs.processes]] -[[inputs.swap]] -[[inputs.system]] -[[inputs.net]] - interfaces = ["eth0", "tun0"] - -[[inputs.sensors]] - -[[inputs.ping]] - urls = ["{{ telegraf_ping_ip }}"] - count = 3 - ping_interval = 1.0 - timeout = 1.0 - -[[inputs.mqtt_consumer]] - servers = {{ telegraf_mqtt_consumer_servers }} - topics = {{ telegraf_mqtt_consumer_topics }} - persistent_session = true - client_id = "telegraf" - data_format = "value" - data_type = "float" - username = "{{ telegraf_mqtt_consumer_username }}" - password = "{{ telegraf_mqtt_consumer_password }}" diff --git a/templates/telegraf/output.conf.j2 b/templates/telegraf/output.conf.j2 deleted file mode 100644 index 8d09636..0000000 --- a/templates/telegraf/output.conf.j2 +++ /dev/null @@ -1,10 +0,0 @@ -{{ ansible_managed | comment }} - -[[outputs.influxdb]] - urls = {{ telegraf_influxdb_urls }} - database = "{{ telegraf_influxdb_database }}" - skip_database_creation = true - username = "{{ telegraf_influxdb_username }}" - password = "{{ telegraf_influxdb_password }}" - insecure_skip_verify = true - content_encoding = "gzip"