Closed mefellows closed 9 years ago
Oh yeah!
My first attempt was to use the amazon ebs builder. However, it hangs after it writes the temp file.
==> amazon-windows-ebs: Provisioning with windows-shell...
2015/01/13 08:08:21 packer-provisioner-powershell: 2015/01/13 08:08:21 Found command: iex ((new-object net.webclient).DownloadString('https://chocolatey.org/i
nstall.ps1'))
2015/01/13 08:08:21 packer-provisioner-powershell: 2015/01/13 08:08:21 Found command: choco install 7zip
2015/01/13 08:08:21 ui: ==> amazon-windows-ebs: Provisioning with shell script: /tmp/packer-windows-shell-provisioner464613483
==> amazon-windows-ebs: Provisioning with shell script: /tmp/packer-windows-shell-provisioner464613483
2015/01/13 08:08:21 packer-provisioner-powershell: 2015/01/13 08:08:21 Opening /tmp/packer-windows-shell-provisioner464613483 for reading
2015/01/13 08:08:21 packer-provisioner-powershell: 2015/01/13 08:08:21 [INFO] 105 bytes written for 'uploadData'
2015/01/13 08:08:21 [INFO] 105 bytes written for 'uploadData'
Provisioner block:
"provisioners": [{
"type": "powershell",
"inline": [
"iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))",
"choco install 7zip"
]
}],
I've tried it twice. Any thoughts?
Also the Provisioning with names and the temp script path that we send to the console can be updated to reflect the new awesome.
My thoughts are sad. I haven't yet tested with Amazon but let me see about trying that out today. Good point wrt output I'll make the adjustments.
OK I have some good news and some bad news. Well, really just good news - The amazon-windows-ebs
builder works great for me. I have tested by installing chocolatey and then another package as per your above example.
I'll contact you in Slack @dylanmei and we can drill down to find out why things aren't working for you (or what I've done differently / forgot more likely).
I went back to the stock winrmcp and it worked great on vbox and aws. Nice work! :beers:
Great news! I shall merge this in for now and we can get more feedback in the beta.
This PR addresses the requirements outlined in #12 with the intention of creating specific Powershell and Windows Shell (cmd) Packer Provisioners - the two plugins can now be used as provisioners in
packer.json
templates using the typespowershell
andwindows-shell
respectively.Additionally, this PR combines a number of improvements over the existing system:
Provisioners now implement the documented behaviour of Packer inline scripts, specifically the "same context" behavior of stock shell-provisioner:
inline
andscript(s)
directivespowershell -command ...
type statementsHere are some examples that are now supported with the new provisioners: