chef / chef-apply

The ad-hoc execution tool for the Chef ecosystem.
https://www.chef.sh/
Apache License 2.0
14 stars 14 forks source link

No way to get output from chef-run on target? #194

Open Ryuzavi opened 6 years ago

Ryuzavi commented 6 years ago

Hey

Just found out about Workstation and chef-run and liking the direction of this a lot! Had a quick playaround with chef-run and can tell that it's going to be quite useful in the future.

I was wondering though if there was a way or any plans to allow users to see the output from the target. For example if I run the below I don't get output from the machine itself:

chef-run test-machine execute hostname live_stream=true
 [✔] Generated local policyfile
 [✔] [qa-lb-test] Connected.
 [✔] [qa-lb-test] Chef client version 14.2.0 already installed on target.
 [✔] [qa-lb-test] Successfully converged target!

We need this for debugging. If it could be added that'd be really awesome!

Cheers, R.

cheeseplus commented 6 years ago

Two parts here:

That said, in the case of a success, what is it that you feel is needed to be exposed or need from the logs in these cases?

Ryuzavi commented 6 years ago

Yeah I can understand where you're coming from.

For our use case(s), we could use this in a CI environment like Teamcity and we like to have full output of the actions to debug later in case of issues that didn't result in outright failures and the like. Additionally so we can see where the process currently is.

Ryuzavi commented 5 years ago

Hey. I noticed in the GA announcement that ChefDK will no longer be getting major updates. Is the position still no output when running against a single target (optional or otherwise)?

I appreciate output with multiple hosts would not be possible but would love single target live logging so our CI can capture the processes output.

cheeseplus commented 5 years ago

The announcement and whether or not we expose logs are unrelated. The issue is still open and being tracked, it's something we want to think carefully about as one of our primary goals is ease of use, not necessarily for the power user.

Ryuzavi commented 5 years ago

Ok thanks very much

nicutor commented 5 years ago

+1 to log somewhere on target machine the output of chef-client.

nicutor commented 5 years ago

Can I suggest to add on config.toml at [chef] section the log path variable like this:

log_location = '/path/to/log/file'

so chef-run will add this on his own chef client workstation.rb file? In this way we can have a log of chef-client on remote target if we need to debug it.

tyler-ball commented 5 years ago

Thanks for the comments on this thread. This is definitely an issue we want to address. We want to allow users to copy across the remote chef-client log in both successful and error scenarios. We could also copy the output from the chef-client run in both cases too - there can be useful information there.

We want to address this as a full feature. We'll look into the UX of how we handle this but I think something like copying it to a local log file with configuration like @nicutor suggests will work well.

cnunciato commented 4 years ago

Tried chef-workstation recently and had a great experience -- nice work on this! But I have to admit, I also found myself wishing for that chef-client output. I missed it. 😄