Commit Graph

711 Commits

Author SHA1 Message Date
Kamjar Gerami 6754f8db14 #7084 - fixes-7084-notrunc-command-is-wrong-in-client.rb : corrected the -notrunc command to --no-trunc 2016-02-27 02:16:46 +01:00
Donald Guy 52c95ce291 Correctly detect chefdk install 2016-02-25 19:42:58 -05:00
Seth Vargo 8c68c6ec70 Use "stable" as the default Chef channel
Previously the default channel was "current", but after discussion with
@coderanger on GH-6979, it seems like this was a poor design decision.
Instead, we should use the stable channel and allow users to opt-in to
prerelease versions.

Fixes GH-6979
2016-02-08 10:49:48 -05:00
Seth Vargo 792ee8fb2d Merge pull request #6805 from gimler/double_sudo_fix
remove double sudo
2016-02-03 10:10:35 -05:00
Seth Vargo 2ec42ddc88 Merge pull request #6912 from gavioto/patch-1
Fixed an issue locating puppet binary. Issue-6876
2016-02-03 09:45:22 -05:00
Seth Vargo a524fc83ae Merge pull request #6806 from gimler/chef_suse
add chef installer for suse
2016-01-25 13:55:24 -05:00
gavioto20 d2e8086181 Fixed an issue locating puppet binary. Issue-6876 2016-01-21 20:14:43 +01:00
Gilles Cornu 4e451c6e99 provisioners/ansible_local: fix #6763
Before this change, the detection of a non-existing path on the guest
machine was considered as an error and lead to interrupt the current vagrant
action. This was actually a mistake to do so, since the config checks
are performed before many other vagrant actions than `provision`.
The config.validate phase is also intended to primarily check the options
sanity, but it cannot be too strict with the guest state (which can easily
get "out of automatic control").

With this change, we still apply these checks (when possible), but only warn
about possible configuration problems. This way, the subsequent
statements will happen anyway (e.g. ansible commands will be
executed, vagrant machine will be destroyed, etc.)
2016-01-17 11:27:23 +01:00
Gilles Cornu c2c1a443fd Merge commit 'refs/pull/upstream/6869' into gildegoma/ansible-bug-fixes
Fix #6793
2016-01-14 00:05:33 +01:00
Daniel Schreiber 9dbdb9397a fixing incorrect missing ansible error
At least for ansible 2.0.0.1 the command `ansible-galaxy --help` is inappropriate for testing if ansible is installed, as it yields an error:

```
vagrant@vagrant-ubuntu-trusty-64:~$ ansible-galaxy --help && echo "OK"          
Usage: ansible-galaxy [delete|import|info|init|install|list|login|remove|search|setup] [--help] [options] ...

Options:
  -h, --help     show this help message and exit
  -v, --verbose  verbose mode (-vvv for more, -vvvv to enable connection
                 debugging)
  --version      show program's version number and exit
ERROR! Missing required action
```
2016-01-13 23:05:39 +01:00
Shawn Neal e1a0b01e27 Fix issue 6762
Fixes error "The term '$?' is not recognized as the name of a cmdlet, function, script"
2016-01-06 13:37:28 -08:00
Gordon Franke d384478c06 add chef installer for suse 2016-01-05 15:31:28 +01:00
Gordon Franke 077f9142f7 remove double sudo 2016-01-05 15:23:22 +01:00
Gilles Cornu 1e38be237e provisioners/ansible: fix galaxy paths on Windows
Close #6757 and update previous fix for #6740 (#6741).

See also these places where the same regexp is used to address similar
"Windows cases":

 - ec85548bd6/plugins/provisioners/chef/provisioner/chef_solo.rb (L99-L103)
 - ec85548bd6/plugins/guests/windows/cap/rsync.rb (L6-L9)
