Commit Graph

502 Commits

Author SHA1 Message Date
Seth Vargo 97d5a6ebfc Log chef-zero instead of chef-solo 2014-12-28 12:52:54 -05:00
evverx 1cfc5acea3 Update Chef plugin description 2014-12-24 03:53:29 +03:00
Torben Knerr f2b494c2cc don't forget to pass the `installer_download_path` from the config! 2014-12-17 00:48:34 +01:00
Torben Knerr acc4e3806f pass the `download_path` parameter to the `:chef_install` capability so it is available when `Omnibus.build_command(..)` is invoked 2014-12-16 23:40:22 +01:00
Torben Knerr d7bd65b4e2 extend the omnibus command builder with an additional download_path parameter 2014-12-16 23:29:47 +01:00
Torben Knerr 9e7f705bad extend the Chef provisioner base config object with an 'installer_download_path' property 2014-12-16 22:40:19 +01:00
Seth Vargo 954289beb6 Use new Chef Omnibus URL 2014-12-16 12:16:08 -05:00
Seth Vargo 8c8a92c4be Merge pull request #4896 from analyzere/salt-grains-config
Issue #4895: Support grains config for salt
2014-12-14 23:48:02 -05:00
Gilles Cornu 118e223c33 provisioners/ansible: use Docker proxy when needed
Close #4071

Credits and best thanks to @jabclab
2014-12-08 21:43:21 +01:00
Gilles Cornu 15679f76f8 Merge pull request #4883 from mitchellh/gc-vagrant-1.7-ansible-provisioner
Non-trivial changes and bug fixes for the Ansible provisioner
2014-12-08 21:29:24 +01:00
Gilles Cornu 3800103228 provisioners/ansible: improve comment wording
Get rid of the Joker, thanks to @maspwr :)
2014-12-07 22:34:19 +01:00
Jeff Quast c6cce57ff4 Avoid double-newlines in salt-call output
When using the salt provisioner with verbose=true, most lines read with an extra newline:
```
[INFO    ] Syncing modules for environment 'base'

[INFO    ] Loading cache from salt://_modules, for base)

```

because the line read has a newline, and emitting the log entry again includes an additional newline.
2014-12-03 21:48:30 -08:00
Ken Crowell 72afdce630 Issue #4895: Support grains config for salt 2014-12-02 18:01:09 -04:00
Gilles Cornu f96636587a provisioners/ansible: don't read/write known_hosts
Like Vagrant's default SSH behaviors (e.g ssh or ssh-config commands),
the Ansible provisioner should by default not modify or read the user
known host file (e.g. ~/.ssh/known_hosts).

Given that `UserKnownHostsFile=/dev/null` SSH option is usually combined
with `StrictHostKeyChecking=no`, it seems quite reasonable to bind the
activation/disactivation of both options to `host_key_checking`
provisioner attribute.

For the records, a discussion held in Ansible-Development mailing list
clearly confirmed that there is no short-term plan to adapt Ansible to
offer an extra option or change the behavior of
ANSIBLE_HOST_KEY_CHECKING. For this reason, the current implementation
seems reasonable and should be stable on the long run.

Close #3900

Related References:

- https://groups.google.com/forum/#!msg/ansible-devel/iuoZs1oImNs/6xrj5oa1CmoJ
- https://github.com/ansible/ansible/issues/9442
2014-11-30 09:55:48 +01:00
Gilles Cornu 178942cf27 provisioners/ansible: change arguments arrangement
- force `--connection=ssh` (any other modes like paramiko or smart are not
  supported)
- give the highest priority to `raw_arguments` for sake of simplicity (in
  usage, in code and in documentation)
