Last active
April 7, 2016 23:21
-
-
Save kikitux/89cc71db3fae8ba28eb8de720274db1c to your computer and use it in GitHub Desktop.
vars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ${key} ]; then | |
echo "key=${key}" | |
else | |
echo "var key not set" | |
fi | |
if [ ${1} ]; then | |
echo "\$1=${1}" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
key= vagrant provision | |
==> default: Running provisioner: shell... | |
default: Running: inline script | |
==> default: stdin: is not a tty | |
==> default: var key= | |
==> default: Running provisioner: shell... | |
default: Running: /var/folders/yb/cfrxf_615hb8st07c45hp6_r0000gn/T/vagrant-shell20160407-35385-49b8ua.sh | |
==> default: stdin: is not a tty | |
==> default: var key not set | |
==> default: $1=arg1 | |
vagrant provision | |
==> default: Running provisioner: shell... | |
default: Running: inline script | |
==> default: stdin: is not a tty | |
==> default: var key= | |
==> default: Running provisioner: shell... | |
default: Running: /var/folders/yb/cfrxf_615hb8st07c45hp6_r0000gn/T/vagrant-shell20160407-35414-zzlq6i.sh | |
==> default: stdin: is not a tty | |
==> default: var key not set | |
==> default: $1=arg1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
key=value vagrant provision | |
==> default: Running provisioner: shell... | |
default: Running: inline script | |
==> default: stdin: is not a tty | |
==> default: var key=value | |
==> default: Running provisioner: shell... | |
default: Running: /var/folders/yb/cfrxf_615hb8st07c45hp6_r0000gn/T/vagrant-shell20160407-35244-3pk9tg.sh | |
==> default: stdin: is not a tty | |
==> default: key=value | |
==> default: $1=arg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
key=ENV['key'] | |
vars = Hash.new | |
vars["key"]=ENV['key'] | |
Vagrant.configure(2) do |config| | |
config.vm.box = "hashicorp/precise32" | |
config.vm.provision "shell", inline: "echo var key=#{key}" | |
config.vm.provision "shell", path: "provision.sh", args: "arg1", env: vars | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment