Validate that extra_vars is a hash
This commit is contained in:
parent
5949f256bd
commit
d783b33fe2
|
@ -49,6 +49,13 @@ module VagrantPlugins
|
|||
end
|
||||
end
|
||||
|
||||
# Validate that extra_vars is a hash, if set
|
||||
if extra_vars
|
||||
if not extra_vars.kind_of?(Hash)
|
||||
errors << I18n.t("vagrant.provisioners.ansible.extra_vars_not_hash")
|
||||
end
|
||||
end
|
||||
|
||||
# Validate the existence of the inventory_file, if specified
|
||||
if inventory_file
|
||||
expanded_path = Pathname.new(inventory_file).expand_path(machine.env.root_path)
|
||||
|
|
|
@ -1051,3 +1051,4 @@ en:
|
|||
no_playbook: "`playbook` must be set for the Ansible provisioner."
|
||||
playbook_path_invalid: "`playbook` for the Ansible provisioner does not exist on the host system: %{path}"
|
||||
inventory_file_path_invalid: "`inventory_file` for the Ansible provisioner does not exist on the host system: %{path}"
|
||||
extra_vars_not_hash: "`extra_vars` for the Ansible provisioner must be a hash"
|
||||
|
|
Loading…
Reference in New Issue