Passing ruby variable to provisioner
问题 I have a Vagrant file that defines a provisioner like this: config.vm.provision :shell, :path => "set_rmi_hostname.sh", :args => "<ip_address> <target>" ip_address and target are ruby variables defined in the same file: ip = Socket.ip_address_list.detect{|intf| intf.ipv4_private?} ip_address = ip.ip_address if ip target = "my_target" How can I expand these two variables and pass them to my script? Thanks 回答1: Use #{variable} to use string expansion in Ruby: config.vm.provision :shell, :path =