2016-01-05 08:22:10 +01:00
char16t 07f3d0b00d Fix #6740: Ansible local provisioner: remove windows drive letter from path 2015-12-27 12:01:45 +03:00
KaffeJunky123 1cdd664918 Update docker_install.rb
Docker provisioning fails on Debian Jessie without the apt-transport-https package installed.
2015-12-23 16:45:20 +01:00
Seth Vargo 9de5126143 Convert env values to strings before escaping 2015-12-22 14:23:56 -05:00
Seth Vargo f780c96a90 Convert Chef Version to a string before comparison
Fixes GH-6709
2015-12-22 11:54:41 -05:00
Mitchell Hashimoto 811f21938a Merge pull request #6675 from michaa76/master
#6674 CFEngine Provisioner Broken on Debian (http > https)
2015-12-16 10:46:21 -08:00
michaa76 37d7239803 #6674 CFEngine Provisioner Broken on Debian (http > https) 2015-12-16 14:25:23 +01:00
Gilles Cornu ddbd2a4cfc provisioners/ansible: prefer ssh '-i' argument
In cd93721, I relied on a suprising combination of quotes to protect ssh
execution to strip the quoted path to the private key file.
Since any ssh command line argument can be passed via
`ANSIBLE_SSH_ARGS`, it is quite more readable and easy to rely on the
`-i` argument, which is not affected like `-o IdentityFile=...` and also
supports multiple occurences.

See also http://sourceforge.net/p/fuse/mailman/message/30498048/

Finally fix #6671

Note that I decided to not squash both commits for better
documentation and traceability.
2015-12-16 10:29:13 +01:00
Gilles Cornu cd93721f8f provisioners/ansible: use quotes for the IdentityFile OpenSSH command line arguments
Surprisingly (to me at least), a simple quote enclosure was not enough
to fix the problem.

Caveat: the stringified ansible-playbook command logged in verbose mode
is wrongly formatted (no quotes are escaped).

Fix #6671
2015-12-16 09:54:53 +01:00
Gilles Cornu 25ff027b08 provisioners/ansible_local: use the inventory directory
Like in the (remote) `ansible` provisioner, it is preferred to pass the
directory that contains the generated inventory file. This way, advanced
inventory usages can be achieved by adding more inventory files into the
same directory.

Related to #2103 and #6500

[ci skip]
2015-12-08 23:02:58 +01:00
Gilles Cornu a8d0c225c6 Merge pull request #6649 from rickard-von-essen:issue-6636
Close #6636

Note that there is no CHANGELOG entry for this bug fix, since the
`ansible_local` provisioner [#2103] has not been released yet.
2015-12-07 22:41:06 +01:00
Gilles Cornu a0980aa8be provisioners/ansible: minor code formatting change
[ci skip]
2015-12-07 22:30:13 +01:00
Gilles Cornu 850716b220 provisioners/ansible: remove erroneous comment
[ci skip]
2015-12-07 22:28:23 +01:00
Rickard von Essen 9f3ebef810 Support ansible install on RedHat derivates and Fedora.
Fixes #6636
2015-12-07 15:44:20 +01:00
Kamjar Gerami b7e9437a77
#3539 - Fixed syntax, language and logic according to comments made by reviewer in PR #6639 2015-12-04 10:05:07 +01:00
Kamjar Gerami 5cbbbb5e28 #3539 - Can't use alphanumeric patterns for box names in ansible.groups: Changed iteration logic for warning message and fixed regex typo 2015-12-04 01:29:22 +01:00
Kamjar Gerami 934bcf9419 #3539 - Can't use alphanumeric patterns for box names in ansible.groups: Host Range Pattern Regex, notification and updates to provisioning web source 2015-12-04 01:13:59 +01:00
Gilles Cornu 4c137a9b6b provisioners/ansible: fix comment indentation
[ci skip]
2015-12-03 09:36:57 +01:00
Gilles Cornu 9867281971 provisioners/ansible: allow symbol in `groups` key
After c49a146467, it makes even more sense
to support Symbol datatypes in `groups` option handling.
2015-12-03 09:34:53 +01:00
Gilles Cornu c49a146467 provisioners/ansible(both): alias String-to-Symbol
String and Symbol types are different when used as a Hash key. By
default the Vagrant machine names are set in Symbol format, but users
may write their `host_vars` entries with String keys. This is a very
simple way to ensure smooth experience, without having to coerce the
data types during the config validation (e.g. with a library like
Hashie, which is currently not in the Vagrant dependencies)

See also:
- https://bugs.ruby-lang.org/issues/5964#note-17
- https://github.com/intridea/hashie#keyconversion
2015-12-02 08:37:41 +01:00
Christian Henz 77b11a989c Implemented host_vars option. 2015-12-01 18:56:28 +01:00
Christian Henz dd4ae1a51c Parse and insert group variables into the generated inventory. 2015-12-01 18:56:28 +01:00
Gilles Cornu eaf918ec35 Merge branch 'gildegoma/5086-ansible-winrm' into master 2015-11-25 22:46:08 +01:00
Seth Vargo 930e166b47 Add :env option to shell provisioner 2015-11-23 19:29:35 -05:00
Seth Vargo 8c3f833e8e Use the new presence helpers in the Chef provisioner 2015-11-23 18:33:47 -05:00
Gilles Cornu ee55379736 provisioner/ansible: support winrm connection mode
This is a first cut to resolve #5086.
2015-11-21 05:34:50 +01:00
Gilles Cornu 2789ce61e0 Merge branch 'gildegoma/2718-ansible-galaxy' into master 2015-11-21 05:21:41 +01:00
Seth Vargo 1b08cfcd09 Do not fail if uninstalling lxc/docker-io fails 2015-11-19 18:37:57 -08:00
Seth Vargo bad4c2103d Only install Docker if it is not already installed 2015-11-19 18:37:57 -08:00
Seth Vargo f5a0c3ed5b Deprecate docker.version 2015-11-19 18:37:57 -08:00
Jason Casden 7076d192c9 Quiet package commands 2015-11-19 18:37:57 -08:00
Jason Casden d2983d4fe4 Use official Docker installer and upgrade for :latest installs 2015-11-19 18:37:57 -08:00
Seth Vargo ec85548bd6 Support arrays for data_bags_path
Fixes GH-5988
2015-11-19 16:17:42 -08:00
Seth Vargo 1fd9aec493 Only append folder suffixes if we are sharing host folder paths
Fixes GH-6472
2015-11-19 16:08:32 -08:00
Seth Vargo 76f3dce5db Remove deprecated options 2015-11-19 15:52:27 -08:00
Seth Vargo df207d2637 Require nodes_path for Chef Zero provisioning
Fixes GH-6110
2015-11-19 15:52:26 -08:00
Gilles Cornu 2384032446 provisioners/ansible: freeze a constant value
Kudos @sethvargo :)

