Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting user/group ownership of template output #1497

Closed
drawks opened this issue Aug 3, 2021 · 5 comments
Closed

Allow setting user/group ownership of template output #1497

drawks opened this issue Aug 3, 2021 · 5 comments
Labels
enhancement nomad Related to ingetration in Nomad
Milestone

Comments

@drawks
Copy link

drawks commented Aug 3, 2021

As asked for in #639 it would great if we could define the user/group ownership of output files. Previously it has been stated that a solution that is completely platform independent would be welcome, however since that comment was made #1185 was merged which preserves user/group only on "unix OSs." It seems like perhaps there is some flexibility on the need for all features to be fully platform independent and if that is the case I'd argue that being able to set owner/group/mode (perhaps even extended attributes and se contexts) on supported platforms would make this tool much more powerful.

@deblasis
Copy link
Contributor

deblasis commented Nov 3, 2021

Hi there, I came here after some triaging on hashicorp/nomad#5020 which seems to be related.

I agree that being able to set the ownership of the rendered templates can be powerful and sometimes a must-have.
I was wondering, wouldn't a template.Exec with a chown command be enough in order to achieve this?

deblasis added a commit to deblasis/consul-template that referenced this issue Nov 3, 2021
Related issues hashicorp#639, hashicorp#1497, hashicorp#1185 and also nomad/5020

Signed-off-by: Alessandro De Blasis <[email protected]>
@deblasis
Copy link
Contributor

deblasis commented Nov 3, 2021

I wanted to be my own devil's advocate so I have also PRd #1531, looking forward to hearing back from you guys!

Cheers

@eikenb
Copy link
Contributor

eikenb commented Nov 4, 2021

I was wondering, wouldn't a template.Exec with a chown command be enough in order to achieve this?

If the consul-template process is run with permissions to do this, then yes that could work. All commands are run with the permissions of the process (and their user/group owner).

I Read through hashicorp/nomad#5020 and as Nomad doesn't support the Exec (and I don't think they'd want to) it is of no help there. On the other hand, your PR would address their case nicely and I'll take some time to review it.

@deblasis
Copy link
Contributor

deblasis commented Nov 5, 2021

Awesome! Thank you @eikenb!

@eikenb
Copy link
Contributor

eikenb commented Mar 3, 2022

Fixed by #1531

@eikenb eikenb closed this as completed Mar 3, 2022
@eikenb eikenb added this to the v0.28.0 milestone Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement nomad Related to ingetration in Nomad
Projects
None yet
Development

No branches or pull requests

3 participants