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

template/file 'verify' provides no way to see materialized content #8249

Open
jaymzh opened this Issue Feb 23, 2019 · 1 comment

Comments

Projects
None yet
1 participant
@jaymzh
Copy link
Member

jaymzh commented Feb 23, 2019

Description

If I use verify on a template, and the verification fails, let's say:

template '/etc/nginx.conf' do
  ...
  verify 'nginx -c %{path} -t'
end

And the verification fails, Chef will bail out and tell me the verification fails, but it does not leave the materialized template anywhere for me to see what was wrong. The only solution is to then change that code to something like:

template '/tmp/nginx.conf' do
  ...
end

template '/etc/nginx.conf' do
  ...
  verify 'nginx -c %{path} -t'
end

So that I can inspect /tmp/nginx.conf and see what went wrong.

Chef Version

13.10, but I think this is still the case in 14/15

Platform Version

RHEL7

@jaymzh

This comment has been minimized.

Copy link
Member Author

jaymzh commented Feb 23, 2019

It seems to me like we can do 1 of 2 things:

  1. put this in a predictable place (maybe /var/chef/cache/failed_verifies/path/file) which always overwrites it self so we don't litter these forever
  2. Treat them just like backups, with a timestamp (/var/chef/cache/failed_verifies/path/file-timestamp) and keep a certain number.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.