Commit Graph

339 Commits

Author SHA1 Message Date
Chris Bednarski a6552f7c75 Merge pull request #3166 from ephemeralsnow/master
Add chmod to chef-solo provisioner
2016-02-10 19:23:47 -08:00
Billie Cleek a5ab53bf5e update ansible tests
Update tests to account for changes made in #3149
2016-02-10 14:16:02 -08:00
Billie Cleek a23610ef41 cleanup ansible provisioner key generation
* Clearly separate host signer and user key generation into separate
  functions and data structures.

* Remove inaccurate comment about needing to specify both files if
  either one is specified.

* Rename parameters for clarity according to their meaning to the
  callee.

* Style the code with gofmt.
2016-02-10 14:16:02 -08:00
ephemeralsnow 3de8561a75 Add chmod to chef-solo provisioner 2016-02-09 20:06:26 +09:00
Chris Bednarski 569e6cc464 go fmt 2016-02-08 17:34:06 -08:00
Marat Bakeev c95b2b483f Merge branch ansible-provisioner of https://github.com/dkhenry/packer 2016-02-05 15:40:17 +13:00
Chris Bednarski 114bddfe36 Merge branch 'master' of https://github.com/mitchellh/packer 2016-02-01 13:28:56 -08:00
Chris Bednarski 1f6749096a Restore missing interpolation after merging ansible remote; fixes #3138 2016-02-01 13:28:49 -08:00
Billie H. Cleek bf3c294326 listen on system chosen port
Change the default for LocalPort to "0", so that the listener will be a
system chosen port.
2016-01-28 22:22:12 -08:00
Chris Bednarski 15f99a4aee Merge branch 'ansible-provisioner' of https://github.com/bhcleek/packer into f-ansible 2016-01-28 15:16:54 -08:00
Chris Bednarski 87532b1b00 Merge branch 'chef-provisioner-windows' of https://github.com/sneal/packer into f-chef-provisioner-windows 2016-01-28 14:55:17 -08:00
Chris Bednarski 3eabc6253d Merge pull request #2653 from evertrue/evertrue/eherot/add_data_bag_secret_to_chef_client
Chef-client provisioner: Add encrypted data bag secret path (Fixes #1945)
2016-01-13 13:59:48 -08:00
Billie Cleek 77c48678d6 eliminate possible race conditions
Eliminate race-y use of the packer.Ui interface by wrapping it in a
concurrency-safe implementation.
2015-12-19 15:15:19 -08:00
Billie Cleek d73e75a7cf fix panic when connection is closed before packer send Shutdown 2015-12-19 12:15:04 -08:00
David Zanetti 2668747c71 Rename noclean shell option to skip_clean, per pull feedback 2015-11-19 16:02:45 +13:00
David Zanetti 3d23655f2f Add "noclean" boolean to shell provisioner. This stops the provisioner from
attempting to remove helper scripts it creates. As noted on #2803 this can
be useful when deleting the build user from an AMI or other template.
2015-11-16 16:37:09 +13:00
Trevor Suarez f006a83c95 Fixing the bug found in the tests 2015-11-03 18:19:03 -05:00
Trevor Suarez 6ca02286d4 Test for when the config parameter isn't passed 2015-11-03 18:18:24 -05:00
Trevor Suarez 627a8fe819 Renaming the config parameter from "options"
to "extra_arguments"
2015-11-03 17:55:03 -05:00
Trevor Suarez 4ea7e3473d Testing the new options argument during the actual
call to `Provision()`
2015-11-03 15:01:16 -05:00
Trevor Suarez 84e1b387c4 New test for preparing the new config parameter 2015-11-03 14:36:04 -05:00
Trevor Suarez ebed9e53fb Adding new "Options" configuration parameter for
the puppet-masterless provisioner, to allow for specifying additional
options to pass to the execute command
2015-11-03 12:30:55 -05:00
Billie Cleek 2dc9e0af3f fix `go vet` identified issues 2015-10-31 10:39:33 -07:00
Billie H. Cleek 5366393f9f fix tests 2015-10-31 10:39:33 -07:00
Billie H. Cleek cc8ca3098e add ansible provisioner 2015-10-31 10:39:33 -07:00
Mark Peek 43cb854b3e Merge pull request #2568 from pecigonzalo/f-winrm-reboot
Add reboot checks before moving out of the reboot sequence for WinRM
2015-10-26 16:57:13 -07:00
Mark Peek c48548b3bb go fmt 2015-10-18 11:13:09 -07:00
Mark Peek 1aad5cf6d5 provisioner/windows-restart: remove race in test 2015-10-12 13:20:18 -07:00
Mark Peek d87b68efe8 Syncronize cancellation in windows-restart tests
Two windows-restart tests would timeout and fail due to the cancellation
thread firing before the cancel object was created. This change syncronizes
the start of the threads to prevent this from occurring.
2015-10-10 14:32:39 -07:00
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
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