From 17ecd05c5f6cfec267b1a5d63fcda6c3c0cf1898 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 9 Aug 2013 11:06:02 -0700 Subject: [PATCH] plugins/provisioners/ansible: rename inventory_file to inventory_path /cc @ches --- plugins/provisioners/ansible/config.rb | 14 +++++++------- plugins/provisioners/ansible/provisioner.rb | 2 +- templates/locales/en.yml | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/provisioners/ansible/config.rb b/plugins/provisioners/ansible/config.rb index 240aaee72..0d20915a9 100644 --- a/plugins/provisioners/ansible/config.rb +++ b/plugins/provisioners/ansible/config.rb @@ -3,7 +3,7 @@ module VagrantPlugins class Config < Vagrant.plugin("2", :config) attr_accessor :playbook attr_accessor :extra_vars - attr_accessor :inventory_file + attr_accessor :inventory_path attr_accessor :ask_sudo_pass attr_accessor :limit attr_accessor :sudo @@ -13,7 +13,7 @@ module VagrantPlugins def initialize @playbook = UNSET_VALUE @extra_vars = UNSET_VALUE - @inventory_file = UNSET_VALUE + @inventory_path = UNSET_VALUE @ask_sudo_pass = UNSET_VALUE @limit = UNSET_VALUE @sudo = UNSET_VALUE @@ -24,7 +24,7 @@ module VagrantPlugins def finalize! @playbook = nil if @playbook == 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 @limit = nil if @limit == UNSET_VALUE @sudo = nil if @sudo == UNSET_VALUE @@ -56,11 +56,11 @@ module VagrantPlugins 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) + # Validate the existence of the inventory_path, if specified + if inventory_path + expanded_path = Pathname.new(inventory_path).expand_path(machine.env.root_path) 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) end end diff --git a/plugins/provisioners/ansible/provisioner.rb b/plugins/provisioners/ansible/provisioner.rb index 1142b57cc..d56af19e2 100644 --- a/plugins/provisioners/ansible/provisioner.rb +++ b/plugins/provisioners/ansible/provisioner.rb @@ -6,7 +6,7 @@ module VagrantPlugins 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 << "--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 if config.limit diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 429a3bffe..a9e44ae20 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -1179,5 +1179,5 @@ en: ansible: 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}" + 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"