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

winrm connection not available to machine_execute?? #527

Open
chazzly opened this issue Jul 5, 2016 · 0 comments
Open

winrm connection not available to machine_execute?? #527

chazzly opened this issue Jul 5, 2016 · 0 comments

Comments

@chazzly
Copy link

chazzly commented Jul 5, 2016

I've been searching through the issues / conversations for a while now, but I haven't found exactly this problem.

Error executing action run on resource 'machine_execute[mkdir c:\chef\trusted_certs]'
WinRM::WinRMAuthorizationError

I've confirmed the password being used is correct, so that's not the issue. The machine get's created just fine, so the aws connection isn't the issue. I'm running machine_execute as a work-around for #237. And if I remove the machine_execute resource and manually create the directory, then re-run chef-client, everything works beautifully.

here's my recipe:

with_driver 'aws'
with_chef_server 'https://my-chef-server',
:client_name => Chef::Config[:node_name],
:signing_key_filename => Chef::Config[:client_key]

with_machine_options(
bootstrap_options: {
[ snip.....]
user_data: <<-EOF
[snip ... powershell script which opens the firewall, turns on winrm, and sets the administrator password]
EOF
},
is_windows: true,
winrm_no_ssl_peer_verification: true,
winrm_username: 'Administrator',
winrm_password: node['windows']['password']

machine "machine1" do
action :setup
end

machine_execute 'mkdir c:\chef\trusted_certs' do
machine 'machine1'
end

machine 'machine1' do
file 'c:\chef\trusted_certs\chef_server.crt', "#{File.dirname(FILE)}/../files/default/chef_server.crt"
chef_environment 'Dev'
end

It bombs on the machine_execute resource

running:

Chef Development Kit Version: 0.14.25
chef-client version: 12.10.24

Any help appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant