Commit Graph

85 Commits

Author SHA1 Message Date
Brian Cain bcd0deba8b
(#10091) Update `module_path` type for puppet apply provisioner
This commit updates the documentation for `module_path` to say that it
can be both a string or array of string paths.
2018-08-14 13:07:14 -07:00
h4rvey r0ss 63e712dead Colorize ruby commands 2018-07-28 20:10:57 +03:00
Gilles Cornu d5b5e9ea8c ansible_local: Improve installation from PPA
- Fix #9796: Failing installation on bionic (18.04 LTS)
- Remove support for precise (12.04 LTS), which is out of public support
  (On this version, the package python-software-properties contained
  the add-apt-repository tool)
- Reduce the number of SSH calls, and avoid unnecessary apt-get calls.
2018-05-31 05:47:50 +02:00
Gilles Cornu f9f0a9ac0d Ansible Docs: Review and Adapt PR #9864
- Remove undesired blank characters
- The examples attached to a specific option must be concise
- The original example is a tip for a non-standard use case
2018-05-25 21:03:42 +02:00
Rémy G 57f12d115c
Update ansible_common.html.md
Added an explanation about locating ansible roles in a non vagrant writeable directory
2018-05-24 14:54:15 +02:00
Rémy G 4b896d9945
ansible_local provisioner tuning example
According to @gildegoma in #9863, here's a concrete example about tuning ansible(_local) provisioner.
2018-05-24 14:22:43 +02:00
Brian Cain 151095a3e9
Merge pull request #9420 from ryanwalder/salt-json
Add master_json_config & minion_json_config options to salt provisioner
2018-04-16 15:37:44 -07:00
Brian Cain 0ce6e9891e
Merge pull request #9572 from jsoref/spelling
Spelling
2018-03-22 09:50:52 -07:00
Brandon Authier e5dd4d9e36
Fix missing "-" $script variable definition.
In the $script variable definition there appears to be a typo of "<<SCRIPT" when it should be "<<-SCRIPT". I ran into this issue while editing the Vagrant file on a Fedora variant with ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux].
2018-03-20 15:58:28 -07:00
Josh Soref 1a5ddea9f4 Spelling fixes
* account
* addresses
* administrator
* afterwards
* because
* bridgeable
* capabilities
* capability
* checksum
* configuration
* configuration for
* configure
* criteria
* delimited
* delivered
* derivatives
* description
* detect
* directory
* display
* downloading
* during
* electric
* enabling
* encountered
* equivalent
* executable
* executed
* hashicorp
* hypervisor
* hyphens
* implementation
* incorporate
* inheritance
* initialize
* instance
* instead
* interactions
* invocable
* machine
* maximum
* message
* mounting
* overridden
* overwrite
* paramiko
* preparing
* provides
* provisioning
* recursively
* requested
* resetting
* retryable
* running
* satisfied
* searching
* sometimes
* specified
* successfully
* synced folders
* unauthorized
* underlying
* userprofile
* vagrant
* vagrantfile
* variable
* various
* version
* virtual
* windows
2018-03-14 14:41:04 +00:00
Brandon Moore 5a12641f9c
Update URLs for the repo 2018-03-07 17:10:30 -05:00
John Eismeier 54ecded1d6
Propose fix some typos 2018-02-06 14:20:29 -05:00
Ryan Walder db457e6318 Add master_json_config & minion_json_config options to salt provisioner
* Allow use of -j/-J bootstrap options for configuring master/minion
2018-01-31 12:28:36 +00:00
Chris Roberts e6554d614f Include default value within documentation 2018-01-16 11:54:56 -08:00
Chris Roberts 3664f1a627 Allow hiding environment variable values in shell provisioner 2018-01-12 17:33:47 -08:00
hrvoj3e 63ec7c7b09
spelling fix - resoled to resolved 2018-01-06 17:01:30 +01:00
Ramon Fischer f502841201
correct pip argument 2017-12-27 06:58:56 +01:00
Jonathan LaBroad 56861296fa Added tests and validation for python_version parameter 2017-10-05 06:25:36 -04:00
Jonathan LaBroad 6f53c3991c Merge remote-tracking branch 'upstream/master' 2017-09-11 09:15:22 -04:00
Chris Roberts 34addec796 Merge pull request #8913 from mitchellh/gildegoma/6570-ansible-compatibility-mode
Ansible: Add "compatibility_mode" and "*become*" common options; Move "version" to common options
2017-09-06 13:18:08 -07:00
Gilles Cornu ac75e409a3
provisioners/ansible(both): Quote host_vars if needed
This patch is based on @subimage's inputs in the related GitHub issue.
Thanks again!

Fix #8597
2017-09-06 21:22:41 +02:00
Gilles Cornu 4dc3e59b08
provisioners/ansible(both): Review of PR #8913
- Keep the Programming Errors with corresponding Exception class and
  en.yml message template. Fix the alphabetical order in errors.rb by
  the way.
- Fix English wording in the documentation and en.yml messages
- Use StandardError for unknown error rescuing.

