vagrant/website/source/docs/provisioning
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
..
ansible.html.md provisioners/ansible(both): Add compatibility mode 2017-09-06 17:12:22 +02:00
ansible_common.html.md provisioners/ansible(both): Add compatibility mode 2017-09-06 17:12:22 +02:00
ansible_intro.html.md Ansible Docs: Fix headers and indentation 2017-08-22 19:18:32 +02:00
ansible_local.html.md ansible_local: Add the :pip_args_only install mode 2017-03-24 17:35:34 +01:00
basic_usage.html.md Corrected typo, added a couple examples. 2016-08-15 16:45:35 -05:00
cfengine.html.md Tabs to spaces 2016-01-19 14:54:13 -05:00
chef_apply.html.md Minor gramatical fix 2016-02-11 19:13:24 +05:30
chef_client.html.md Tabs to spaces 2016-01-19 14:54:13 -05:00
chef_common.html.md Add config option omnibus_url for chef provisioners 2017-08-03 10:06:27 +02:00
chef_solo.html.md Tabs to spaces 2016-01-19 14:54:13 -05:00
chef_zero.html.md Tabs to spaces 2016-01-19 14:54:13 -05:00
docker.html.md (#7139) Add post-install provisioner to docker provisioner 2017-06-27 16:01:23 -07:00
file.html.md (#8933) Align file provisioner functionality on all platforms 2017-08-31 15:57:53 -07:00
index.html.md Merge docs and www into a single static site 2016-01-19 14:35:05 -05:00
puppet_agent.html.md Tabs to spaces 2016-01-19 14:54:13 -05:00
puppet_apply.html.md add note that puppet need to be installed 2017-01-15 07:38:43 +01:00
salt.html.md (#7826) Add salt_arg option for passing flags to salt tool 2017-08-29 14:11:06 -07:00
shell.html.md Fix typo. 2016-12-21 15:08:57 -07:00