875 Commits

Author SHA1 Message Date
sophia
2ddd12047c Ensure windows files get an extension 2020-04-17 10:31:24 -04:00
Sophia Castellarin
ee87596a77
Merge pull request #11462 from soapy1/docker-provision-centos8
Docker provision centos8
2020-04-13 09:42:37 -04:00
Brian Cain
dda2c8f913
Merge pull request #11411 from thunder-spb/alpine-ansbile-support
Alpine capability for Ansbile support
2020-04-08 09:43:53 -07:00
sophia
e61725a130 Docker provision to support centos guest, not RHEL guest 2020-04-06 13:48:43 -04:00
Alexzander thunder Shevchenko
4caa5e1434 Setting python version back to 3.x since there some issues with Ansible version detection for pip installation. 2020-04-05 15:03:01 +03:00
Alexzander thunder Shevchenko
d1d214f6e2 Set python version to 2.7 as all other ansible provisioners do 2020-04-05 14:46:33 +03:00
Alexzander thunder Shevchenko
d73c2c5fa7 Get back to install pip via get_pip script 2020-04-05 14:28:19 +03:00
sophia
311fb035e6 Don't install docker on RHEL
Docker CE is not supported on RHEL.
It is supported on CentOS
2020-04-03 15:14:03 -04:00
sophia
d87d421586 Install docker using docker repo instead of convenience script
This approach will be more stable than depending on a convenience
script provided by docker

ref: https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-convenience-script
2020-04-01 15:05:48 -04:00
sophia
f7d6070b0d Raise error when trying to install docker on centos8 2020-03-27 10:05:01 -04:00
sophia
60b05426e1 Install containerd.io from docker on rhel_8
containerd.io is required for docker howerver it is not avilable
in official yum repos. It needs to be installed directly from
docker.

ref:
https://docs.docker.com/install/linux/docker-ce/centos/
https://linuxconfig.org/how-to-install-docker-in-rhel-8
2020-03-25 10:40:31 -04:00
Alexzander thunder Shevchenko
e3461d354b python3 setup
Python 3 setup for any mode;
Move python setup to separate method;
2020-03-07 16:31:55 +03:00
Chris Roberts
852c549886 Force powershell on connection for consistent behavior
This patches the connection instances generated for the winssh
communicator so when a command is executed it is always run
with powershell. This prevents inconsistencies with argument
handling based on what the default shell is set to on the remote
side.

Since powershell is the default, environment variable template
only needs to be set for powershell style. If the shell setting
is updated to `cmd`, the command will be properly prefixed.