Thanks @chrisroberts!
2017-09-06 17:12:50 +02:00
Gilles Cornu dc3b6341e2
provisioners/ansible: Check compatibility conflicts
Vagrant will verify that the current Ansible version does support the
requested compatibility mode (only applicable if not "auto", of course).

As mentioned in the documentation, there is no sanity checks between
`version` option and `compatibility_mode` option.

With this change, the host-based provisioner is also improved to
execute only once the "ansible" command (and store the gathered
information for multiple usages like version requirement and
compatibility checks). On the other hand, the guest-based provisioner
can still potentially execute "ansible" twice (once in the
AnsibleInstalled cap, and via "gather_ansible_version" function via
Base::set_compatibility_mode).
2017-09-06 17:12:40 +02:00
Gilles Cornu 270618284c
docs/ansible: Fix an internal hyperlink
Fixing a typo made in 073898046542323eb11c2e129f37fa558ae201e1,
after getting the confirmation that all the Vagrant docs will continue
to use full path for internal links (for the moment).

[ci skip]
2017-09-06 17:12:39 +02:00
Gilles Cornu 8c0df3d046
provisioners/ansible: Move `version` to common options
Before this change, only the ansible_local provisioner supported this
option (for ansible version requirement, and pip installation). Now, the
ansible host-based provisioner can also require a exact ansible version.

Resolve #8914

Note: this has been added as part of #6570 resolution, since the
introduction of the `compatibility_mode` auto-detection made both
provisioners made capable to detect ansible version.

Pending: optimize the code to avoid duplicated executions of "ansible
--version" command.
2017-09-06 17:12:35 +02:00
Gilles Cornu a327e34861
provisioners/ansible: Validate compatibility_mode
- Use `'auto'` instead of `nil` for the auto-detection mode
- Add strict validation and related error message
2017-09-06 17:12:32 +02:00
Gilles Cornu e2621a42fc
docs/ansible: Align the "warn/info" notices style
Motivated by the 4d546a58e1243168f58e20ca53cab71b31e44ae9 changes.
2017-09-06 17:12:29 +02:00
Gilles Cornu 8834afbd8e
provisioners/ansible(both): Add compatibility mode
With this change, it is now possible to get rid of many deprecation
messages successively introduced in Ansible 1.9, and 2.0. More
interesting, the generated inventory will contain the recommended
variable names (e.g. `ansible_host` instead of `ansible_ssh_host`)
when the compatibility mode is set to '2.0'.

Details:

