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-solo provisioning on Windows #14

Open
ghost opened this issue Apr 16, 2021 · 0 comments
Open

Chef-solo provisioning on Windows #14

ghost opened this issue Apr 16, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Apr 16, 2021

This issue was originally opened by @Chan9390 as hashicorp/packer#5220. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


Chef solo isn't installing on Windows Server 2008 R2. Other provisioning like shell and powershell are working fine, but when it comes to chef-solo provisioning, the inbuilt installation script gets stuck.

I tried the following workarounds:

  • Overriding the inbuilt command with install_command. Doesnt work
  • Have a shell provisioning with installation command. Doesnt work
  • Have a powershell provisioning with installation command. Doesnt work

The guest VM is Windows Server 2008 R2. It has dotNet 4.5 and Windows Management Framework 5.0 installed (Powershell v5 is present).

  • Packer version : Tested with 1.0.0 and 1.0.3

  • Host platform : Ubuntu 16.04

  • End output from logs:

    2017/08/04 21:10:01 [INFO] (telemetry) Starting provisioner chef-solo
    2017/08/04 21:10:01 ui: ==> virtualbox-iso: Provisioning with chef-solo
    2017/08/04 21:10:01 ui:     virtualbox-iso: Installing Chef...
    2017/08/04 21:10:01 packer: 2017/08/04 21:10:01 opening new ssh session
    2017/08/04 21:10:01 packer: 2017/08/04 21:10:01 starting remote command: powershell.exe -Command ". { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; Install-Project"
    2017/08/04 21:10:22 ui:     virtualbox-iso:
    2017/08/04 21:10:22 ui:     virtualbox-iso: ModuleType Version    Name                                ExportedCommands
    2017/08/04 21:10:22 ui:     virtualbox-iso: ---------- -------    ----                                ----------------
    2017/08/04 21:10:22 ui:     virtualbox-iso: Script     0.0        Omnitruck                           {Get-ProjectMetada...
    
  • Provisioning script:

      {
        "type": "chef-solo",
        "guest_os_type": "windows",
        "cookbook_paths": ["chef/cookbooks"],
        "run_list": [
          "recipe[metasploitable::root_certs]",
          "recipe[metasploitable::vagrant_ssh]",
          "recipe[metasploitable::disable_auto_logon]",
          "recipe[metasploitable::enable_rdp]"
        ]
      },
    

Look at the entire script here.

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

No branches or pull requests

0 participants