rgl / packer-plugin-windows-update

Packer plugin for installing Windows updates
Mozilla Public License 2.0
299 stars 71 forks source link

error initializing provisioner 'windows-update': Unknown provisioner #113

Closed audioeptesicus closed 2 years ago

audioeptesicus commented 2 years ago

Running packer 1.8.0 from a Windows 2019 server.

I'm running packer from C:\Scripts\Packer and have the environment variable set. I have placed the packer-plugin-windows-update_v0.14.0_x5.0_windows_amd64.exe plugin in multiple directories (where packer.exe resides, where the .json/.pkr.hcl files are saved, in various plugin directories I have created based on recommended paths) and cannot avoid the error.

The packer log finds the plugins, but does note the following:


2022/05/13 08:31:52 ui error: Error: Unknown provisioner type "windows-update"

  on Windows_Builds\Win2022_Base\Win2022_Base.pkr.hcl line 129:
  (source code not available)

What am I doing wrong here?

rgl commented 2 years ago

You do not need to install the plugin manually, packer init will do that for you. Please see https://github.com/rgl/packer-plugin-windows-update#usage

audioeptesicus commented 2 years ago

I did that as well.

PS C:\Scripts\Packer> packer init .\windows-update-install.pkr.hcl
Installed plugin github.com/rgl/windows-update v0.14.1 in "C:/Users/xxxxxxxxxx/AppData/Roaming/packer.d/plugins/github.com/rgl/windows-update/packer-plugin-windows-update_v0.14.1_x5.0_windows_amd64.exe"

I still get the below error:

Error: Unknown provisioner type "windows-update"

  on .\Win2022_Base.pkr.hcl line 129:
  (source code not available)

known provisioners: [azure-dtlartifact ansible-local chef-client converge
windows-restart breakpoint sleep shell-local puppet-server chef-solo ansible
inspec shell salt-masterless puppet-masterless windows-shell file powershell]
rgl commented 2 years ago

That is really odd. Its downloading the correct plugin binary, but its not finding it?

Did you double check your .pkr.hcl file plugin definition block?

packer {
  required_plugins {
    windows-update = {
      version = "0.14.1"
      source = "github.com/rgl/windows-update"
    }
  }
}

If you did, you have to check the packer debug logs to see if there's any clue in there.

Vermyndax commented 1 year ago

I'm also experiencing this issue. I have the above code in windowsbase.pkr.hcl, and it installs 0.14.1 fine, but then when I try to execute the packer build, it fails with the same error.

Installed plugin github.com/rgl/windows-update v0.14.1 in "C:/Windows/system32/config/systemprofile/AppData/Roaming/packer.d/plugins/github.com/rgl/windows-update/packer-plugin-windows-update_v0.14.1_x5.0_windows_amd64.exe"
Error: Failed to initialize build "Windows-corp"

error initializing provisioner 'windows-update': Unknown provisioner
windows-update