Commit Graph

350 Commits

Author SHA1 Message Date
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
Mitchell Hashimoto 106c9403ed provisioner/chef-client: chmod the directories 2015-06-15 13:41:07 -07:00
Mitchell Hashimoto bee3b59c40 Merge branch 'chef-client-client_key' of https://github.com/ameir/packer into ameir-chef-client-client_key 2015-06-15 13:40:33 -07:00
Mitchell Hashimoto ab6a330d86 provisioner/*: fix go vet 2015-06-14 12:39:39 -07:00
Mitchell Hashimoto 339a4ccdab provisioner/windows-shell 2015-06-14 11:23:29 -07:00
Mitchell Hashimoto 840ddb4f20 provisioner/windows-restart 2015-06-14 11:14:47 -07:00
Mitchell Hashimoto 040ff0706d provisioner/powershell 2015-06-14 11:01:28 -07:00
Mitchell Hashimoto c549fce85e provisioner/shell: escape single quotes [GH-2067] 2015-06-13 14:11:20 -04:00
Mitchell Hashimoto 7830d78d06 provisioner/shell: fix tests 2015-06-11 17:24:02 -04:00
Mitchell Hashimoto b28f946be9 Merge pull request #2210 from mitchellh/b-set-e
provisioner/shell: set -e for inline [GH-2069]
2015-06-11 17:19:43 -04:00
Mitchell Hashimoto 3ed73852be provisioner/shell: set -e on the shebang itself 2015-06-11 17:19:23 -04:00
Mitchell Hashimoto a995df352e provisioner/shell: uploaded script should be 0755 [GH-1708] 2015-06-10 21:18:46 -07:00
Mitchell Hashimoto 952077ccb0 provisioner/shell: set -e for inline [GH-2069] 2015-06-10 21:02:22 -07:00
Mitchell Hashimoto 2b4df93f2f provisioner/*: interpolation 2015-05-27 14:50:20 -07:00
Mitchell Hashimoto c2381be44f provisioner/*: convert to interpolation 2015-05-27 14:41:47 -07:00
Francisco Lopez 758618ecaa Add ignore_exit_codes key for provisioner puppet-server 2015-05-14 15:05:44 -07:00
Nathan Hartwell c4cee75b93 Adding tests for disable sudo 2015-05-13 08:32:09 -05:00
Nathan Hartwell d0d3229f96 Merge branch 'master' of https://github.com/mitchellh/packer
Conflicts:
	provisioner/salt-masterless/provisioner.go
2015-05-13 08:13:38 -05:00
Grégoire Pineau cd14cb7012 [Provisioner][Ansible] Added support for inventory group 2015-04-30 18:43:00 +02:00
Ameir Abdeldayem 5c06af872d Support chef-client 'client_key' and default to <staging
dir>/client.pem.
2015-04-09 02:15:16 -04:00
Emil Hessman 3165b0c936 provisioner/salt-masterless: fix incorrect printf verb types
Fixes the following vet reports:

provisioner/salt-masterless/provisioner.go:119: arg cmd for printf verb %s of wrong type: *github.com/mitchellh/packer/packer.RemoteCmd
provisioner/salt-masterless/provisioner.go:121: arg err for printf verb %d of wrong type: error
provisioner/salt-masterless/provisioner.go:142: arg err for printf verb %d of wrong type: error
provisioner/salt-masterless/provisioner.go:157: arg err for printf verb %d of wrong type: error
provisioner/salt-masterless/provisioner.go:172: arg err for printf verb %d of wrong type: error
provisioner/salt-masterless/provisioner.go:216: arg err for printf verb %d of wrong type: error
2015-02-25 05:43:18 +01:00
Emil Hessman 92704b693a provisioner/puppet-masterless: fix missing format argument
Fixes the following vet report:

provisioner/puppet-masterless/provisioner.go:196: missing argument for Errorf(%d): format reads arg 1, have only 0 args
2015-02-25 05:43:18 +01:00
David Danzilio 7e3d172581 Fixing spacing on line 162 and 164 of provisioner/puppet-masterless/provisioner_test.go 2015-02-24 22:56:37 -05:00
David Danzilio 8404f6ce86 Taking a stab at a test for the facter facts 2015-02-24 22:52:09 -05:00
David Danzilio d1445bc6fe Make PackerBuildName and PackerBuilderType available as Facts during a masterless run similar to the way we do with the Shell provisioner. 2015-02-24 21:44:00 -05:00
Colin Hebert b7fccec91c Set the working dir to staging dir 2015-01-11 10:29:01 +11:00
Colin Hebert a100e9393b Add support for custom working directory for puppet 2015-01-11 10:25:48 +11:00
Erik Simmler 034ed36d0e Ask salt to return a proper exit code so we can fail the builder appropriately. 2014-12-30 10:34:43 -05:00
Neeki Patel 3a3a81b01c Merge remote-tracking branch 'upstream/master' 2014-12-24 17:04:27 -05:00
Victor Trac eb72584415 fix passing bootstrap_args to bootstrap script 2014-12-22 14:08:32 -06:00
Neeki Patel 027b43ea05 Fixed info declared and not used 2014-12-16 09:49:57 -05:00
Neeki Patel 5a9e5df967 Allow manifest_file to be a directory
Puppet is removing support for imports and node inherits. This change will support directories as manifests

https://docs.puppetlabs.com/puppet/latest/reference/dirs_manifest.html
https://docs.puppetlabs.com/puppet/latest/reference/lang_import.html
2014-12-16 09:27:30 -05:00
Timur Batyrshin e4c544b3e2 added ssl_verify_mode parameter to chef-client provisioner 2014-12-05 20:26:41 +03:00
James Massara 1837c7189a Added tests for prevent_sudo 2014-11-27 06:24:54 -08:00
James Massara a5ca2e5a27 Use sudo only if prevent_sudo is not set 2014-11-27 06:24:54 -08:00
Seth Vargo 0eb634ae6a Merge pull request #1525 from scott2449/master
Add default nodename for chef-client
2014-11-26 16:29:22 -05:00
Nathan Hartwell e5c6f1a753 Merge branch 'master' of https://github.com/mitchellh/packer
Conflicts:
	provisioner/salt-masterless/provisioner.go
2014-11-05 10:58:25 -06:00
Mitchell Hashimoto 81d8cd0db4 Merge pull request #1394 from mafrosis/salt-masterless
Salt masterless tidy up
2014-10-28 08:35:10 -07:00
Mitchell Hashimoto 3eda0f33a0 provisioner/shell: quote PACKER env vars [GH-1565] 2014-10-28 08:23:18 -07:00
Mitchell Hashimoto 8cdb686505 Merge pull request #1562 from bhcleek/ansible-local-inventory-best-practice
provisioners/ansible-local: always use an inventory file
2014-10-27 17:01:12 -07:00
Steve Daniels 86fb46ab0a Update SaltStack provision to https
This changes the SaltStack bootstrap URL to use the HTTPS link from the commercial site.  Alternatives are the HTTPS link to the raw file on GitHub, but this, whilst more transparent, might break down the line.
2014-10-22 17:55:45 +01:00
Billie H. Cleek afa499befd always use an inventory file
Using "127.0.0.1," as the argument to `ansible-playbook -i` uses an
undocumented feature of Ansible. Michael DeHaan has indicated that
support for it may be pulled in the future
(https://groups.google.com/forum/#!topic/ansible-project/G_9JRGp5jGE).
2014-10-14 15:36:29 -07:00
Mitchell Hashimoto 373cefa93c Merge pull request #1585 from Tpbrown/ansible-color-and-unbuffered
provisioner/ansible: Colorize Ansible output, and don't buffer output.
2014-10-14 15:36:27 -07:00
Josh Frye 5835ca42b4 Move quoting to else block only for valid vars. Add test case. 2014-10-14 14:20:36 -07:00
Josh Frye a667282e00 Single quote env var values. 2014-10-14 13:03:14 -07:00
Tim Brown baa8697f5d Colorize Ansible output, and don't buffer output.
Setting environment variables for the ansible-playbook invocation.

ANSIBLE_FORCE_COLOR will ensure output is colorized.  PYTHONUNBUFFERED will stream output as Ansible runs, vs getting a big dump of output at the end.
2014-10-13 15:31:11 -07:00
Nathan Hartwell 331003c809 Merge branch 'master' of https://github.com/mitchellh/packer 2014-10-06 15:19:11 -05:00
mafro ed07fb63e4 salt provisioner: tidy up and refactor into functions 2014-10-01 12:31:58 +10:00
mafro e7a46d97c0 salt provisioner: require local_state_tree 2014-10-01 12:31:58 +10:00
Scott Rahner 4383b435a4 adding default nodename 2014-09-24 19:40:34 -04:00
Mitchell Hashimoto 75395af12d Merge branch '1064-fix-upload-file-permissions' of github.com:rasa/packer into rasa-1064-fix-upload-file-permissions
Conflicts:
	builder/parallels/common/step_upload_parallels_tools.go
	builder/vmware/common/step_upload_tools.go
	provisioner/chef-client/provisioner.go
	provisioner/chef-solo/provisioner.go
2014-09-08 13:20:46 -07:00
Mitchell Hashimoto 802168f4b5 Merge branch 'add-chef-environment' of github.com:cfortier2/packer into cfortier2-add-chef-environment
Conflicts:
	provisioner/chef-client/provisioner.go
2014-09-05 16:13:32 -07:00
Mitchell Hashimoto 825864a9ea Merge branch 'additional-user-variables' of github.com:nBerg/packer into nBerg-additional-user-variables
Conflicts:
	builder/amazon/common/run_config.go
2014-09-02 09:57:52 -07:00
yveslaroche 3bfeb54853 Fix Ansible inventory path on Windows
Convert the path to use a '/' separator.
2014-07-25 14:32:38 +01:00
Misha Brukman c75a671c1e Cleaned up Go formatting with gofmt. 2014-07-17 15:33:09 -04:00
sawanoboly 18dddb516b Fix remotePaths when provisioning Linux from Windows 2014-07-11 19:12:34 +09:00
Nina Berg bd1a0d07fb Added some variables to amazon-ebs builder and chef-client provisioner 2014-07-08 13:15:17 -04:00
cfortier2 e908cc1733 add chef_environment test 2014-05-21 09:30:18 -04:00
cfortier2 25386f8e8e add support for chef_environment 2014-05-21 09:24:34 -04:00
Ross Smith II d92179847d provisioner/file: set file/directory permissions
fixes #1064
2014-05-09 21:03:35 -07:00
renat-sabitov-sirca 0a8e4c7186 Uploading the whole ansible playbook directory 2014-05-10 01:59:05 +10:00
Nathan Hartwell 88ec874c32 Adding disable_sudo support to salt-masterless provisioner
This is already present in some other provisioners and is helpful when
using a builder that gives you root access.
2014-05-09 09:08:41 -05:00