[skip ci]
2015-11-20 00:21:41 +01:00
Gilles Cornu 6dbc74d814 provisioners/ansible: fix code indentation 2015-11-20 00:13:01 +01:00
Gilles Cornu c9fe02cea5 provisioners/ansible_local: remove repetitions 2015-11-20 00:11:44 +01:00
Gilles Cornu 74eb3109cf provisioners/ansible_local: fix a lame bug
I missed to rename the refactored exceptions as AnsibleCommandFailed in
the guest-based parts. The lack of unit tests for these parts hurts...
on my agenda, I swear!
See c1f3d114f5
2015-11-20 00:07:34 +01:00
Seth Vargo c30467a6f9 Allow Chef to install on Windows 2015-11-19 15:01:09 -08:00
Seth Vargo a90e6cfe4c Use the new Chef installation channel and options
This deprecates "prerelease", which will be removed in the next release.
2015-11-19 14:57:01 -08:00
Seth Vargo 43ef927628 Latest will have the formatter option 2015-11-19 14:56:18 -08:00
Seth Vargo 2dbd24129f Remove deprecated method 2015-11-19 14:56:03 -08:00
Seth Vargo 609ff9f7b2 Allow provisioner cleanup task to exit on failure 2015-11-19 14:55:46 -08:00
Gilles Cornu 5659c3f2a0 provisioners/ansible: apply @sethvargo comments
Follow-up of code review of PR #6529
2015-11-19 23:42:01 +01:00
Seth Vargo b8f200a4c1 Only force the formatter if we are on Chef 11 or higher
Fixes GH-6278
2015-11-19 11:48:04 -08:00
Seth Vargo 9559fc549c Automatically generate a node_name for Chef
This is required because the Chef Server almost always needs a node name to
interact. This will default to the hostname, but that's always going to be
`vagrant.vm`, which will collide easily.

This generates a random hostname with `vagrant-` as the prefix and stores the
result in the machine's data directory.
2015-11-19 11:38:33 -08:00
Seth Miller c8a18fda26 Fixing the Salt bootstrap script for Windows
The URL for the download has changed as per issue #6274
2015-11-18 21:55:32 -06:00
Seth Vargo f999218c53 Perform Chef delete operations on the guest instead of the host 2015-11-18 18:28:42 -08:00
Seth Vargo a1a3824e35 Do not throw an error when the Chef node_name is nil 2015-11-18 16:56:31 -08:00
Seth Vargo 244069d5d7 Merge pull request #6049 from bdwyertech/bdwyertech-patch-2
Chef Zero - Fix 'nodes_path' Support
2015-11-18 16:46:02 -08:00
Mitchell Hashimoto c43e0af4d7 Merge pull request #6382 from sophicware/fix/salt-provisioner-install-args
[salt] [bugfix] Restablize Salt provisioner
2015-11-18 15:19:02 -08:00
Mitchell Hashimoto 394f66468d Merge pull request #6489 from invernizzi/master
Update docker installer to work on custom kernels
2015-11-18 15:16:32 -08:00
Mitchell Hashimoto fbdb6c0d19 Merge pull request #6474 from aneeshusa/enable-salt-options-for-masterless
Enable log_level and colorize for salt masterless
2015-11-18 15:11:54 -08:00
Mitchell Hashimoto f5f596ab8b Merge pull request #6389 from grafjo/fix_6151
Fix for #6151 / provisioner puppet_server with Puppet Collection 1
2015-11-18 14:59:58 -08:00
Seth Vargo 72d62e3d2e Merge pull request #6404 from timotei/patch-1
Remove back tick in puppet facts definitions #6403 (Fix vagrant 1.7.3+ with puppet)
2015-11-18 14:02:48 -08:00
Mitchell Hashimoto 90b850aa49 Merge pull request #6307 from tbriggs-curse/fix/master/6306_chef_windows_capability
Fix/master/6306 chef windows capability
2015-11-18 13:48:48 -08:00
Mitchell Hashimoto a31f505731 Merge pull request #6288 from rickard-von-essen/dnf
Use dnf on Fedora guests instead of yum if available.
2015-11-18 13:37:22 -08:00
Mitchell Hashimoto c200190c5b Merge pull request #6259 from philipwigg/5943-fix-puppet-verify-binary
Fix verify_binary for Puppet for Windows guests.
2015-11-18 13:15:34 -08:00
Mitchell Hashimoto e6098f6c4f rename to powershell_elevated_interactive 2015-11-18 12:51:18 -08:00
Mitchell Hashimoto dde21bc95a fix file permissions 2015-11-18 12:48:41 -08:00
Mitchell Hashimoto 37940e7350 Merge pull request #6185 from marc-ta/elevated_interactive
Elevated interactive
2015-11-18 12:46:39 -08:00
Mitchell Hashimoto fedc7e21b3 provisioners/salt: deprecate config_dir 2015-11-18 11:56:07 -08:00
Mitchell Hashimoto 6c250d023e Merge pull request #6073 from johntron/revert-74d22069
Stop trying to upload minion config to privileged directory
2015-11-18 11:52:06 -08:00
Mitchell Hashimoto ab1c0a889c Merge pull request #6050 from benh57/fix_environment_error
Fix string parse error in the environment path missing error message.
2015-11-18 11:40:41 -08:00
Mitchell Hashimoto 6639d56c9c Merge pull request #5999 from PatOShea/patch-4
Correct salt-minion and call ext on windows guest
2015-11-18 11:39:09 -08:00
Mitchell Hashimoto 7f25d49e81 Merge pull request #5991 from Mattias-/fix-puppet-environment-manifest
Fix puppet apply environment default manifest
2015-11-18 11:31:54 -08:00
Gilles Cornu 819c9b6425 provisioners/ansible_local: align console outputs
Use "info" level for main tasks (installing ansible, running galaxy,
running playbook).
Use "detail" level for subsequent details.
2015-11-18 09:37:27 +01:00
Gilles Cornu c1f3d114f5 provisioners/ansible(both): add galaxy support
Close #2718
2015-11-17 22:08:29 +01:00
Gilles Cornu a0576349fe provisioners/ansible(both): reorganize i18n texts
These adaptations will make even more sense with the upcoming
introduction of `ansible-galaxy` support.
2015-11-17 22:08:18 +01:00
Gilles Cornu 75cc6ef8d3 provisioners/ansible_local: fix a str-to-sym bug
Without this change `ansible.version = "latest"` is not considered as
equivalent to `ansible.version = :latest`.
2015-11-12 09:14:35 +01:00
Gilles Cornu a3c077cbe0 Merge branch 'gildegoma/ansible-force-ssh-user'
Resolved conflicts in
  plugins/provisioners/ansible/config.rb
  plugins/provisioners/ansible/provisioner.rb
  test/unit/plugins/provisioners/ansible/provisioner_test.rb
  website/docs/source/v2/provisioning/ansible.html.md

ref #6348
2015-11-08 14:01:23 +01:00
Gilles Cornu 9bfdaf7e75 provisioners/ansible: introduce ansible_local
With this change, the existing host-based Ansible provisioner is
refactored to share a maximum of code with this new guest-based Ansible
provisioner.

At this stage of development, the existing unit tests are intentionally
modified as little as possible, to keep safe the existing funtionalities.

Other issues resolved by this changeset:
 - Display a warning when running from a Windows host [GH-5292]
 - Do not run `ansible-playbook` in verbose mode when the `verbose` option
   is set to an empty string.
2015-11-08 10:42:48 +01:00
Luca Invernizzi df32f6ac51 Update docker installer to work on custom kernels
The current docker installer attempt to install the linux-image-extra-`uname -r` DEB package on Debian systems.
This package may not exist, for example on custom kernels (e.g., Linode servers).
If this happens, Vagrant halts the provisioning. However, this package is not really needed in newer Debian releases (such as Ubuntu 14.04).

This small patch checks if the linux-image-extra-`uname -r` package exists, and it will install it if it does. In either case, it will continue provisioning.
2015-11-05 13:56:13 -08:00
Aneesh Agrawal 84408c1682 Enable log_level and colorize for salt masterless 2015-11-02 20:57:29 -05:00
Gilles Cornu dde94a3ce7 provisioners/ansible: add force_remote_user option
The benefits of the following "breaking change" are the following:
- default behaviour naturally fits with most common usage (i.e. always
  connect with Vagrant SSH settings)
- the autogenerated inventory is more consistent by providing both the
  SSH username and private key.
- no longer needed to explain how to override Ansible `remote_user` parameters

Important: With the `force_remote_user` option, people still can fall
back to the former behavior (prior to Vagrant 1.8.0), which means that
Vagrant integration capabilities are still quite open and flexible.
2015-11-02 09:03:15 +01:00
Timotei Dolean 13be9731ab Remove back tick in puppet facts definitions #6403
Starting with vagrant 1.7.3 
(commit 1152b4e1df) we don't
save the command to be executed in the file anymore, but we send
it as a parameter, thus the back tick makes things worse.
2015-10-16 16:20:15 +03:00
Dan Dunckel 9d87be51da Small refactor on conditional check and add tests 2015-10-15 12:25:50 -07:00
Marc Siegfriedt 8e87990599 add the option to make elevated interactive scripts 2015-10-15 12:25:50 -07:00
Johannes Graf 9998544995 Fix for #6151 / provisioner puppet_server with Puppet Collection 1
puppet_server provisioner fails with Puppet Collection 1 with the
following error:

```bash
==> default: Running provisioner: puppet_server...
The `puppet` binary appears not to be in the PATH of the guest. This
could be because the PATH is not properly setup or perhaps Puppet is not
installed on this guest. Puppet provisioning can not continue without
Puppet properly installed.
```
2015-10-10 21:16:12 +02:00
Jurnell Cockhren 86e56aeac3 Revert "Salt Provisioner: Added a 'custom' option to install_type to allow more flexibility in passing arguments to the bootstrap script. Updated the docs."
This reverts commit 0289ab986c.

Refers to issues #6276, #5973, #5936 and #5435

Conflicts:
	website/docs/source/v2/provisioning/salt.html.md
2015-10-08 15:01:00 -05:00
Jurnell Cockhren 1a7c6dcfeb Revert "Salt Provisioner: refactor custom install_type option to add install_command instead"
Refers to issues #6276, #5973, #5936 and #5435

This reverts commit 72e63767ac.

Conflicts:
	website/docs/source/v2/provisioning/salt.html.md
2015-10-08 15:01:00 -05:00
Jurnell Cockhren fb611c7389 Revert "Initialize the install_command salt config var"
Refers to issues #6276, #5973 and #5936

This reverts commit ccd7354665.
2015-10-08 15:01:00 -05:00
Jurnell Cockhren 70e9079449 Revert "Fix alignment of initializer"
Refers to issues #6276, #5973 and #5936

This reverts commit 27d7518636.
2015-10-08 15:01:00 -05:00
Brian Dwyer fd593a85b7 Add `nodes_path` support for the Chef-Solo provisioner 2015-09-27 23:23:28 -04:00
Trey Briggs a5b6e23e20 Removed extra quote in powershell command. 2015-09-22 23:28:14 -05:00