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

Changing destination file user and group is not working #1570

Closed
voanhduy1512 opened this issue Apr 9, 2022 · 3 comments · Fixed by #1571
Closed

Changing destination file user and group is not working #1570

voanhduy1512 opened this issue Apr 9, 2022 · 3 comments · Fixed by #1571
Labels
Milestone

Comments

@voanhduy1512
Copy link
Contributor

Sorry to report issue against unreleased version, but I have been waiting for this feature for a long time. Currently I am using some complex systemd service + bash script that I hope I can remove if this feature works properly in consul-template

Consul Template version

Dev build at 0012f40

Configuration

key.tmpl

{{ with secret "pki/issue/example-dot-com" "common_name=test.example.com" "alt_names=localhost" "ip_sans=127.0.0.1" "ttl=7d" }}
{{ .Data.private_key }}
{{ end }}

cert.tmpl

{{ with secret "pki/issue/example-dot-com" "common_name=test.example.com" "alt_names=localhost" "ip_sans=127.0.0.1" "ttl=7d" }}
{{ .Data.certificate }}
{{ end }}

config.hcl

vault {
  address = "http://127.0.0.1:8200"
  renew_token = false
  ssl {
     enabled = false
   }
 }
template {
  user = "myusername"
  group = "users"
  source = "key.tmpl"
  destination = "key.pem"
}
template {
  user = "myusername"
  group = "users"
  source = "cert.tmpl"
  destination = "cert.pem"
}

Command

consul-template -config config.hcl

Expected behavior

key.pem and cert.pem should be created with correct user myusername and group users

Actual behavior

The files are created with same user and group of the account running consul-template.

I thought it could be a permission issue so I tried running it with:

but the problem still happened.

@igor-nikiforov
Copy link

igor-nikiforov commented Apr 9, 2022

I have exactly the same case and can confirm that user and group does not work as expected with this scenario.

@eikenb
Copy link
Contributor

eikenb commented Apr 11, 2022

Hey @voanhduy1512, thanks for filing this (and the related PR/fix).

Is including this in 0.29.0 enough or will anyone need a 0.28.2 bugfix release with this?

@voanhduy1512
Copy link
Contributor Author

Thanks for checking, including this in 0.29.0 is enough for me, I don't need a bugfix release for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants