561 Commits

Author SHA1 Message Date
Shawn Neal
357e494ee3 Fix failing Windows guest command tests 2015-10-01 10:04:59 -07:00
Shawn Neal
8014dac742 Add Windows support to Chef provisioners
- Add guest os type to change the default Chef-Solo and Chef-Client provisioner behavior. Paths, commands etc.
- Change Chef installation download location to chef.io domain
- Add encrypted data bag secret configuration
2015-10-01 10:04:59 -07:00
Shawn Neal
affebcda86 Windows Powershell commands need to specify shell
The WinRM communicator defaults to the regular Windows cmd shell so we need to tell Packer to use Powershell when running these guest commands.
2015-10-01 10:02:11 -07:00
Shawn Neal
67f6d6cdb5 Adds provisioner guest commands abstraction
Provisioners often needs to perform command line operations on guests that may have different syntax and shells. The GuestCommands type abstracts these away so provisioners can avoid littering branching logic all over the place.
2015-10-01 10:02:10 -07:00
Gonzalo Peci
f01f62dc88 Add specific exit codes listed on https://msdn.microsoft.com/en-us/library/windows/desktop/ms681383(v=vs.85).aspx 2015-08-28 09:55:14 +12:00
Gonzalo Peci
8bd3e62853 Because the new functionality makes the ``waitForRestart()` function run commands it modifies the value of `comm.StartCmd.Command` that is being checked, we need to implement the same workaround that is being used for the `waitForCommunicator()`` function. This should make the test work again and retain functionality. 2015-08-28 09:54:59 +12:00
Gonzalo Peci
08359e409a Revert the shutdown command with new parameters as this will return proper exit codes. This will work in the same way as restart-computer -force when using ``shutdown /r /f /t 0``.
Note:The WinRM library does not return the exit code currently, this will be implemented on https://github.com/masterzen/winrm/pull/26
2015-08-28 09:54:39 +12:00
Gonzalo Peci
70083fc869 Add reboot checks before moving out of the reboot. 2015-08-28 09:54:24 +12:00
Tim Smith
72e8119233 Download chef from chef.io 2015-08-25 21:53:50 -07:00
Eric Herot
f625c985af Chef-client provisioner: Add encrypted data bag secret support (Fixes #1945) 2015-08-21 16:05:47 -07:00
Chris Bednarski
abb67fdd79 Fix govet issues 2015-08-05 19:41:29 -07:00
Chris Bednarski
84abbc2fe2 Merge pull request #2519 from BayanGroup/salt-remote-dirs
Add options to specify salt remote dirs
2015-07-30 19:06:59 -07:00
Chris Bednarski
c04feb77b1 Merge pull request #2520 from BayanGroup/salt-ensure-dir-exists
Ensure that `/etc/salt` exists
2015-07-30 19:03:34 -07:00
Chris Bednarski
c04e442203 Merge pull request #2518 from BayanGroup/fix-error-messages
Fix semantic errors in messages
2015-07-28 18:36:21 -07:00
AmirAli Moinfar
eba0e9eaf8 Ensure that /etc/salt exists
Make sure that directory `/etc/salt` exists before copying salt
minion file.
2015-07-28 10:40:09 +04:30
AmirAli Moinfar
769c82b171 Support for setting salt remote directory
* It is possible to set remote salt tree through `remote_state_tree` argument.
* It is possible to set remote pillar root through `remote_pillar_roots` argument.
* Directories `remote_state_tree` and `remote_pillar_roots` are emptied before use.
2015-07-28 10:37:52 +04:30
AmirAli Moinfar
f90f2f685d Fix semantic errors in messages 2015-07-28 10:34:13 +04:30
Gonzalo Peci
21107b0027 Fix wrong command type being used when running elevated provisioner. 2015-07-28 16:14:32 +12:00
Chris Bednarski
715662f60b Reformat 2015-07-27 16:42:06 -07:00
Jaime Soriano Pastor
be8c9dddf2 Puppet masterless provisioner optionally cleans staging directory
When puppet is executed in masterless mode it didn't remove
staging directory, this can be a problem because it leaves all
the modules and manifests in the built image.
This is specially problematic when building docker images as they
can be left in the layers unless an specific cleanup is done after
running puppet.

This change adds a flag `clean_staging_directory` to puppet
masterless provisioner so it takes care of this cleanup.
2015-07-17 22:24:23 +02:00
Chris Bednarski
56745e14f5 manifest_file can now be a folder or file.pp and we will upload it correctly in either case 2015-07-16 19:15:16 -07:00
Schreiter, Wulf-Thilo
18438cf291 Add knife config by template
Since the chef-client provisioner is cleaning the node and client at the chef-server from the provisioned node
it needs to have a flexible configuration

This is replacing the used knife flags: -s '<chef-server-url>' -k '/tmp/packer-chef-client/client.pem' -u '<client-name>'
and puts their values into a generated knife.rb

Additionally the knife.rb may include the optional ssl_verify_mode attribute to enable the verify mode verify_none

Background:

When deleting node and client to a self-hosted chef-server using self signed cerfiticates the usage of

    knife node delete <node-name> -y -s '<chef-server-url>' -k '/tmp/packer-chef-client/client.pem' -u '<client-name>'

will lead into a ssl verification failure.

The error output of the knife call is somthing like:

    2015/06/24 12:29:17 ui:     docker: WARNING: No knife configuration file found
    docker: WARNING: No knife configuration file found
    2015/06/24 12:29:17 ui:     docker: ERROR: SSL Validation failure connecting to host: 172.16.117.63 - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B:
    certificate verify failed
    docker: ERROR: SSL Validation failure connecting to host: 172.16.117.63 - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
    2015/06/24 12:29:17 ui:     docker: ERROR: Could not establish a secure connection to the server.
    docker: ERROR: Could not establish a secure connection to the server.
    2015/06/24 12:29:17 ui:     docker: Use 'knife ssl check' to troubleshoot your SSL configuration.
    docker: Use 'knife ssl check' to troubleshoot your SSL configuration.
    2015/06/24 12:29:17 ui:     docker: If your Chef Server uses a self-signed certificate, you can use
    docker: If your Chef Server uses a self-signed certificate, you can use
    2015/06/24 12:29:17 ui:     docker: 'knife ssl fetch' to make knife trust the server's certificates.
    docker: 'knife ssl fetch' to make knife trust the server's certificates.
    2015/06/24 12:29:17 ui:     docker:
    docker:
    2015/06/24 12:29:17 ui:     docker: Original Exception: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
    docker: Original Exception: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
    2015/06/24 12:29:17 packer-builder-docker: 2015/06/24 12:29:17 Executed command exit status: 100
2015-06-24 15:22:59 +02:00
Vasiliy Tolstov
036c9ddf7c fix file download provisioner
when file used with download direction we don't need
to check source on builder because it on machine.

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
2015-06-23 12:27:27 +03:00
Mitchell Hashimoto
b77042dc85 provisioner/shell-local: fix vet 2015-06-22 15:01:22 -07:00
Mitchell Hashimoto
5db4d7c01f fmt 2015-06-22 12:37:52 -07:00
Mitchell Hashimoto
288b9a70f6 Merge pull request #1657 from njhartwell/master
Adding disable sudo support to salt masterless
2015-06-22 12:37:30 -07:00
Mitchell Hashimoto
11e325738b Merge branch 'ansible-inventory-groups' of https://github.com/lyrixx/packer into lyrixx-ansible-inventory-groups 2015-06-22 12:35:50 -07:00
Mitchell Hashimoto
7c8e86c9c5 provisioner/*: fix interpolation context 2015-06-22 12:26:54 -07:00
Mitchell Hashimoto
0e8036a023 Merge pull request #2283 from mitchellh/f-local-shell
Local shell provisioner
2015-06-22 12:18:48 -07:00
Mitchell Hashimoto
6ec428cc38 provisioner/shell: retry file delete [GH-2286] 2015-06-21 19:53:43 -07:00
Mitchell Hashimoto
2dc6155c30 provisioner/shell-local: tests 2015-06-19 15:27:44 -07:00
Mitchell Hashimoto
80fc1f032b provisioner/shell-local: a first stab 2015-06-19 15:06:06 -07:00
Mitchell Hashimoto
59766067c0 provisioner/windows-restart: make test pass on slow machines 2015-06-19 06:13:51 +02:00
Mitchell Hashimoto
873bc7471f Merge pull request #2280 from flopex/ignore_exit_codes
provisioner/puppet-server: Add ignore exit codes option
2015-06-19 06:08:29 +02:00
Mitchell Hashimoto
4463083a60 provisioner/shell: randomize default script name 2015-06-18 10:38:23 +02:00
Mitchell Hashimoto
b2609db395 provisioner/windows-restart: fix potential panic case 2015-06-17 18:22:27 +02:00
Mitchell Hashimoto
7711e07f05 provisioner/windows-restart: test fix 2015-06-17 17:56:31 +02:00
Mitchell Hashimoto
49769a17c2 Merge pull request #2243 from mitchellh/f-powershell
Windows provisioners: powershell, windows-shell, windows-restart
2015-06-17 17:51:42 +02:00
Mitchell Hashimoto
5ee02b09b2 Merge pull request #2258 from mitchellh/b-puppet-manifest-base
provisioner/puppet-masterless: only base if manifest is a file [GH-1933]
2015-06-17 17:51:07 +02:00
Gonzalo Peci
af4d8b99b4 Add quickfix to restart provisioner as existing one was not working.
For more information read https://github.com/mitchellh/packer/pull/2243
2015-06-17 12:29:10 +12:00
Mitchell Hashimoto
8990c38d5e provisioner/puppet-masterless: deprecation warning 2015-06-16 09:38:24 -07:00
Mitchell Hashimoto
6cda4fa548 Merge branch 'default_facts' of https://github.com/danzilio/packer into danzilio-default_facts 2015-06-15 15:29:23 -07:00
Mitchell Hashimoto
65916514c0 Merge branch 'puppet_working_dir' of https://github.com/ColinHebert/packer into ColinHebert-puppet_working_dir 2015-06-15 15:17:45 -07:00
Mitchell Hashimoto
5d38ee939b Merge pull request #2259 from mitchellh/b-shell-delete
provisioner/shell: remove file after exec [GH-1536]
2015-06-15 15:15:51 -07:00
Mitchell Hashimoto
6c80228661 provisioner/shell: missing error arg 2015-06-15 15:11:08 -07:00
Alexander Golovko
500d83b673 add download support to file provisioner 2015-06-15 15:08:56 -07:00
Mitchell Hashimoto
a235419c7d provisioner/shell: remove file after exec [GH-1536] 2015-06-15 15:02:59 -07:00
Mitchell Hashimoto
742e556836 provisioner/puppet-masterless: only base if manifest is a file [GH-1933] 2015-06-15 14:44:54 -07:00
Mitchell Hashimoto
711dfc9d0a provisioner/chef: show command in output 2015-06-15 14:35:54 -07:00
Mitchell Hashimoto
14787fd4cc provisioner/chef-client: run cleanup on node [GH-1295] 2015-06-15 14:29:12 -07:00