- fix position of the `--limit` argument (the generated inventory could be
  shadowed by `raw_arguments`, while ansible.limit was able to override
  `raw_arguments`

ref #3396
2014-11-30 09:50:50 +01:00
Gilles Cornu 306c4f7eda provisioners/ansible: force --connection=ssh
When `--connection` argument is not specified, Ansible will use the
'smart' mode, which can either use `ssh` or `paramiko` transports,
depending of the version of OpenSSH available. If OpenSSH version is new
enough to support ControlPersist technology, `ssh` will be used.
See also http://docs.ansible.com/intro_configuration.html#transport.

In order to support some advanced features of Vagrant (e.g. multiple ssh
private key identities or ssh forwarding), the Ansible provisioner
already must force `ssh` connection mode.

Having to deal with the possible fallback to `paramiko` increase the
burden of special cases that Ansible provisioner must handle, without
any added value, as Vagrant is based on OpenSSH and its users are
usually using modern operating systems.

With this change, the Ansible provisioner will officially only support
`ssh`. It will still be possible to switch to another connection mode
via `raw_arguments`, but it will breach the "contract", and no
(community) support can be expected in such use case.

ref #3900, #3396
2014-11-30 09:50:50 +01:00
Gilles Cornu 1c884fa4e5 provisioners/ansible: Show Ansible command when VAGRANT_LOG=debug 2014-11-25 08:12:43 +01:00
Seth Vargo f86189a2fe Add Env.with_clean_env for resetting the Ruby and Rubygems environment 2014-11-10 12:00:23 -05:00
Seth Vargo f232dc38c9 Automatically install Chef when provisioning with Chef 2014-11-07 15:56:22 -05:00
Seth Vargo a8fa4bccc7 Add Chef::Config#install and Chef::Config#version options 2014-11-07 15:56:21 -05:00
Seth Vargo 8f35ecaa6f Extract runner-specific Chef configs into their own subclass
This separates the truly basic pieces of Chef (like install url and
log_level) from the runner pieces of Chef (like provisioning_path). This
is necessary because the Chef Apply provisioner does not actually need
most of the Chef configuration options.
2014-11-07 15:56:21 -05:00
Seth Vargo 59eb0ad2e8 Add Chef Apply provisioner 2014-10-30 15:32:15 -04:00
Seth Vargo 514101816b Fix alignment in the Chef Client config 2014-10-30 15:32:10 -04:00
Seth Vargo af9177550a Properly handle empty/nil values in Chef Solo config 2014-10-30 13:43:26 -04:00
Seth Vargo 7e71d72db8 Check for empty chef_server_url and validation_key_path 2014-10-30 13:43:25 -04:00
Seth Vargo 721edf70b9 Make Chef Zero lowercase in validation (conforms to other keys) 2014-10-30 13:43:25 -04:00
Seth Vargo 1169c80a72 Use require_relative for faster loading
require_relative is an order of magnitude faster on Windows
2014-10-30 13:43:25 -04:00
Teemu Matilainen dec5dcdda3 provisioners/chef: Add `chef_zero` provisioner
Add Chef Zero provisioner using `local_mode` configuration for
chef-solo/chef-client.
2014-10-30 13:43:24 -04:00
Mitchell Hashimoto da91741b7c provisioners/shell: fix typo 2014-10-23 22:49:26 -07:00
Mitchell Hashimoto a7d3458abc provisioners/shell: retry getting SSH info a few times [GH-3924] 2014-10-23 22:48:48 -07:00
Gilles Cornu 1e324093a5 provisioners/ansible: spare machine.ssh_info calls
As a result of #4670 and the safe decision to not memoize
machine.ssh_info (see 89a4a29d65 and
5036d16461), it is preferable to store the
ssh_info hashes and avoid multiple function calls when generating the
ansible inventory.
2014-10-23 22:58:01 +02:00
Mitchell Hashimoto 37a04b4bfc provisioners/puppet: use correct error class [GH-4520] 2014-10-23 10:46:11 -07:00
Mitchell Hashimoto 4b4255c6d1 Merge pull request #4492 from tboerger/feature/suse-fixes
SUSE naming and capability fixes
2014-10-23 10:11:28 -07:00
Mitchell Hashimoto 3f01a99148 provisioners/shell: rename shell_args to powershell-args 2014-10-23 09:53:14 -07:00
Mitchell Hashimoto f0a4e26d27 Merge pull request #4548 from ebelew/shellargs
Update powershell provisioning to fix #4547
2014-10-23 09:50:50 -07:00
Mitchell Hashimoto abb9e5478a provisioners/docker: get GPG key via SSL [GH-4597] 2014-10-23 09:34:24 -07:00
Mitchell Hashimoto 29df3c733b Merge pull request #4596 from miguel250/patch-1
Use HTTPS to download docker's gpg key.
2014-10-23 09:32:54 -07:00
Mitchell Hashimoto d28a7806ea Merge pull request #4472 from abele/fix/master/salt-retcode-passthrough
Fix state.highstate run when using salt master
2014-10-22 22:03:46 -07:00
Mitchell Hashimoto 18c76f0a86 provisioners/docker: search for Docker in multiple paths [GH-4580] 2014-10-21 16:19:02 -07:00
Miguel Perez 307c670154 Use SSL to download docker gpg key.
Fixed #4569
2014-10-21 17:29:49 -04:00
Ben Hines 3321a6da11 Make environment path param more canonical with an underscore 2014-10-19 21:34:54 -07:00
Ben Hines 16870d72d1 Some work in progress environment support 2014-10-19 21:28:38 -07:00
Anton D fdbf3366ce Check whether Salt bootstrap script exists before attempting to delete it. GH-4614 2014-10-10 23:20:50 +13:00
Eris Belew 7a73f5bd7c Update shell provisioner for powershell to add "shell_args", saner defaults and more useful detail in logging output; Add Eclipse .project file to .gitignore IDE section 2014-09-23 12:46:25 -07:00
Ben Hines 1a6805d469 Use the more canonical require_relative to include files 2014-09-15 21:49:37 -07:00
Thomas Boerger 31b6d69127 Fixed suse naming for fcengine cap and refined install command 2014-09-11 10:51:34 +02:00
Jānis Ābele fe16352267 Fix state.highstate run when using salt master
retcode-passthrough option is available only for masterless salt-call.
2014-09-07 20:03:17 +03:00
James Shubin 4763506b89 Remove erroneous yum upgrade.
This upgrade shouldn't be part of the docker setup process. If an
upgrade is needed, it should be done independently of the docker setup.
Do it to your base image, or if needed, as a shell provisioner step.
2014-09-02 12:44:46 -04:00
Mitchell Hashimoto ee70bdd028 provisioners/docker: fix ruby typo 2014-08-30 22:46:57 -07:00
Mitchell Hashimoto 6074a63683 guests/redhat: install Docker on EL7 properly [GH-4402] 2014-08-30 22:44:48 -07:00
Mitchell Hashimoto aae3d93afe Merge pull request #4377 from sumkincpp/patch-1
provisioner/docker: Verbose output for docker provisioner
2014-08-29 10:29:17 -07:00
Mitchell Hashimoto c29f7dd981 Merge pull request #4335 from nmische/GH-4315
provisioners/cfengine: Changing default repo URL.
2014-08-29 09:53:24 -07:00
Mitchell Hashimoto b842a3ed62 Merge pull request #4379 from s7726/master
Update Windows Salt provisioner version
2014-08-29 09:51:24 -07:00
Veres Lajos 4ef996dca9 typofixes - https://github.com/vlajos/misspell_fixer 2014-08-25 20:12:25 +01:00
Gavin Swanson 59826264b8 Update Windows Salt provisioner version 2014-08-23 15:36:52 -07:00
Fedor Sumkin f2c7dc05a1 Verbose output for docker provisioner
Verbose output for docker build and pull tasks
2014-08-22 19:41:01 +04:00
Nathan Mische 70d060cc85 Changing default repo URL. 2014-08-11 21:13:12 -04:00
Mitchell Hashimoto b516881d47 provisioners/puppet: don't repeat output when prov fails [GH-4303] 2014-08-06 11:11:12 -07:00
Mitchell Hashimoto 1cc78dc224 provisioners/salt: use exit code to detect failure [GH-4304] 2014-08-06 11:07:09 -07:00
Mitchell Hashimoto 3bc5ecfbd0 provisioners/salt: whitespace 2014-08-06 11:05:03 -07:00
Mitchell Hashimoto e82d425719 Merge pull request #4087 from zr40/fix/master/prevent-double-output
Don't output stdout and stderr twice when shell provisioner fails
2014-08-06 10:32:13 -07:00
Mitchell Hashimoto 7fb153a2ef Merge pull request #3932 from marnovdm/feature/salt-modular-version
provisioners/salt: Updates Salt Minion version in Salt Bootstrap script for Windows
2014-08-06 10:25:58 -07:00
Mitchell Hashimoto 2cdcc29902 provisioners/chef: put global lock around knife exec 2014-08-06 10:24:05 -07:00
Mitchell Hashimoto 22395e5cb4 Merge pull request #4099 from mitchellh/fix-issue-2476-chef-client-node-cleanup
provisioners/chef: clean bundle env when executing chef client
2014-08-06 10:13:37 -07:00
Mitchell Hashimoto e1ea304884 Merge pull request #4169 from schauer/patch-1
provisioners/puppet: manifest file can be a dir too
2014-08-06 09:56:24 -07:00
Ben Dean dbb92ae412 change the shell provision config to make all the args strings
specifically arrays could contain `Fixnum` args and those wouldn't get turned into strings.
2014-07-22 15:41:01 -04:00
schauer 8a45485de4 Update puppet.rb
The main manifest may be a single file or a directory of .pp files. 
docs.puppetlabs.com/puppet/latest/reference/dirs_manifest.html#with-puppet-master
https://github.com/mitchellh/vagrant/issues/4039
2014-07-09 21:37:55 +02:00
Shawn Neal 2fd634273f First attempt at trying to fix issue 2476
This addresses the error "chef is not part of the bundle" when the chef-client provisioner attempts to delete the node or client from the Chef Server. While this fixes the specific issue on my system, its likely that it does not account for all system configurations like RVM.

The Bundler.with_clean_env should probably be moved internally to Subprocess.execute, but that's a riskier change and I'd like to get some feedback before even attempting that size of change.
2014-06-24 16:49:17 -07:00
Matthijs van der Vleuten 1091b4cb54 Don't output stdout and stderr twice when shell provisioner fails
[GH-4086]
2014-06-23 11:35:40 +02:00
Brett Porter 0c7c143ad1 fix escaping of powershell variable
As this is nested in a powershell variable $command, it must be escaped
otherwise it is evaluated when the variable is created, giving an error that
"The term 'True' is not recognized as the name of a cmdlet, function,
script". This prevented using a puppet.working_directory on Windows.
2014-06-18 16:05:17 +10:00
Ben Hines 7d52f0e14d Backtick-escape the facter env command in powershell. Fixes issue 3958 2014-06-02 19:37:29 -07:00
Marno van der Molen 127ef683e7 make sure C:\tmp\ exists before downloading salt installer 2014-05-28 15:24:47 +02:00
Marno van der Molen d93a2c0e55 Made Salt Minion version to install a variable - ideally Salt would offer a -latest.exe or something for Windows 2014-05-28 11:09:59 +02:00
Emiliano Ticci 6bd7359c1b provisioners/puppet: run in elevated mode on Win guests 2014-05-26 11:23:14 +02:00
Kalman Hazins bb052366f7 Change symbols inside hashes to 1.9 JSON-like syntax 2014-05-22 12:35:12 -04:00
Marno van der Molen 500c40fd42 Now wait for service to be registered before trying to start it 2014-05-19 19:00:18 +02:00
Marno van der Molen 6c97874839 Wait for to be populated & explicitly check for Running status of service 2014-05-19 17:50:22 +02:00
Marno van der Molen fc3a2106fd Only try to copy keys & config if they have been uploaded 2014-05-19 15:52:20 +02:00
Marno van der Molen 1ddef49185 minor indentation fix 2014-05-19 14:10:58 +02:00
Marno van der Molen 6d0dd22864 Also copy minion config in bootstrap-salt.ps1 & update Salt docs to mention syndic/master not supported on Windows 2014-05-19 14:01:31 +02:00
Marno van der Molen 7cb50f8a12 Remove Salt Master & Salt Syndic changes - not supported on Windows by Salt 2014-05-19 14:00:46 +02:00
Marno van der Molen fbd919d52c Retries starting the salt-minion service several times and adds elevated: true to salt calls 2014-05-19 13:14:25 +02:00
Marno van der Molen 01f2c52251 sometimes salt-minion wouldn't start - this seems stable so far across 10 deploys 2014-05-17 03:38:57 +02:00
Marno van der Molen 2ddffa4fc6 redirect output of mkdir statement to out-null in bootstrap-salt.ps1 2014-05-17 03:31:24 +02:00
Marno van der Molen 02f40b35fa Adds minimal implementation to deploy a Salt minion on Windows including support for pre-seeding the keys 2014-05-17 02:19:34 +02:00
Paul Cooper @ Agile Barbecue 573683ef00 fix windows guest with puppet and a facter block
Powershell doesn't understand the unix-style ENV=thing command syntax, the old vagrant-windows plugin monkey patched the provisioner to put semicolons between statements to set the variables before running puppet - this fixes the issue inside a windows? block leaving the normal non-windows code path working - therefore works for me on both unix and windows provisions with a facter block in place
2014-05-13 17:31:31 +01:00
Mitchell Hashimoto 39eaaf3664 provisioners/puppet: windows module sep [GH-3731] 2014-05-09 09:22:36 -07:00
Fabio Rehm 1eec62cb9e provisioners/shell: Fix shell provisioning when config.binary is set to false [GH-3712]
The `config` in use was the Shell provisioner config that does not expose
access to the VM configs.

References https://github.com/fgrehm/vagrant-lxc/issues/284
2014-05-08 18:55:07 -03:00
Gilles Cornu 52a44de10c provisioners/ansible: show ansible-playbook in use
Motivation:
By printing out the ansible command used behind the scene, we can ease
the support effort to very quickly identify whether a problem is due to
Vagrant provisioner or Ansible itself.
2014-05-04 22:54:12 +02:00
deyk 567af495d4 Add colorization and log_level support to salt provisioner.
This commit adds two new options to the salt provisioner:

- `colorize`: controls color output. Defaults to no-color (present behavior).
- `log_level`: controls log level. Defaults to `debug` (present behavior).

Docs included!
2014-05-01 11:10:09 -07:00
Shawn Neal cc905d7923 Fix remote/downloaded shell scripts
The temporary shell script that we downloaded the script too was being deleted twice, thus causing an error on the secondary delete.
2014-04-30 19:39:37 -07:00
Shawn Neal 392269a8eb Default the WinRM shell provisioner to privileged (elevated) 2014-04-30 19:35:02 -07:00
Shawn Neal 068b5cf0b9 Move Windows symlink re-establishment after reboot into capability
This reduces the complexity and likelihood of provisioner bugs.
2014-04-30 17:36:36 -07:00
Mitchell Hashimoto f80fdfa32a privisoners/salt: proper bootstrap URL [GH-3583] 2014-04-30 15:32:20 -07:00
Timothy Messier 513a9bf1ab Set u+w perms on private keys in tmp dir.
This should allow additional `vagrant provision` calls to work when
using the salt provisioner and providing private keys. See #3542.
2014-04-29 11:13:12 -04:00
Mitchell Hashimoto 91c7fb7749 Merge pull request #3554 from mitchellh/chef-provisioner-cleanup
provisioner/chef: Chef provisioner cleanup with Windows
2014-04-27 15:51:30 -07:00
Timothy Messier adeaf29487 Fixed missing end to if 2014-04-27 12:36:01 -04:00
Timothy Messier b93c6df956 The various `install` args should always be passed to salt-bootstrap.
Even when preforming config only, the install flags (i.e. -M, -S, -N),
are used by the bootstrap to determine which configs to copy.

This should help with #3542 and should supersede #3548.
2014-04-27 12:34:24 -04:00
Shawn Neal cf71634813 DRY'd up Chef command building
There's very little difference between the command building on Linux and Windows other than path formatting. All Chef provisioners support the --no-color argument now.

Added unit tests to verify changes.
2014-04-26 21:07:26 -07:00
Shawn Neal ebca0e7e44 Fixed bug in CommandBuilderWindows
CommandBuilderWindows would not include the Chef binary in the command when the binary_path was specified in the config.

Backfilled unit tests for CommandBuilderWindows
2014-04-26 21:07:26 -07:00