Created
March 19, 2018 18:00
-
-
Save nathenharvey/60f028d5e85d01a459a4cc36e3c0e771 to your computer and use it in GitHub Desktop.
Sensitive property on execute resource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ chef-client -z sensitive.rb -l debug | |
[2018-03-19T13:54:21-04:00] DEBUG: Sleeping for 0 seconds | |
[2018-03-19T13:54:21-04:00] INFO: Started chef-zero at chefzero://localhost:1 with repository at /Users/nathenharvey | |
One version per cookbook | |
[2018-03-19T13:54:21-04:00] DEBUG: Running Ohai with the following configuration: {} | |
[2018-03-19T13:54:21-04:00] INFO: Forking chef instance to converge... | |
[2018-03-19T13:54:21-04:00] DEBUG: Fork successful. Waiting for new chef pid: 15310 | |
[2018-03-19T13:54:21-04:00] DEBUG: Forked instance now converging | |
Starting Chef Client, version 13.6.4^[[0m | |
[2018-03-19T13:54:21-04:00] INFO: *** Chef 13.6.4 *** | |
[2018-03-19T13:54:21-04:00] INFO: Platform: x86_64-darwin14 | |
[2018-03-19T13:54:21-04:00] INFO: Chef-client pid: 15310 | |
[2018-03-19T13:54:21-04:00] DEBUG: Chef-client request_id: c1303f14-ddf0-4e26-aede-b4f5aadada79 | |
... | |
>>>> Caused by Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '127' | |
---- Begin output of echi 'secret goodbye' ---- | |
STDOUT: | |
STDERR: sh: echi: command not found | |
---- End output of echi 'secret goodbye' ---- | |
Ran echi 'secret goodbye' returned 127 | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ chef-client -z sensitive.rb | |
[2018-03-19T13:56:09-04:00] INFO: Started chef-zero at chefzero://localhost:1 with repository at /Users/nathenharvey | |
One version per cookbook | |
[2018-03-19T13:56:09-04:00] INFO: Forking chef instance to converge... | |
Starting Chef Client, version 13.6.4[0m | |
[2018-03-19T13:56:10-04:00] INFO: *** Chef 13.6.4 *** | |
[2018-03-19T13:56:10-04:00] INFO: Platform: x86_64-darwin14 | |
[2018-03-19T13:56:10-04:00] INFO: Chef-client pid: 15440 | |
[2018-03-19T13:56:10-04:00] INFO: The plugin path /etc/chef/ohai/plugins does not exist. Skipping... | |
[2018-03-19T13:56:49-04:00] INFO: Run List is [] | |
[2018-03-19T13:56:49-04:00] INFO: Run List expands to [] | |
[2018-03-19T13:56:49-04:00] INFO: Starting Chef Run for nathenharvey | |
[2018-03-19T13:56:49-04:00] INFO: Running start handlers | |
[2018-03-19T13:56:49-04:00] INFO: Start handlers complete. | |
resolving cookbooks for run list: [][0m | |
[2018-03-19T13:56:49-04:00] INFO: Loading cookbooks [] | |
Synchronizing Cookbooks:[0m | |
Installing Cookbook Gems:[0m | |
Compiling Cookbooks...[0m | |
[2018-03-19T13:56:49-04:00] WARN: Node nathenharvey has an empty run list. | |
Converging 3 resources[0m | |
Recipe: @recipe_files::/Users/nathenharvey/tmp/sensitive.rb[0m | |
* execute[echo something sensitive] action run[2018-03-19T13:56:49-04:00] INFO: Processing execute[echo something sensitive] action run (@recipe_files::/Users/nathenharvey/tmp/sensitive.rb line 1) | |
[2018-03-19T13:56:49-04:00] INFO: execute[echo something sensitive] ran successfully | |
[32m- execute sensitive resource[0m | |
[0m * execute[echo something insensitive] action run[2018-03-19T13:56:49-04:00] INFO: Processing execute[echo something insensitive] action run (@recipe_files::/Users/nathenharvey/tmp/sensitive.rb line 6) | |
[execute] goodbye | |
[2018-03-19T13:56:49-04:00] INFO: execute[echo something insensitive] ran successfully | |
[32m- execute echo 'goodbye'[0m | |
[0m * execute[echo something sensitive and fail] action run[2018-03-19T13:56:49-04:00] INFO: Processing execute[echo something sensitive and fail] action run (@recipe_files::/Users/nathenharvey/tmp/sensitive.rb line 10) | |
[0m | |
================================================================================[0m | |
[31mError executing action `run` on resource 'execute[echo something sensitive and fail]'[0m | |
================================================================================[0m | |
[0m Mixlib::ShellOut::ShellCommandFailed[0m | |
------------------------------------[0m | |
Command execution failed. STDOUT/STDERR suppressed for sensitive resource[0m | |
[0m Resource Declaration:[0m | |
---------------------[0m | |
suppressed sensitive resource output[0m | |
[0m Compiled Resource:[0m | |
------------------[0m | |
suppressed sensitive resource output[0m | |
[0m System Info:[0m | |
------------[0m | |
chef_version=13.6.4 | |
[0m platform=mac_os_x | |
[0m platform_version=10.13.3 | |
[0m ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin14] | |
[0m program_name=chef-client worker: ppid=15436;start=13:56:09; | |
[0m executable=/opt/chefdk/bin/chef-client[0m | |
[0m[2018-03-19T13:56:49-04:00] INFO: Running queued delayed notifications before re-raising exception | |
[0m | |
Running handlers:[0m | |
[2018-03-19T13:56:49-04:00] ERROR: Running exception handlers | |
Running handlers complete | |
[0m[2018-03-19T13:56:49-04:00] ERROR: Exception handlers complete | |
Chef Client failed. 2 resources updated in 39 seconds[0m | |
[2018-03-19T13:56:49-04:00] FATAL: Stacktrace dumped to /Users/nathenharvey/.chef/local-mode-cache/cache/chef-stacktrace.out | |
[2018-03-19T13:56:49-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report | |
[2018-03-19T13:56:49-04:00] ERROR: execute[echo something sensitive and fail] (@recipe_files::/Users/nathenharvey/tmp/sensitive.rb line 10) had an error: Mixlib::ShellOut::ShellCommandFailed: Command execution failed. STDOUT/STDERR suppressed for sensitive resource | |
[2018-03-19T13:56:49-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execute 'echo something sensitive' do | |
command "echo 'secret goodbye'" | |
sensitive true | |
end | |
execute 'echo something insensitive' do | |
command "echo 'goodbye'" | |
end | |
execute 'echo something sensitive and fail' do | |
command "echi 'secret goodbye'" | |
sensitive true | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment