ansible-datadog icon indicating copy to clipboard operation
ansible-datadog copied to clipboard

datadog_user on linux does not seem to allow changing the user datadog is running as

Open mriddell-foundry opened this issue 2 years ago • 1 comments

Hello,

I am trying to change the datadog_user variable to run datadog as a differing user. However when setting the "datadog_user" option in the variables section of my ansible task ike so:

name: Install datadog become: yes import_role: name: datadog.datadog vars: datadog_user: root

it does not appear to set the systemd files to run as the root user. However if I add an option like datadog_additional_groups it will add the associated groups to the root user making it seem like it does correctly get set.

mriddell-foundry avatar Sep 21 '22 18:09 mriddell-foundry

Hi :wave: we don't really support running the Agent as other user than dd-agent. We have this value defined in datadog_user variable to not have it hardcoded in multiple places, but changing the value will not work (which is why it's not documented in the README).

Running the Agent as root is strongly discouraged. Is there a specific reason why you need to do that? In terms of "fixing" this issue, I guess for now we could just create a task that will check that datadog_user is dd-agent and fail if it is not, explaining the reason.

bkabrda avatar May 16 '23 09:05 bkabrda