426 Commits

Author SHA1 Message Date
Matthew Hooker
6d6c7864b4 Merge pull request #4328 from DanHam/gh-3108
Allow equals sign in value of environment variable for Powershell provisioner
2017-01-03 12:38:17 -08:00
Sean Malloy
a617884a16 Add more tests for puppet-masterless provisioner
* Add tests for staging_directory config option
* Add tests for working_directory config option
2016-12-28 21:14:17 -06:00
Sean Malloy
c226b19d08 Add additional unit tests for puppet-server provisioner
* Add puppet-server test for staging_dir config option
* Add puppet-server test for execute_command config option
2016-12-27 22:35:13 -06:00
DanHam
0423f91037
Fix to allow equals sign in value of environment variable 2016-12-28 00:33:16 +00:00
DanHam
be0196492f
Tests for env variables values starting with or containing an equals sign 2016-12-28 00:31:17 +00:00
Sean Malloy
ce43ade973 Add additional unit tests for puppet provisioners
* Add puppet-masterless test for packer_build_name default fact
* Add puppet-masterless test for packer_builder_type default fact
* Add puppet-server test for puppet bin directory
2016-12-26 23:11:27 -06:00
Sean Malloy
7feb8b993c Add default facts for puppet-server provisioner 2016-12-22 15:53:59 -06:00
Taliesin Sisson
335615408a Run go fmt on files 2016-12-12 22:45:19 +00:00
Taliesin Sisson
c88a2ef872 Remove trailing tabs 2016-12-12 22:45:10 +00:00
Taliesin Sisson
55353fae89 Fix spelling mistake
Fix code type for formatting
Remove empty space
2016-12-12 22:45:09 +00:00
Taliesin Sisson
f38d787b0e Powershell uses UTF16Le for encodedCommand 2016-12-12 22:44:56 +00:00
Taliesin Sisson
e36051d394 Pattern for infrastructure changed to quote filename and execute file with ampersand as everything is run in powershell now
Handle powershell commands by specifying any extra infrastructure around running scripts inside of ExecuteCommand and ElevatedExecuteCommand
2016-12-12 22:44:55 +00:00
Taliesin Sisson
d61513bf77 Encode powershell using utf8
Fix a bug in the size of string that was returned when decoding a base64 string
Added tests around encoding and decoding powershell scripts. Used [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes('powershell commands')) | clip to generate what base 64 strings should look like
2016-12-12 22:44:54 +00:00
Taliesin Sisson
17597b48e1 Base64 encode powershell to avoid any necessary escaping 2016-12-12 22:44:54 +00:00
Taliesin Sisson
5d5809b27e Make hiding of progress backward compatible with old versions of powershell 2016-12-12 22:44:48 +00:00
Taliesin Sisson
e8c2b49be8 Use correct quotation of variables 2016-12-12 22:44:34 +00:00
Taliesin Sisson
4b394c8563 Write output will put ouput from function, so we don't want to be getting line from output of function
Fix unit tests for not showing progress stream when using powershell
Ensure that progress stream does not get leaked into stdout
Using Write-Output instead of Write-Host since PS v5 now leaks the host stream to stderr
2016-12-12 22:44:33 +00:00
Taliesin Sisson
c42cb88ddd Using Write-Output instead of Write-Host since PS v5 now leaks the host stream to stderr 2016-12-12 22:44:32 +00:00
Taliesin Sisson
cd6213eb55 Seems like we do need to escape the double quote 2016-12-12 22:44:25 +00:00
Taliesin Sisson
15137310a7 Must escape string formatting for string fmt 2016-12-12 22:44:20 +00:00
Taliesin Sisson
5285a819dd Quoting of powershell commands and associated tests 2016-12-12 22:44:19 +00:00
Taliesin Sisson
3051ea6633 Quote powershell so that it does not try to interpret command to be run
Get VName out of state. This allows template replacement to be run on vmname
2016-12-12 22:44:10 +00:00
Taliesin Sisson
6c3030c73a Add a little safety around variables that are passed into provisioner. 2016-12-12 22:44:10 +00:00
Matthew Hooker
b49be38d74 Merge pull request #4210 from yoctocloud/fixes
various fixes
2016-12-12 12:33:19 -08:00
Matthew Hooker
c510988cbf Merge pull request #4209 from bhcleek/ansible-winrm
provisioner/ansible: assume scp target is file (resolves winrm incompatibility)
2016-12-08 22:37:41 -08:00
Patrick Decat
5dd7fb11f4 Saltstack bootstrapping: fallback on wget if curl failed for any reason (such as not being installed) 2016-12-02 20:02:22 +01:00
Vasiliy Tolstov
00ebe9e1d3 various fixes
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
2016-11-29 14:55:44 +03:00
Billie Cleek
f5ca0de225 provisioner/ansible: assume scp target is file
Assume the scp target is a file instead of a directory. Assuming the scp
target is a file instead of a directory allows uploading files to a node
being provisioned with the ssh communciator using sftp and with the
winrm communicator. It is fully compatible with ansible; ansible
communicators only allow for files (never directories) to be uploaded
(when the copy module is used to upload a directory, ansible walks the
directory and uploads files one at a time).

