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

chef-run doesn't install chef-client & run the specified resource/recipe in the same run. #76

Open
ericcalabretta opened this issue Jan 25, 2019 · 7 comments
Labels
Aspect: Integration Works correctly with other projects or systems. Platform: Windows Triage: Confirmed Indicates and issue has been confirmed as described. Type: Bug Does not work as expected.

Comments

@ericcalabretta
Copy link

ericcalabretta commented Jan 25, 2019

Description

When initially using chef-run to install chef-client & run a resource or recipe only chef-client is installed. The resource or recipe is not ran.

chef-run appears to work, but "test.txt" is not created:

chef-run winrm://35.166.186.157 --user administrator --password 1234567 file 'C:\test.txt'
[✔] Packaging cookbook... done!
[✔] Generating local policyfile... exporting... done!
[✔] Applying file[C:\test.txt] from resource to target.
└── [✔] [35.166.186.157] Successfully converged file[C:\test.txt].

If I log into the system the file is not there, and InSpec also shows no file:

inspec exec -t winrm://35.166.186.157 --user administrator --password 1234567 win_test.rb

Profile: tests from win_test.rb (tests from win_test.rb)
Version: (not specified)
Target:  winrm://administrator@http://35.166.186.157:5985/wsman:3389

  File c:\test.txt
     ×  should exist
     expected File c:\test.txt to exist

Test Summary: 0 successful, 1 failures, 0 skipped

If I execute the same chef-run command again, the file is successfully created on the second attempt.

chef-run winrm://35.166.186.157 --user administrator --password 1234567 file 'C:\test.txt'
[✔] Packaging cookbook... done!
[✔] Generating local policyfile... exporting... done!
[✔] Applying file[C:\test.txt] from resource to target.
└── [✔] [35.166.186.157] Successfully converged file[C:\test.txt].

inspec exec -t winrm://35.166.186.157 --user administrator --password 1234567 win_test.rb

 File c:\test.txt
     ✔  should exist

Test Summary: 1 successful, 0 failures, 0 skipped

The same behavior happens for both individual resources and recipes. I have not attempted using a cookbook.

Chef Workstation Version

chef-run: 0.2.4

Platform Version

From MacOS 12.14.3 to a Windows 2016 machine

@pkleanthous-zz
Copy link

pkleanthous-zz commented Apr 12, 2019

Hey guys,

Any updates on this? I can confirm that the problem still exists.

Description

when I'm running chef-run the first time it just installs the chef-client on the target system.

chef-run 'winrm://vagrant:vagrant@localhost:55985' aaa::windows_target
[✔] Packaging cookbook... done!
[✔] Generating local policyfile... exporting... done!
[✔] Applying jenkins::windows_target from /Users/whatever/aaa to target.
└── [✔] [localhost] Successfully converged aaa::windows_target.

Chef Workstation Version

chef --version
Chef Workstation: 0.2.53
chef-run: 0.2.8
chef-client: 14.10.9
delivery-cli: 0.0.52 (9d07501a3b347cc687c902319d23dc32dd5fa621)
berks: 7.0.7
test-kitchen: 1.24.0
inspec: 3.6.6

Platform Version

Running from macOS 10.14 and my target is Windows 10 Pro.

@jonsmorrow
Copy link
Contributor

@ericcalabretta and @pkleanthous Thanks for the report. This definitely isn't desired or intended behavior we'll take a look (probably after chef conf). I'm also going to mov this issue to the chef-apply repo.

@jonsmorrow jonsmorrow transferred this issue from chef/chef-workstation May 13, 2019
@ericcalabretta
Copy link
Author

@jonsmorrow chef-apply is the new repo for the "chef-run" commands? I thought chef-apply was an older unrelated function to chef-run.

@jonsmorrow
Copy link
Contributor

@ericcalabretta yes there was an rfc discussion to take over the chef-apply command space for this. I think that may be revisited, but for now the repo name was created to match that decision with the intent to change the command before 1.0. It's very confusing right now.

@ericcalabretta
Copy link
Author

Makes total sense, It'd be great to improve the UX before 1.0.

@tyler-ball tyler-ball added Aspect: Correctness Aspect: Integration Works correctly with other projects or systems. Platform: Windows Triage: Confirmed Indicates and issue has been confirmed as described. Type: Bug Does not work as expected. labels Sep 9, 2019
@grv87
Copy link

grv87 commented Nov 18, 2019

With current chef-run v0.4.6 an example from documentation:

chef-run ssh://... directory /tmp/foo --identity-file ...

works for me. The directory is created on the first run.

@ericcalabretta
Copy link
Author

@grv87 Was chef-client already installed on the box or did that same chef-run command both install the chef-client & create the directory successfully?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Aspect: Integration Works correctly with other projects or systems. Platform: Windows Triage: Confirmed Indicates and issue has been confirmed as described. Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

5 participants