Ask Your Question

How do i file_line a file as a user other then root?

asked 2017-10-16 11:01:14 -0600

I wish to add a line to a file using fileuser but root doesn't have access to it only a user does . . in exec you can use user => but not in fileline . ..

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-10-18 07:15:51 -0600

David Schmitt gravatar image

Exec forks into a separate process, so it can switch the UID, file_line processing happens in the puppet-agent process, and therefore always runs under the user the agent runs as. In a pinch, you can run the agent as non-root, but that'll require a separate certificate, certname, and catalog/classification.

It might be easier to reconsider the decision to make the file inaccessible to root in the first place?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2017-10-16 11:01:14 -0600

Seen: 26 times

Last updated: Oct 18 '17