Update documentation to explain how to provision a Windows image.

Extend tests that use ssh to communicate with the node to include single
files, recursive copies, and content-only recursive copies.

Add test to verify support for the winrm communicator.

Remove the err argument from adapter.scpExec, because it was unused.

Fixes #3911
2016-11-26 14:40:39 -08:00
Matthew Hooker
12176b6afc
provisioner/shell: treat disconnects as retryable. 2016-11-22 15:59:40 -08:00
Jasper Siepkes
200aa74e78 Added support for passing arguments to salt-call. 2016-11-11 15:15:16 +01:00
Rickard von Essen
a616c3da3c
provisioner/ansible: Move info messages to log
Make the ansible provisioner less noisy by moving most messages to the
log instead of ui print outs.

Closes #4117
2016-11-05 14:25:45 +01:00
Matthew Hooker
d920b3fbf4 run gofmt 2016-11-01 14:08:04 -07:00
Rickard von Essen
f17bd30070 Revert "Removed escaped quotes in non-elevated powershell invocation"
This reverts commit 1b186f16136d0c1c012108ca9873ca0e2e7d3d5d.
2016-10-26 21:12:11 +02:00
Rickard von Essen
3b42d28cce Merge pull request #4014 from mexisme/feature/puppet-bin-dir
privisioner/puppet: Add `puppet_bin_dir` option.
2016-10-22 14:48:45 +02:00
Rickard von Essen
3361da82d4
Added trailing slash after puppet_bin_dir. 2016-10-22 14:34:34 +02:00
Matthew Hooker
892d5e82c9 expect_disconnect option
provisioner/shell: Adds option to fail if the remote server disconnects
us.
2016-10-21 11:39:03 -07:00
Matthew Hooker
a1ef6398c3 Merge pull request #3371 from simonguest/powershell-envvars-fix
Removed escaped quotes in non-elevated powershell invocation
2016-10-19 18:50:39 -07:00
mexisme
314a4f4bbf Add Puppet Bin Dir to puppet-server provisioner 2016-10-16 02:50:37 +13:00
mexisme
6f9294095f Add Puppet Bin Dir to puppet-masterless provisioner 2016-10-15 22:39:50 +13:00
Matthew Hooker
d8439b0034 Merge pull request #3971 from mitchellh/fix3486
change chef-solo provisioner staging directory
2016-10-14 15:51:26 -07:00
Rickard von Essen
3c8dabba9e Fixed formatting 2016-10-11 23:43:50 +02:00
Matthew Hooker
83131db4b8 Merge pull request #3776 from curiositycasualty/master
Add custom_state config to salt provisioner
2016-10-07 17:59:52 -07:00
Matthew Hooker
2ae1b83b15 change chef-solo provisioner staging directory
Have the staging directory be called `packer-chef-solo`, which is what
is given in docs. Closes #3486
2016-10-07 17:24:30 -07:00
Rickard von Essen
51a9a51699 Update winrm and winrmcp dependencies
Updated winrm and winrmcp dependencies. Relevant unit and acceptance tests passed successfully.

shell.Execute didn't return a Command object.

See f1bcf36a69/winrmcp/cp.go (L167) and 54ea5d0147/winrm/shell.go (L10-L22) respectively.

Closes #3763

Original patch by: Philipp Kosel <philipp.kosel@gmail.com>
2016-10-03 13:48:29 -07:00
Matthew Hooker
a8e57d83d2 gofmt project.
noticed many unrelated changes being added to patches because of gofmt.

ran `find . -not -path "./vendor/*" -name "*.go" -exec gofmt -w {} \;`
2016-09-29 14:13:06 -07:00
Matthew Hooker
efa594bebe Merge pull request #3899 from pengkh/f-file-provisioner
continue add support for file-provisioner to allow directory downloa…
2016-09-22 18:32:57 -07:00
开恒
96a637684b fix #3897
bug fix for file-provisioner download file, including unit-test code.
2016-09-19 10:36:18 +08:00
Billie H. Cleek
f760ab2fd8 Make SCP the default for provisioner/ansible
Add a new option, `use_sftp` to the ansible provisioner. It's default
value is false; ansible provisioner will use SCP by default.

Refactor to consistently set all configure options for ansible
provisioner in the Prepare step.

Remove incorrect information about `ANSIBLE_HOST_KEY_CHECKING=False`
being set when `ansible_env_vars` is not set in the packer template.

Update BATS tests for the ansible provisioner to actually check that the
fetched directory contains the contents expected. This revealed a
problem with the all_options template that required adding a host to the
hosts list in the test playbook.
2016-09-11 23:58:31 -07:00
Billie H. Cleek
e6a0e523e2 refactor sftp subsystem request handling
Refactor the sftp subsystem request handling to make it more similar to
an exec request. This simplifies and improves the readability of the
code.
2016-09-11 23:58:31 -07:00
Billie H. Cleek
da223b9539 add scp support to ansible provisioner
Handle running `scp -t` and `scp -f` exec requests in the
ansible-provisioner's SSH
server to allow Ansible to use SCP so that SFTP doesn't have to be
installed on the node.

Update the BATS tests to test the ansible provisioner.
2016-09-11 23:58:31 -07:00