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

ChefDK 0.18.30 Script Execution Policy Install.ps1 #506

Open
ajeba99 opened this issue Oct 12, 2016 · 3 comments
Open

ChefDK 0.18.30 Script Execution Policy Install.ps1 #506

ajeba99 opened this issue Oct 12, 2016 · 3 comments

Comments

@ajeba99
Copy link

ajeba99 commented Oct 12, 2016

When trying to build a new Windows machine I get an error about script execution policies on the install.ps1 script file.

My deploy server environment is ...
Ubuntu 14.04
ChefDK 0.18.30-1
: chef gem list | grep provisioning
chef-provisioning (2.0.2)
chef-provisioning-aws (2.0.0)
chef-provisioning-azure (0.6.0)
chef-provisioning-fog (0.20.0)
chef-provisioning-vagrant (0.11.0)

Here is the critical part of the log output ...

Starting Chef Client, version 12.14.89
[2016-10-12T21:06:52+00:00] INFO: *** Chef 12.14.89 ***
[2016-10-12T21:06:52+00:00] INFO: Platform: x86_64-linux
[2016-10-12T21:06:52+00:00] INFO: Chef-client pid: 25160
[2016-10-12T21:06:54+00:00] INFO: Run List is []
[2016-10-12T21:06:54+00:00] INFO: Run List expands to []
[2016-10-12T21:06:54+00:00] INFO: Starting Chef Run for epauto
[2016-10-12T21:06:54+00:00] INFO: Running start handlers
[2016-10-12T21:06:54+00:00] INFO: Start handlers complete.
[2016-10-12T21:06:54+00:00] INFO: HTTP Request Returned 404 Not Found: Object not found:
resolving cookbooks for run list: []
[2016-10-12T21:06:55+00:00] INFO: Loading cookbooks []
Synchronizing Cookbooks:
Installing Cookbook Gems:
Compiling Cookbooks...

✂️

[2016-10-12T21:10:56+00:00] INFO: Processing chef_node[Win-Test-Server1] action create (basic_chef_client::block line 57)
[2016-10-12T21:10:57+00:00] INFO: Processing chef_client[Win-Test-Server1] action create (basic_chef_client::block line 146)
[2016-10-12T21:10:57+00:00] INFO: Processing chef_node[Win-Test-Server1] action create (basic_chef_client::block line 157)

    - [Win-Test-Server1] write file C:\chef\ohai\hints\ec2.json on Win-Test-Server1
    - [Win-Test-Server1] write file C:\chef\client.rb on Win-Test-Server1
    - [Win-Test-Server1] write file C:\chef\install.ps1 on Win-Test-Server1
    [Win-Test-Server1] File C:\chef\install.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.
                         At line:1 char:3
                         + & "C:\chef\install.ps1"
                         +   ~~~~~~~~~~~~~~~~~~~~~
                             + CategoryInfo          : SecurityError: (:) [], PSSecurityException
                             + FullyQualifiedErrorId : UnauthorizedAccess
    - [Win-Test-Server1] run '& "C:\chef\install.ps1"' on Win-Test-Server1[2016-10-12T21:11:08+00:00] INFO: Processing chef_node[Win-Test-Server1] action create (basic_chef_client::block line 57)
[2016-10-12T21:11:09+00:00] INFO: Converging Win-Test-Server1 because the resource was updated ...

    [Win-Test-Server1] The term 'chef-client' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
                         At line:1 char:77
                         + $env:path = [System.Environment]::GetEnvironmentVariable('PATH', 'MACHINE');chef ...
                         +                                                                             ~~~~
                             + CategoryInfo          : ObjectNotFound: (chef-client:String) [], CommandNotFoundException
                             + FullyQualifiedErrorId : CommandNotFoundException
    - [Win-Test-Server1] run '$env:path = [System.Environment]::GetEnvironmentVariable('PATH', 'MACHINE');chef-client -l info' on Win-Test-Server1
[2016-10-12T21:11:09+00:00] INFO: Chef Run complete in 255.001492721 seconds

The client.rb, ohai directory, client.pem files and install.ps1 file are all there and look fine.
This is going from a working ChefDK 0.15.16 to a not working 0.18.30.

@hh
Copy link
Contributor

hh commented Oct 16, 2016

One possible fix: #507
To use winrm-elevated by default to run everything as scheduled task.

@ajeba99
Copy link
Author

ajeba99 commented Oct 17, 2016

What happened to running the install.ps1 with elevated permissions? Is this no longer possible?

@BenLiyanage
Copy link

What version of chef comes with 0.15.16? Or is this an issue with chef-provisioning-aws?

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

3 participants