telgraf: Fix config folder permissions
With the recent update to telegraf's container image it now runs under its own user and thus we need to change the permissions to make the config file accessible for the new user. See https://github.com/influxdata/influxdata-docker/pull/536
This commit is contained in:
parent
4d1bb93d2a
commit
a178af1735
2 changed files with 12 additions and 5 deletions
|
@ -27,8 +27,15 @@ telegraf_config_location: "{{ telegraf_install_location }}/conf"
|
||||||
telegraf_version: "1.20.3"
|
telegraf_version: "1.20.3"
|
||||||
# renovate: depName=quay.io/sheogorath/docker-socket-proxy
|
# renovate: depName=quay.io/sheogorath/docker-socket-proxy
|
||||||
telegraf_dockersocketproxy_version: "2.3"
|
telegraf_dockersocketproxy_version: "2.3"
|
||||||
|
# Changing this image may also require changing the UID / GID below,
|
||||||
|
# to set the correct permissions
|
||||||
telegraf_image_version: "{{ telegraf_version }}-alpine"
|
telegraf_image_version: "{{ telegraf_version }}-alpine"
|
||||||
|
|
||||||
|
# Telegraf config user & group id
|
||||||
|
# This is used for the config folder that is mounted to the container
|
||||||
|
telegraf_config_uid: 100
|
||||||
|
telegraf_config_gid: 101
|
||||||
|
|
||||||
# The influxdb endpoints, telegraf should send data to
|
# The influxdb endpoints, telegraf should send data to
|
||||||
telegraf_influxdb_endpoints:
|
telegraf_influxdb_endpoints:
|
||||||
- influxdb.example.com
|
- influxdb.example.com
|
||||||
|
|
|
@ -41,8 +41,8 @@
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
mode: '0700'
|
mode: '0700'
|
||||||
owner: 'root'
|
owner: "{{ telegraf_config_uid }}"
|
||||||
group: 'root'
|
group: "{{ telegraf_config_gid }}"
|
||||||
state: directory
|
state: directory
|
||||||
setype: "container_file_t"
|
setype: "container_file_t"
|
||||||
with_items:
|
with_items:
|
||||||
|
@ -63,9 +63,9 @@
|
||||||
template:
|
template:
|
||||||
src: "telegraf.conf"
|
src: "telegraf.conf"
|
||||||
dest: "{{ telegraf_config_location }}/telegraf.conf"
|
dest: "{{ telegraf_config_location }}/telegraf.conf"
|
||||||
mode: '0644'
|
mode: '0600'
|
||||||
owner: 'root'
|
owner: "{{ telegraf_config_uid }}"
|
||||||
group: 'root'
|
group: "{{ telegraf_config_gid }}"
|
||||||
notify: "Restart telegraf"
|
notify: "Restart telegraf"
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue