552 Commits

Author SHA1 Message Date
Gilles Cornu
a842abbc38
provisioners/ansible(both): Add config_file option
With this new option defined, the `ansible-galaxy` and
`ansible-playbook` commands generated by the Ansible provisioners will
be executed with the ANSIBLE_CONFIG environment variable set
accordingly.

Resolve GH-7195

This commit also fix the following open issues:
- Implement the pending RSpec examples about path existence checks
  performed by the ansible (remote) provisioner.
- In verbose mode, the ansible remote provisioner now correctly displays
  the Ansible Galaxy parameters ("role_file" and "roles_path") with
  single quotes (which is safer for potential copy-paste usage).

Additional Notes:
- Test coverage for `ansible_local` provisioner is still not
  implemented. See GH-6633.
- Test coverage for galaxy from host is not implemented yet (due to
  general issue with mocking both command executions, see
  https://github.com/mitchellh/vagrant/pull/6529#r45278451
2016-10-22 01:09:12 +02:00
Gilles Cornu
b1ddc98e17
Merge pull request #7881 (Add playbook_command option)
Note that error messages were not adapted, and only mention
a generic "Ansible Software" when executed commands are failing.
We assume that people using the `playbook_command` option are
advanced users that will know all the components to be considered.
2016-10-10 23:18:24 +02:00
Chris Roberts
07ce1c6930 Merge pull request #7866 from chrisroberts/guest-linux/network-interfaces-sorting
guests/linux: Update network interface sorting implementation
2016-10-10 10:59:52 -07:00
Chris Roberts
7eb1091a71 Merge pull request #7874 from chrisroberts/enhancement/cast-box-version
config/vm: cast box version to string before string operations
2016-10-10 10:57:53 -07:00
Chris Roberts
a8970281ce guests/linux: Properly sort interface name types
Add failing networking interface list sorting test with example
provided by #7883. Update sorting logic to properly handle different
types and differing array lengths.

Fixes #7883
2016-10-10 10:22:19 -07:00
Daniel Gonzalez
79a3cb8a14 Add unit test and documentation for playbook_command option 2016-10-10 16:56:36 +02:00
Daniel Gonzalez
58f2b0c8c7 Make ansible-playbook command configurable
The ansible-playbook command is currently hardcoded for the ansible and
ansible_local provisioners. This patch adds the config option
playbook_command to allow the user to change the command.
2016-10-09 20:48:50 +02:00
Mark Peek
4bf32e3f6d Fix typo (netmast => netmask) for Photon guest #7808 2016-10-07 12:32:21 -07:00
Chris Roberts
26b3a303d2 config/vm: cast box version to string before string operations 2016-10-06 16:16:59 -07:00
Chris Roberts
e2b18fc65d guests/linux: Update network interface sorting implementation
Always pull ordered ethernet devices to the head of the list. Ensure
aliases are not included.
2016-10-04 17:25:00 -07:00
Chris Roberts
f72cd286c1 Merge pull request #7831 from mwrock/nano
Use the cmd shell to check winrm availability to fix `vagrant up --no-provision` on nano
2016-09-30 16:16:42 -07:00
Chris Roberts
2e6b23c8fd Merge pull request #7848 from chrisroberts/fix/eth-first-predictable
guests/linux: Place ethernet devices at start of device list
2016-09-30 14:50:08 -07:00
Chris Roberts
0300df09fb guests/linux: Update constant name, freeze constant values 2016-09-30 12:11:54 -07:00
Chris Roberts
6e6b35f1c5 Merge pull request #7712 from mwrock/executor
fix #7489 preventing winrm connection leakage
2016-09-30 09:10:42 -07:00
Chris Roberts
9f468d2626 guests/linux: Place ethernet devices at start of device list 2016-09-29 15:33:29 -07:00
Matt Wrock
c5e1a6d8c0 use the cmd shell to check winrm availability 2016-09-26 14:07:11 -07:00
Gilles Cornu
e8cf9bb168
provisioners/ansible: review pull request #7752
- Honour `ssh.proxy_command` setting (even when the Docker provider is
  used via a proxy host). Silly configurations may lead to silly
  behaviors, but let's apply the settings...
- Remove condition on `provider_config.connect_via_ssh`, which is
  a provider specific parameter (from vagrant-libvirt provider).
- Add a simple unit test
2016-09-21 23:40:20 +02:00
Chris Roberts
a7537a6be0 Merge pull request #7726 from chrisroberts/fix/rsync-exclude
Ignore files excluded from sync on chown
2016-08-19 09:58:31 -07:00
Chris Roberts
5e44e308a5 Merge pull request #7725 from chrisroberts/fix/package-machine-dir
Machine data directory for base box package
2016-08-19 09:48:38 -07:00
Chris Roberts
dd6ad2fbf3 guests/linux: only use effective group ID when appropriate 2016-08-17 06:53:26 -07:00
Chris Roberts
f577ca3d23 commands/package: provide machine data directory for base box 2016-08-17 06:49:12 -07:00
Chris Roberts
185a7dfc2e guests/rsync do not chown files excluded from sync 2016-08-16 15:13:19 -07:00
Matt Wrock
64828f1ed3 fix #7489 preventing winrm connection leakage 2016-08-13 07:49:08 -07:00
Chris Roberts
dd91269491 guests: Prevent ssh disconnect from causing error on halt 2016-08-12 13:25:39 -07:00
Chris Roberts
ce3329e184 guests/linux: Always order discovered network interfaces 2016-08-12 10:31:41 -07:00
Chris Roberts
f122afeed2 Add more coverage on ssh connector on connect behavior. Remove subject usage. 2016-08-11 15:39:09 -07:00
Chris Roberts
9d4962c836 communicator/ssh: Add test coverage 2016-08-11 13:26:56 -07:00
Chris Roberts
aadf1ba5ae Use common hash key style within project 2016-08-11 13:07:25 -07:00
Chris Roberts
597f49dda8 Add failing rsync test checking for private key option inclusion 2016-08-11 12:59:26 -07:00
Zack Train
cb70749bd8 redux of pr 7398 for ssh-agent key fix 2016-08-11 11:48:10 -07:00
Chris Roberts
571659a5d1 guests/openbsd: include -h option on shutdown
For OpenBSD versions prior to 5.7 the `-h` option _must_ be provided
to the `shutdown` command when `-p` is used. Later versions no longer
require the `-h` option but still allow it for compatibility.

http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sbin/shutdown/shutdown.8?rev=1.40&content-type=text/x-cvsweb-markup
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sbin/shutdown/shutdown.c?rev=1.40&content-type=text/x-cvsweb-markup
2016-08-10 09:14:08 -07:00
Charlie Sharpsteen
4144b45122 Fix RDP connections on OS X
Changes introduced in 982af05 caused the RDP configuration file to be written
with all settings on one line instead of one setting per line. The Microsoft
Remote Desktop client for OS X rejects these configuration files as being
malformed. This patch restores the configuration to one line per setting and
adds tests to guard against regression.
2016-08-09 14:04:50 -07:00
Jose Luis Duran
820607bbf6 Fix authorized_keys permissions for BSDs
This is an extension of a6760dd8e7743e048cb2f38c474e05889356e8ac,
applied to BSD guests.

Related to #7610
2016-07-25 18:25:58 -03:00
hendrenj
41063204ca added unit tests for .remove_public_key method in VagrantPlugins::GuestLinux::Cap 2016-07-19 11:45:46 -06:00
Colin Shea
b31b240c8c
Support installing synced folder clients on arch 2016-07-18 22:33:04 -04:00
Seth Vargo
1849990517
Fix tests 2016-07-18 21:31:25 -04:00
Seth Vargo
8f3b6511f2
guests/linux: Add shared cap for listing network interfaces 2016-07-18 21:12:54 -04:00
Seth Vargo
66cbe7b41e
Fix failing tests 2016-07-18 21:12:53 -04:00
Seth Vargo
851eff1288
guests/linux: Ensure NFS retries when mounting
Fixes GH-7443
2016-06-19 14:34:33 -04:00
Seth Vargo
2cbc819298 Merge pull request #7484 from mitchellh/sethvargo/bsd_halt
guests/bsd: Centralize logic for halting guests
2016-06-18 15:12:09 -04:00
Seth Vargo
07e6d0e707
guests/bsd: Centralize logic for halting guests 2016-06-18 15:06:20 -04:00
Seth Vargo
3f27af7e95
core: Provide a way to globally disable box update checking
This adds a new environmental variable `VAGRANT_BOX_UPDATE_CHECK_DISABLE`,
which instructs Vagrant to not check for box updates when running
regular Vagrant commands. This behaves the same as the existing
`config.vm.box_update_check` configuration option, but can be set
globally. Vagrantfile-supplied options will take precedence.

Fixes GH-7479
2016-06-18 14:46:46 -04:00
Satoshi Matsumoto
de9abc8f72
guests/redhat: fix network configuration in CentOS 5
ip command is not on PATH by default in CentOS 5 so call it with the full path.
2016-06-18 14:14:25 -04:00
Seth Vargo
6284a9ac50
guests/bsd: Move NFS mounting logic into shared
A number of the BSD guests used very old mounting options or just
ignored some parameters entirely. This fixes that.

- Closes #7474
- Fixes #7466
2016-06-17 21:04:23 -04:00
Seth Vargo
0c268f7b3f
guests/bsd: Add shared BSD guest for common behavior 2016-06-17 20:16:36 -04:00
James Wilson
358ad8f18f Use ip instead of deprecated ifconfig for Red Hat/CentOS guests 2016-06-16 10:06:58 +01:00
Eugene Zamriy
eaa4e11c62 Add CloudLinux 7 to RHEL 7 flavors. 2016-06-12 16:51:55 +03:00
Gilles Cornu
a7dfc73b85 provisioners/ansible: honor galaxy_roles_path when running ansible-playbook
This commit include the following changes:
- systematically set ANSIBLE_ROLES_PATH environment variable when
  galaxy_roles_path is defined.
- slightly refactor to introduce the concept of "provisioning working
  directory" (possible usage in the future for resolving GH-7195)
- fix a bug in ansible-galaxy execution by the ansible_local provisioner
  if the paths contains blank characters.

Fix #7269
2016-06-11 07:28:05 +02:00
Gilles Cornu
bb9dba56ac provisioners/ansible_local: add "pip" install_mode
These changes have been validated against the following guest systems:
- Debian 7 and 8
- Ubuntu 12.04, 14.04 and 16.04
- Fedora 21 and 23
- CentOS 7
- OracleLinux 7
- Scientific Linux 7

At the moment, the pip setup (via get-pip.py script) is not working for
RHEL6-like systems (CentOS 6.6, OracleLinux 6.5, Scientific Linux 6),
because Python 2.6 has been deprecated and is no longer supported by
Python core team. I consider this limitation with low priority in
Vagrant context.

The `:pip` install_mode is currently not implemented for the following
platforms:
- OpenSUSE
- ArchLinux
- FreeBSD

Known Issue: By using get-pip.py script, any previous pip installation
will be most probably overrided. This could be an issue for Python
developers who would prefer to keep their base box setup untouched. In
future iteration, it could be possible to choose to reinstall/upgrade
pip or not. issue for Python developers who would prefer to keep their
base box setup untouched. In future iteration, it could be possible to
choose to reinstall/upgrade pip or not.

Resolve GH-6654

Resolve GH-7167 as the `version` option is now considered to select the
version of Ansible to be installed.
2016-06-08 23:53:58 +02:00
Seth Vargo
073e65abf0 Merge pull request #7387 from phyber/fix/master/prepare_nfs_settings_scoped_hash_overrides_fix
Fix/master/prepare_nfs_settings scoped hash overrides fix
2016-06-06 18:41:13 -04:00