plugins/provisioners/ansible: rename inventory_file to inventory_path

/cc @ches
This commit is contained in:
Mitchell Hashimoto 2013-08-09 11:06:02 -07:00
parent ac8b2c5047
commit 17ecd05c5f
3 changed files with 9 additions and 9 deletions

View File

@ -3,7 +3,7 @@ module VagrantPlugins
class Config < Vagrant.plugin("2", :config) class Config < Vagrant.plugin("2", :config)
attr_accessor :playbook attr_accessor :playbook
attr_accessor :extra_vars attr_accessor :extra_vars
attr_accessor :inventory_file attr_accessor :inventory_path
attr_accessor :ask_sudo_pass attr_accessor :ask_sudo_pass
attr_accessor :limit attr_accessor :limit
attr_accessor :sudo attr_accessor :sudo
@ -13,7 +13,7 @@ module VagrantPlugins
def initialize def initialize
@playbook = UNSET_VALUE @playbook = UNSET_VALUE
@extra_vars = UNSET_VALUE @extra_vars = UNSET_VALUE
@inventory_file = UNSET_VALUE @inventory_path = UNSET_VALUE
@ask_sudo_pass = UNSET_VALUE @ask_sudo_pass = UNSET_VALUE
@limit = UNSET_VALUE @limit = UNSET_VALUE
@sudo = UNSET_VALUE @sudo = UNSET_VALUE
@ -24,7 +24,7 @@ module VagrantPlugins
def finalize! def finalize!
@playbook = nil if @playbook == UNSET_VALUE @playbook = nil if @playbook == UNSET_VALUE
@extra_vars = nil if @extra_vars == UNSET_VALUE @extra_vars = nil if @extra_vars == UNSET_VALUE
@inventory_file = nil if @inventory_file == UNSET_VALUE @inventory_path = nil if @inventory_path == UNSET_VALUE
@ask_sudo_pass = nil if @ask_sudo_pass == UNSET_VALUE @ask_sudo_pass = nil if @ask_sudo_pass == UNSET_VALUE
@limit = nil if @limit == UNSET_VALUE @limit = nil if @limit == UNSET_VALUE
@sudo = nil if @sudo == UNSET_VALUE @sudo = nil if @sudo == UNSET_VALUE
@ -56,11 +56,11 @@ module VagrantPlugins
end end
end end
# Validate the existence of the inventory_file, if specified # Validate the existence of the inventory_path, if specified
if inventory_file if inventory_path
expanded_path = Pathname.new(inventory_file).expand_path(machine.env.root_path) expanded_path = Pathname.new(inventory_path).expand_path(machine.env.root_path)
if !expanded_path.exist? if !expanded_path.exist?
errors << I18n.t("vagrant.provisioners.ansible.inventory_file_path_invalid", errors << I18n.t("vagrant.provisioners.ansible.inventory_path_invalid",
:path => expanded_path) :path => expanded_path)
end end
end end

View File

@ -6,7 +6,7 @@ module VagrantPlugins
options = %W[--private-key=#{ssh[:private_key_path]} --user=#{ssh[:username]}] options = %W[--private-key=#{ssh[:private_key_path]} --user=#{ssh[:username]}]
options << "--extra-vars=" + config.extra_vars.map{|k,v| "#{k}=#{v}"}.join(' ') if config.extra_vars options << "--extra-vars=" + config.extra_vars.map{|k,v| "#{k}=#{v}"}.join(' ') if config.extra_vars
options << "--inventory-file=#{config.inventory_file}" if config.inventory_file options << "--inventory-file=#{config.inventory_path}" if config.inventory_path
options << "--ask-sudo-pass" if config.ask_sudo_pass options << "--ask-sudo-pass" if config.ask_sudo_pass
if config.limit if config.limit

View File

@ -1179,5 +1179,5 @@ en:
ansible: ansible:
no_playbook: "`playbook` must be set for the Ansible provisioner." 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}" 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}" inventory_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" extra_vars_not_hash: "`extra_vars` for the Ansible provisioner must be a hash"