891 Commits

Author SHA1 Message Date
sophia
f69f87625a Allow docker run images to specify version with ':' 2020-08-06 10:25:19 -05:00
sophia
fb2470f48d Ensure shell provisioner gets extension specified in path config if exists 2020-05-26 16:35:31 -04:00
sophia
725a127467 Seperate podman centos and rhel install 2020-05-06 15:33:44 -04:00
codylane
2a90c1b4fd fixes GH issue #11580 2020-05-05 11:48:14 -06:00
sophia
13bb29af2b Don't warn on ansible compatability mode 2020-04-28 10:48:25 -04:00
Jeff Bonhag
2c4a40fccb
Fix issues with shell provisioner when WinSSH shell is set to cmd (#11547)
This commit fixes a couple of issues with the shell provisioner when the
WinSSH shell is set to cmd:

- A check for the .bat extension returned by File.extname
- Execute inline scripts with PowerShell when upload_path ends with .ps1

* Ensure script has correct extension

Co-Authored-By: Sophia Castellarin <sophia@hashicorp.com>
2020-04-24 15:56:27 -04:00
Sophia Castellarin
c89b68b06d
Merge pull request #11517 from soapy1/win-shell-provisioner-fail
Ensure windows files get an extension
2020-04-20 12:38:06 -04:00
sophia
4d516e2cae Test provision_winssh 2020-04-17 13:11:57 -04:00
Chris Roberts
c0f8a54924
Merge pull request #11436 from hvnsweeting/patch-1
Allow to specify python_version
2020-04-17 08:55:20 -07:00
sophia
2ddd12047c Ensure windows files get an extension 2020-04-17 10:31:24 -04:00
Sophia Castellarin
1fb3f30145
Merge pull request #11472 from soapy1/podman-provisioner
Add podman provisioner
2020-04-17 09:48:12 -04:00
Chris Roberts
84b309db32 Include test coverage on python value behavior 2020-04-16 17:25:55 -07:00
Viet Hung Nguyen
b084e61b17 Allow to specify python_version 2020-04-16 17:16:07 -07: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
sophia
bcce2f720d Add option to install from kubic 2020-04-06 10:13:57 -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
42785cb254 Add entries for podman error class 2020-04-03 17:13:41 -04: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
0c0c361386 Extract container plugin 2020-03-30 17:41:49 -04:00
sophia
4c74f8a112 Add podman provisioner 2020-03-30 15:02:56 -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