- Add `compatibility_mode` option to control the Ansible parameters
  format to be used. The value corresponds to the minimal version
  supported. For the moment, possible values are '1.8' (corresponding to
  Vagrant's former behaviour) or '2.0'.
  Note that a dynamic inventory generated in compatibility mode '2.0'
  is not supported by Ansible 1.x. On the other hand, Ansible 2.x so far
  supports inventory format generated by the compatibility mode '1.8'.

- Add compatibility mode auto-detection, based on the available Ansible
  version. This is the default behaviour in order to bring a maximum of
  user friendliness. The drawback of this approach is to let potential
  compatibility breaking risks, for `ansible` provisioner setups that
  already integrate Ansible 2.x **AND** rely on the existence of
  the generated `_ssh` variable names. Thanks to the vagrant warnings
  (and its release notes), I argue that it is worth to offer
  auto-detection by default, which offers a sweet transition to most
  users.

- Add `become`, `become_user` and `ask_become_pass` options and their
  backwards compatible aliases. The legacy options are now deprecated.

Note that we intentionally didn't provide a '1.9' compatibility mode,
as it would add extra-complexity for practically no added-value.
To my knowledge, the Ansible 2.x series haven't introduced yet any major
changes or deprecations that would motivate to introduce a higher
version compatibility mode (to be confirmed/verified).

Resolve GH-6570

Still Pending:

- Optimization: Reduce the number of `ansible` command executions.
  Currently two exec calls will be performed when the compatibility
  mode auto-detection is enabled (i.e. by default). We could make the
  provisioner a little bit smarter to only execute `ansible` only once
  in any situation (by combining "presence" and "version" checks).

- User-friendliness: Add better validator on `compatibility_mode`
  option, and shows a warning or an error instead of the silent
  fallback on the auto-detection modus.

- Test coverage: All the added behaviours are not fully covered yet.
2017-09-06 17:12:22 +02:00
Brian Cain a9564b2137 (#8933) Align file provisioner functionality on all platforms
This commit aligns how the file provisioner should work on all host
machines. It ensures that a `/.` is only applied if the user intended
to upload a folder to a destination under a different name. It ensures
that if uploading to a windows guest with a different destination folder
name, it does not nest the source folder under that name so that it
works the same as it does on linux platforms. It also updates the
behavior of the winrm upload communicator by allowing an array of paths
to be uploaded instead of a single file or folder to allow for this new
functionality for windows guests.
2017-08-31 15:57:53 -07:00
Brian Cain 432cb8d915 (#7826) Add salt_arg option for passing flags to salt tool
This commit introduces the salt_arg option that allows a user to pass
additional command line flags to the `salt` tool when provisioning with
a master setup.

It also adds additional config validation to ensure that both
`salt_args` and `salt_call_args` is an array.
2017-08-29 14:11:06 -07:00
Brian Cain 9a29d7be6b (#7836) Introduce salt_call_args option for salt provisioner
This config option for the salt provisioner allows you to pass
additional arguments to the salt-call executable.
2017-08-29 11:17:29 -07:00
Jonathan LaBroad cec589ecd9 Updating documentation 2017-08-29 13:17:56 -04:00
Gilles Cornu c3f0b1c1b2 Ansible Docs: Fix headers and indentation
Align the headers style and wording in the intro page.

[ci skip]
2017-08-22 19:18:32 +02:00
Gilles Cornu e436f53fe9 Ansible Docs: Fix a typo in Markdown indentation
[ci skip]
2017-08-22 07:54:00 +02:00
Brian Cain 623b117208 Merge pull request #8682 from Telekom-PD/omnibus-url
Add config option omnibus_url for chef provisioners
2017-08-03 09:19:13 -07:00
Artem Sidorenko 875c2edc62 Add config option omnibus_url for chef provisioners
This option is useful for internal setups, where own customized
omnibus installation script is used (e.g. to get chef from a mirror)
2017-08-03 10:06:27 +02:00
Brian Cain a05d95bd0a (#7139) Add post-install provisioner to docker provisioner
Prior to this commit, if a user attempted to configure
`/etc/default/docker` through vagrant prior to installation, the package
manager would not override an existing configuration and installing
docker would then fail. This commit fixes this by introducing a
`post_install_provisioner` that allows users to define a provisioner
block that will run after docker has been installed, allowing users to
configure `/etc/default/docker` how they want.
2017-06-27 16:01:23 -07:00
Dafydd Jones 71216cf4f9 update latest salt minion version for windows 2017-04-13 12:36:45 -07:00
Gilles Cornu 80d105cf8c
ansible_local: Add the :pip_args_only install mode
With the introduction of `pip_args` option, you can easily extend the
`:pip` installation mode behaviour. But some interesting/advanced usages
are still not possible because of the auto-generated parts ("ansible"
package, version selection, and the `--upgrade` flag).

By adding this "pip_args_only" install mode, it will be for instance
possible to:
- install unofficial releases, like release candidates published at
  https://releases.ansible.com/
- install more pip packages (e.g. via a `requirements.txt` file), with
  hash validation, etc.

Note that there is no config validation that requires `pip_args` option
to be defined when the :pip_args_only mode is selected. This would be
more elegant, and user friendly to raise a configuration error, but this
can wait. At least, running with an empty `pip_args` won't lead to any
command crash, since the rather dummy "pip install" shows an helper
notice and terminates with a zero (0) exit code.

This change is thought as a complement to the changes originally
proposed in pull request GH-8170.
2017-03-24 17:35:34 +01:00
Gilles Cornu b40d347944
ansible_local: Polish the new `pip_args` option
Ref GH-8170
2017-03-24 00:01:17 +01:00
James Carr 7e2e5654ed
ansible_local: Add `pip_args` option
With this new option, it is now possible to pass additional arguments to
pip command when the `install_mode` is "pip".

(@gildegoma reworded the original commit message of pull request GH-8170)
2017-03-24 00:01:14 +01:00
Florian Breisch 84f49bf0ce Add hint for .verbose-attribute 2017-02-20 16:40:24 +01:00
Chris Roberts 9cd636c4d9 Merge pull request #8100 from chrisroberts/docs/vagrant-salt
Add note about vagrant-salt plugin
2017-02-01 12:44:34 -08:00
Alvaro Miranda Aguilera 560ed2bfee add note that puppet need to be installed 2017-01-15 07:38:43 +01:00
Chris Roberts 734b196d05 Merge pull request #8146 from ctranstrum/patch-1
Fix typo.
2017-01-05 10:42:12 -08:00
Gilles Cornu 9493901e0c
provisioners/ansible: Add example of `host_vars` values that include quotes
Motivated by the support effort on GH-8158 ;-)
2016-12-28 23:23:43 +01:00
ctranstrum 52f45f27c4 Fix typo.
Looks like there was a typo. Fixed.
2016-12-21 15:08:57 -07:00
Chris Roberts 6b2db8cf2a Add note about vagrant-salt plugin 2016-12-08 13:33:03 -08:00
Gilles Cornu 8caed8ea16 Merge pull request #7918 from mitchellh/gildegoma/fix-7195
Add `config_file` option to both Ansible provisioners
2016-11-15 08:29:30 +01:00
Chris Roberts da45ca707c Add md5 and sha1 checksum support to Downloader.
Allows checksum validation on downloaded files via Util::Downloader
using MD5 and/or SHA1 checksums. This also integrates checksum validation
support with the shell provisioner for downloaded remote files.
2016-11-09 16:05:39 -08:00