diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1980758 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +## 0.0.3 + +BUG FIXES: + + - Make sure GCC is installed on CentOS guests + - Fix extra-vars serialization diff --git a/lib/vagrant-guest_ansible/guest_script.sh b/lib/vagrant-guest_ansible/guest_script.sh index 3130b8b..2e2a914 100644 --- a/lib/vagrant-guest_ansible/guest_script.sh +++ b/lib/vagrant-guest_ansible/guest_script.sh @@ -2,7 +2,7 @@ ANSIBLE_PLAYBOOK=$1 ANSIBLE_HOSTS=$2 -ANSIBLE_EXTRA_VARS=$3 +ANSIBLE_EXTRA_VARS="$3" TEMP_HOSTS="/tmp/ansible_hosts" if [ ! -f /vagrant/$ANSIBLE_PLAYBOOK ]; then @@ -18,7 +18,7 @@ fi if ! command -v ansible >/dev/null; then echo "Installing Ansible dependencies and Git." if command -v yum >/dev/null; then - sudo yum install -y git python python-devel + sudo yum install -y gcc git python python-devel elif command -v apt-get >/dev/null; then sudo apt-get update -qq #sudo apt-get install -y -qq git python-yaml python-paramiko python-jinja2 @@ -39,7 +39,7 @@ if ! command -v ansible >/dev/null; then fi if [ ! -z "$ANSIBLE_EXTRA_VARS" -a "$ANSIBLE_EXTRA_VARS" != " " ]; then - ANSIBLE_EXTRA_VARS=" --extra-vars \"$ANSIBLE_EXTRA_VARS\"" + ANSIBLE_EXTRA_VARS=" --extra-vars $ANSIBLE_EXTRA_VARS" fi # stream output diff --git a/lib/vagrant-guest_ansible/plugin.rb b/lib/vagrant-guest_ansible/plugin.rb index 4b00eae..e122fef 100644 --- a/lib/vagrant-guest_ansible/plugin.rb +++ b/lib/vagrant-guest_ansible/plugin.rb @@ -21,4 +21,4 @@ class Plugin < Vagrant.plugin("2") end end -end \ No newline at end of file +end diff --git a/lib/vagrant-guest_ansible/provisioner.rb b/lib/vagrant-guest_ansible/provisioner.rb index 09ebfa6..e1ea34a 100644 --- a/lib/vagrant-guest_ansible/provisioner.rb +++ b/lib/vagrant-guest_ansible/provisioner.rb @@ -1,5 +1,3 @@ - - module VagrantPlugins module GuestAnsible class Provisioner < Vagrant.plugin("2", :provisioner) @@ -15,9 +13,9 @@ def provision File.basename(self.setup_inventory_file), format_extra_vars(config.extra_vars) ].join(' ') - + command = "chmod +x #{config.upload_path} && #{config.upload_path} #{args}" - + with_script_file do |path| # Upload the script to the machine @@ -31,7 +29,7 @@ def provision @machine.ui.info(I18n.t("vagrant.provisioners.shell.running", script: path.to_s)) - + # Execute it with sudo comm.execute(command, sudo: config.sudo) do |type, data| if [:stderr, :stdout].include?(type) @@ -58,7 +56,7 @@ def format_extra_vars(extra_vars) if extra_vars.kind_of?(String) extra_vars.strip elsif extra_vars.kind_of?(Hash) - extra_vars.map { |k,v| "#{k}=#{v}" }.join(" ") + "\"#{extra_vars.to_json.gsub('"', '\"')}\"" end end @@ -114,7 +112,7 @@ def setup_inventory_file return config.inventory_path if config.inventory_path ssh = @machine.ssh_info - + generated_inventory_file = @machine.env.root_path.join("vagrant_ansible_inventory_#{machine.name}") diff --git a/lib/vagrant-guest_ansible/version.rb b/lib/vagrant-guest_ansible/version.rb index 33ba979..f384a48 100644 --- a/lib/vagrant-guest_ansible/version.rb +++ b/lib/vagrant-guest_ansible/version.rb @@ -1,5 +1,5 @@ module Vagrant module GuestAnsible - VERSION = "0.0.2.dev" + VERSION = "0.0.3" end end