With this change, the existing host-based Ansible provisioner is refactored to share a maximum of code with this new guest-based Ansible provisioner. At this stage of development, the existing unit tests are intentionally modified as little as possible, to keep safe the existing funtionalities. Other issues resolved by this changeset: - Display a warning when running from a Windows host [GH-5292] - Do not run `ansible-playbook` in verbose mode when the `verbose` option is set to an empty string.
3.9 KiB
| page_title | sidebar_current |
|---|---|
| Common Ansible Options - Provisioning | provisioning-ansible-common |
Shared Ansible Options
The following options are available to both Ansible provisioners:
These options get passed to the ansible-playbook command that ships with Ansible, either via command line arguments or environment variables, depending on Ansible own capabilities.
Some of these options are for advanced usage only and should not be used unless you understand their purpose.
-
extra_vars(string or hash) - Pass additional variables (with highest priority) to the playbook.This parameter can be a path to a JSON or YAML file, or a hash.
Example:
ansible.extra_vars = { ntp_server: "pool.ntp.org", nginx: { port: 8008, workers: 4 } }These variables take the highest precedence over any other variables.
-
groups(hash) - Set of inventory groups to be included in the auto-generated inventory file.Example:
ansible.groups = { "web" => ["vm1", "vm2"], "db" => ["vm3"] }Notes:
- Alphanumeric patterns are not supported (e.g.
db-[a:f],vm[01:10]). - This option has no effect when the
inventory_pathoption is defined.
- Alphanumeric patterns are not supported (e.g.
-
inventory_path(string) - The path to an Ansible inventory resource (e.g. a static inventory file, a dynamic inventory script or even multiple inventories stored in the same directory).By default, this option is disabled and Vagrant generates an inventory based on the
Vagrantfileinformation. -
limit(string or array of strings) - Set of machines or groups from the inventory file to further control which hosts are affected.The default value is set to the machine name (taken from
Vagrantfile) to ensure thatvagrant provisioncommand only affect the expected machine.Setting
limit = "all"can be used to make Ansible connect to all machines from the inventory file. -
raw_arguments(array of strings) - a list of additionalansible-playbookarguments.It is an unsafe wildcard that can be used to apply Ansible options that are not (yet) supported by this Vagrant provisioner. As of Vagrant 1.7,
raw_argumentshas the highest priority and its values can potentially override or break other Vagrant settings.Example:
['--check', '-M /my/modules']). -
skip_tags(string or array of strings) - Only plays, roles and tasks that do not match these values will be executed. -
start_at_task(string) - The task name where the playbook execution will start. -
sudo(boolean) - Cause Ansible to perform all the playbook tasks using sudo.The default value is
false. -
sudo_user(string) - set the default username who should be used by the sudo command. -
tags(string or array of strings) - Only plays, roles and tasks tagged with these values will be executed . -
verbose(boolean or string) - Set Ansible's verbosity to obtain detailed loggingDefault value is
false(minimal verbosity).Examples:
true(equivalent tov),-vvv(equivalent tovvv),vvvv.Note that when the
verboseoption is enabled, theansible-playbookcommand used by Vagrant will be displayed. -
vault_password_file(string) - The path of a file containing the password used by Ansible Vault.