{"action":"closed","issue":{"url":"https://api.github.com/repos/mitchellh/packer/issues/3151","repository_url":"https://api.github.com/repos/mitchellh/packer","labels_url":"https://api.github.com/repos/mitchellh/packer/issues/3151/labels{/name}","comments_url":"https://api.github.com/repos/mitchellh/packer/issues/3151/comments","events_url":"https://api.github.com/repos/mitchellh/packer/issues/3151/events","html_url":"https://github.com/mitchellh/packer/issues/3151","id":131693137,"number":3151,"title":"Add `skip_clean_staging_dir` option for chef-client provisioner","user":{"login":"icberg7","id":5083037,"avatar_url":"https://avatars.githubusercontent.com/u/5083037?v=3","gravatar_id":"","url":"https://api.github.com/users/icberg7","html_url":"https://github.com/icberg7","followers_url":"https://api.github.com/users/icberg7/followers","following_url":"https://api.github.com/users/icberg7/following{/other_user}","gists_url":"https://api.github.com/users/icberg7/gists{/gist_id}","starred_url":"https://api.github.com/users/icberg7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icberg7/subscriptions","organizations_url":"https://api.github.com/users/icberg7/orgs","repos_url":"https://api.github.com/users/icberg7/repos","events_url":"https://api.github.com/users/icberg7/events{/privacy}","received_events_url":"https://api.github.com/users/icberg7/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mitchellh/packer/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/mitchellh/packer/labels/provisioner/chef","name":"provisioner/chef","color":"bfd4f2"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-05T16:52:22Z","updated_at":"2016-02-05T18:01:18Z","closed_at":"2016-02-05T18:01:18Z","body":"Hi there,\r\nI've recently discovered that packer deletes the [`staging_directory`](https://www.packer.io/docs/provisioners/chef-client.html#staging_directory) after provisioning is complete, even with `skip_clean_client` and `skip_clean_node` set. I found #2738 and understand this is by design, but it would be nice to have an option to prevent the work directory cleanup.\r\n\r\nThis would be very useful with troubleshooting template issues alongside the null builder. Also, I'm working on a packer template for a workstation virtual machine, and it would be nice if these files were retainable so that the end user could run `chef-client` in local mode at some point later against a newer version of the cookbook (or in case they did something to inadvertently break something)."}}