Default shell has been updated to powershell, to prevent extraneous
wrapping where it's not required. The `#ready?` check has also been
updated to use a constant value, which is overridden within winssh
as a blank command is invalid.
2020-03-04 15:08:03 -08:00
Jeff Bonhag
9a26c123b9 Use SFTP for Windows file transfer
SFTP is more reliable than SCP when dealing with unknown sshd
configurations on the server side. It also provides a convenient
facility for creating remote directories, so we can remove the
Windows-specific `#create_remote_directory` method.
2020-03-04 15:08:03 -08:00
Jeff Bonhag
b2aa16dc78 Set remote script extension from local script extension 2020-03-04 15:08:03 -08:00
Jeff Bonhag
85f0fce57a Allow #provision_winrm to modify upload_path
We need to ensure that Windows files have an extension when provisioning
via WinRM.
2020-03-04 15:08:03 -08:00
Jeff Bonhag
4b7d55afaa Fixup paths to work with server-side Bash
This commit normalizes our Windows paths to use `/` instead of `\`.
These paths are compatible with both cmd and PowerShell, and are
required if the server-side shell is set to Bash.

The OpenSSH server executes all commands inside a default login shell
which cannot be controlled by the Vagrant configuration. So what ends up
getting executed on the server side looks something like this:

    "c:\\program files\\git\\bin\\bash.exe" -c "C:\\Windows\\Temp\\vagrant-ssh20200130-41670-1w5nsjy.bat"

By flipping the direction of the directory slashes, we end up with:

    "c:\\program files\\git\\bin\\bash.exe" -c "C:/Windows/Temp/vagrant-ssh20200130-43415-f1d5n2.bat"

This works whether the server-side shell is set to cmd, powershell, or
bash.
2020-03-04 15:08:03 -08:00
Jeff Bonhag
8affdd24b6 Wire up inline command for popular Windows shells
* Remove connection between shell provisioner directory config and WinSSH
directory config because these should remain separate.
2020-03-04 15:08:03 -08:00
Jeff Bonhag
df7c11a3a7 Fix issues with Windows SSH provisioner
Windows commands that run over SSH are wrapped in a script that writes a
special marker to the two output streams (stdout and stderr).  This
allows Vagrant to consume the output streams.

Unfortunately, this leads to a sort of chicken-and-egg problem where no
commands can be run before a wrapper script exists. For example, you
can't make a destination directory to upload the wrapper script without
first creating a wrapper script to make the directory. :)

This commit changes the behavior of the WinSSH communicator to assume
that the destination directory already exists for provisioning scripts.

It also moves the default `upload_path` from the shell provisioner
config so we can have OS-specific defaults.

Finally, it introduces a Windows-specific #upload method which will
properly use a Windows path separator on a non-Windows host.
2020-03-04 15:08:03 -08:00
Alexzander thunder Shevchenko
8aa1aee155 Cleanup redundant lines 2020-02-23 20:33:53 +03:00
Alexzander thunder Shevchenko
24a3016f2b Add Alpine into provider capability 2020-02-23 20:31:07 +03:00
Alexzander thunder Shevchenko
5ea65e9534 Add Alpine Ansible capability 2020-02-23 20:30:35 +03:00
Jose Luis Duran
582f46231b
FreeBSD: Update Ansible's package name
The Ansible package in FreeBSD is now `py36-ansible`.

If `pkg` itself needs updating, passing only one 'yes' is not enough to
confirm the installation of the package.  Use the `-y` option,
specifically made for this purpose.  Also add `-q` to force a quiet
output, inline with other guests.

References:

- [`pkg-install(8)`](https://www.freebsd.org/cgi/man.cgi?query=pkg-install&sektion=8)
- freebsd/freebsd-ports@cbf5576945
2019-12-17 12:53:24 -08:00
Gilles Cornu
bcdda99dfa
ansible_local: Fix pip setup on Arch Linux guest
Add 'python' package requirement. Tested against `archlinux/archlinux`
box, at version "2019.11.24".
2019-12-17 12:51:39 -08:00
Gilles Cornu
069122f42c
[minor] Align Ruby formatting across ansible_local files
GH-11148: Remove unwanted formatting changes proposed in 920361150f9b91fa1b544d024432c300471f20f3.
2019-12-17 12:51:39 -08:00
Gilles Cornu
a2b87eace4
Fix broken 'ansible_install' methods signature
- By the way: Trim the generate 'pip install' command in Ansible::Cap::Guest::Pip::pip_install
- GH-11048: Fix same regression for FreeBSD and SuSE guests.
- GH-6633:  Add RSpec examples to cover ansible_local 'cap' code.

Note: RedHat/Fedora guests are not covered yet by unit tests.
2019-12-17 12:51:39 -08:00
Stefan Koenen
04aeff4cc6
FIX #11048, add parameter pip_install_cmd to ansible_install.rb for arch guest.
ADD: Handling of `pip_install_cmd` in `ansible_install.rb` for arch guest.
2019-12-17 12:51:39 -08:00
Sam Mesterton-Gibbons
e4ab40393e Don't prompt for input when installing Ansible
Sets `DEBIAN_FRONTEND=noninteractive` and tells `dpkg` to take the old
version of config files when installing Ansible, to prevent hangs
waiting for user input.

Fixes #10914
2019-11-01 17:17:03 +00:00
Chris Roberts
7fb81bcea1 Add support for other checksum types 2019-10-08 11:23:48 -07:00
Brian Cain
0a6c4e2d0f
Ensure relative path for file provisioner is relative to machines cwd
Prior to this commit, if you ran Vagrant in a different current working
directory other than where a current guest machines location is, the
file provisioner would not take into account the machines local dir, and
would instead use the path where Vagrant was invoked to expand the
`source` path option for a file provisioner. This commit fixes that by
passing the root path `machine.env.cwd` when expanding the source dir.
2019-10-02 15:33:23 -07:00
Brian Cain
96c20ad3cc
Fixes #10950: Ensure pip_install_cmd is finalized
Prior to this commit, the `pip_install_cmd` option for ansible guest
config was not properly finalized. This commit ensures that if that
value is still UNSET_VALUE, it gets set to empty string in the finalize!
method.
2019-10-02 10:33:31 -07:00
Jose Luis Duran
6c4b537c82 FreeBSD: Remove APT-ism
No functional change intended.
2019-09-17 03:58:37 -03:00
Brian Cain
6e4eb66cb1
Fix windows binary check for chef provisioner 2019-06-17 14:06:03 -07:00
Brian Cain
d55f8d3496
Fixes #10912: Update chef install check for guests
Prior to this commit, the chef_installed capability was looking for a
string that has recently changed in newer versions of chef. This commit
fixes that by instead just looking for the right version that was
configured for the chef client, rather than the specific string that
could change again in the future.
2019-06-17 11:02:57 -07:00
Brian Cain
139ae4397f
Merge pull request #10625 from vdebroy/fix-issue-9584
Fix issue 9584
2019-04-09 15:12:02 -07:00
Chris Roberts
6b105d704d Update communicator upload behavior to handle /. path directives
This update was prompted by updates in openssh to the scp behavior
making source directory paths suffixed with `.` no longer valid
resulting in errors on upload. The upload implementation within
the ssh communicator has been updated to retain the existing
behavior.

Included in this update is modifications to the winrm communicator
so the upload functionality matches that of the ssh communicator
respecting the trailing `.` behavior on source paths. With the
communicators updated to properly handle the paths, the file
provisioner was also updated to simply apply previously defined
path update rules only.

Fixes #10675
2019-02-26 08:02:09 -08:00
Vidroha Debroy
aacb453a79 Fixing bug I introduced. Thanks @chrisroberts! 2019-02-15 14:53:56 -06:00
Vidroha Debroy
7c0ffe369a Updated based on recommended changes per review. 2019-02-15 12:14:37 -06:00
Vidroha Debroy
281203edf1 Handling the cases for UNSET_VALUE, i.e., config is not finalized. 2019-01-28 13:35:50 -06:00
Vidroha Debroy
d2c11e81ae Config has pip_install_cmd for Provisioner to pick it up. Tests updated. 2019-01-25 16:51:58 -06:00
Vidroha Debroy
8418d26037 Ubuntu code updated because it calls Debian code. 2019-01-25 15:22:04 -06:00
Vidroha Debroy
614523a5fc Exposing pip_install_cmd to callers as optional. 2019-01-25 15:09:31 -06:00
Vidroha Debroy
84df098135 Handling empty strings passed as pip_install_command. 2019-01-25 14:55:39 -06:00
Vidroha Debroy
2b0617fb64 Adding pip_install_cmd as a default parameter to get_pip. Unit Tests. 2019-01-25 13:59:15 -06:00
Brian Cain
b5db5c0156
Show source and destination locations with file provisioner
Prior to this commit, Vagrants output would only show that a file
provisioner was running, but had no detail as to what file was being
copied to where. This is especially confusing if a Vagrantfile has
multiple file provisioners. This commit updates that by showing the
source and destination of the file so that it's clearer what is being
copied and to where.
2019-01-07 11:43:27 -08:00
Chris Roberts
1f959e03cb
Merge pull request #10532 from chrisroberts/e-reboot
Add reboot option to shell provisioner
2019-01-03 13:52:19 -08:00
Chris Roberts
7fbcb88d82
Merge pull request #10539 from jalandis/disable-required-install_type-salt-option-windows
Disabled salt provision required install_type check on Windows
2019-01-03 13:44:05 -08:00
John Landis
bd6fa11281
Disabled salt provision required install_type check on Windows where option is not supported. Added test case for salt provisioner config changes. 2018-12-23 11:39:58 -05:00
John Landis
19dc9fd921
Upgrade default Salt version from 2017.7.1 to 2018.3.3 2018-12-22 18:55:38 -05:00
Chris Roberts
e735453422 Add reboot option to shell provisioner
Adds a `reboot` option which allows the guest to be rebooted after
the completion of a shell provisioning task. The guest must support
the `:reboot` capability. Like the `reset` option, the `reboot`
option may be provided without defining `inline` or `file` options
when a reboot may be required between other provisioners.

Fixes #8639
2018-12-21 15:50:59 -08:00