{"id":15791293,"url":"https://github.com/levonet/ansible-docker-telegraf","last_synced_at":"2026-03-18T16:44:46.626Z","repository":{"id":47192696,"uuid":"141730770","full_name":"levonet/ansible-docker-telegraf","owner":"levonet","description":"Ansible role for Configure and start Telegraf in a docker container","archived":false,"fork":false,"pushed_at":"2019-07-05T15:17:08.000Z","size":13,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-11T23:04:48.805Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/levonet/docker_telegraf","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/levonet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-20T15:49:01.000Z","updated_at":"2022-09-28T11:22:36.000Z","dependencies_parsed_at":"2022-09-03T13:23:04.557Z","dependency_job_id":null,"html_url":"https://github.com/levonet/ansible-docker-telegraf","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levonet%2Fansible-docker-telegraf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levonet%2Fansible-docker-telegraf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levonet%2Fansible-docker-telegraf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levonet%2Fansible-docker-telegraf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/levonet","download_url":"https://codeload.github.com/levonet/ansible-docker-telegraf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246523890,"owners_count":20791443,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-04T23:00:42.571Z","updated_at":"2026-01-28T00:35:12.330Z","avatar_url":"https://github.com/levonet.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"Telegraf Role\n==============\n[![Build Status](https://travis-ci.org/levonet/ansible-docker-telegraf.svg?branch=master)](https://travis-ci.org/levonet/ansible-docker-telegraf)\n\nConfigure and start Telegraf in a docker container using the official image `telegraf:alpine`. \n\nRole Variables\n--------------\n\n- `docker_telegraf_config`: Body of configuration file.\n- `docker_telegraf_name` (default: telegraf): This name used in name of home folder path and in name of container.\n- `docker_telegraf_image` (default: telegraf:alpine)\n- `docker_telegraf_periodic_restart` (default: no): Restart container at 4:15 AM everyday.\n- `docker_telegraf_periodic_restart_time_hour` (default: 4)\n- `docker_telegraf_periodic_restart_time_minute` (default: 15)\n- `docker_telegraf_directory_volumes` (optional): Mount folders into docker\n- `docker_telegraf_file_volumes` (optional): Mount files into docker\n- `docker_telegraf_ports` (optional)\n- `docker_telegraf_env` (optional)\n- `docker_telegraf_network_mode` (default: host): Connect the container to a network.\n- `docker_telegraf_networks` (default: []): List of networks the container belongs to.\n- `docker_telegraf_log_driver` (default: json-file): Specify the logging driver.\n- `docker_telegraf_log_options` (optional): Dictionary of options specific to the chosen log_driver. See [Configure logging drivers](https://docs.docker.com/engine/admin/logging/overview/) for details.\n\nDependencies\n------------\n\n- `docker`\n\nExample Playbook\n----------------\n\n```yaml\n- hosts: all\n  become: yes\n  become_method: sudo\n  vars:\n    influxdb_url: http://influxdb:8086\n  roles:\n    - role: levonet.docker_telegraf\n      docker_telegraf_file_volumes:\n        - /var/run/docker.sock:/var/run/docker.sock\n        - /var/log/messages:/mnt/messages:ro\n      docker_telegraf_config: |\n        [global_tags]\n          inventory = \"{{ inventory_hostname }}\"\n        [agent]\n          interval = \"30s\"\n          round_interval = true\n          metric_batch_size = 1000\n          metric_buffer_limit = 10000\n          collection_jitter = \"0s\"\n          flush_interval = \"10s\"\n          flush_jitter = \"0s\"\n          precision = \"\"\n          debug = false\n          quiet = false\n          logfile = \"\"\n          hostname = \"\"\n          omit_hostname = false\n        [[outputs.influxdb]]\n          urls = [\"{{ influxdb_url }}\"]\n          database = \"telegraf\"\n        [[inputs.cpu]]\n          percpu = true\n          totalcpu = true\n          collect_cpu_time = false\n          report_active = false\n        [[inputs.disk]]\n          ignore_fs = [\"tmpfs\", \"devtmpfs\", \"devfs\"]\n        [[inputs.mem]]\n        [[inputs.docker]]\n         endpoint = \"unix:///var/run/docker.sock\"\n        [[inputs.logparser]]\n         files = [\"/mnt/messages\"]\n         from_beginning = false\n         [inputs.logparser.grok]\n           patterns = [\"%{SYSLOGTIMESTAMP:timestamp} %{SYSLOGHOST:logsource:tag} %{PROG:program:tag}(?:\\\\[%{POSINT:pid:int}\\\\])?: %{GREEDYDATA:message}\"]\n           measurement = \"messages\"\n```\n\nLicense\n-------\n\n[MIT](https://opensource.org/licenses/MIT)\n\nAuthor Information\n------------------\n\nThis role was created by [Pavlo Bashynskyi](https://github.com/levonet)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevonet%2Fansible-docker-telegraf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flevonet%2Fansible-docker-telegraf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevonet%2Fansible-docker-telegraf/lists"}