Skip to content

Commit

Permalink
Merge pull request #4 from thane42/docker
Browse files Browse the repository at this point in the history
Docker
  • Loading branch information
egmont1227 authored Apr 9, 2024
2 parents 56eff05 + 243c4cd commit 2780fef
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ These properties set in how and what package will be installed.
* `telegraf_agent_docker_network_mode`: Networking mode of the docker container. Default: `bridge`
* `telegraf_agent_docker_restart_policy`: Docker container restart policy. Default: `unless-stopped`
* `telegraf_agent_docker_image_version`: The version of the Docker Telegraf image to be used. Default the value contains the value given for `telegraf_agent_version`. Can be set to `latest` to get the actual `latest` tag for the provided Docker image.
* `telegraf_uid_docker`: Override user id. Default: `995`
* `telegraf_gid_docker`: Override group id. Default: `998`
* `telegraf_agent_docker_registry`: Define a custom docker registry. Default: `""`
* `telegraf_agent_docker_network`: attach to custom docker network. Default: `bridge`

Expand Down
4 changes: 1 addition & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
telegraf_enabled: True
# defaults file for ansible-telegraf

telegraf_agent_version: 1.18.2
telegraf_agent_version: 1.26.0
telegraf_agent_version_patch: 1
telegraf_agent_package: telegraf
telegraf_agent_package_file_deb: telegraf_{{ telegraf_agent_version }}-{{ telegraf_agent_version_patch }}_{{ telegraf_agent_package_arch }}.deb
Expand All @@ -22,8 +22,6 @@ telegraf_agent_config_path: /etc/telegraf
telegraf_win_logfile_rotation_max_archives: 3

# Docker specific settings
telegraf_uid_docker: 998
telegraf_gid_docker: 995
telegraf_agent_docker: False
telegraf_agent_docker_name: telegraf
telegraf_agent_docker_network_mode: bridge
Expand Down
5 changes: 1 addition & 4 deletions tasks/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
group:
name: telegraf
state: present
gid: "{{ telegraf_gid_docker }}"

- name: Adding Telegraf user
user:
name: telegraf
group: telegraf
state: present
create_home: False
home: "{{ telegraf_agent_config_path }}"
uid: "{{ telegraf_uid_docker }}"
system: True
become: yes

Expand All @@ -37,7 +34,7 @@

- name: Ensure Telegraf Docker container is running
docker_container:
user: "{{ telegraf_uid_docker }}:{{ telegraf_gid_docker }}"
user: "telegraf:telegraf"
name: "{{ telegraf_agent_docker_name }}"
image: "{{ telegraf_agent_docker_registry }}telegraf:{{ telegraf_agent_docker_image_version }}"
state: started
Expand Down

0 comments on commit 2780fef

Please sign in to comment.