Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Variables 导出变量的木偶清单_Variables_Path_Redis_Vagrant_Puppet - Fatal编程技术网

Variables 导出变量的木偶清单

Variables 导出变量的木偶清单,variables,path,redis,vagrant,puppet,Variables,Path,Redis,Vagrant,Puppet,如何编写用于导出2个变量的木偶清单: export REDISTOGO_URL=redis://192.168.3.4:6379 export PATH=$PATH:/home/vagrant/appname/vendor/bundle/bin/ 有什么建议吗 谢谢。假设您使用的是linux平台,您可以使用以下答案: 该问题的答案建议在/etc/profile.d脚本上使用puppet文件资源: file { "/etc/profile.d/my_test.sh" content =>

如何编写用于导出2个变量的木偶清单:

export REDISTOGO_URL=redis://192.168.3.4:6379
export PATH=$PATH:/home/vagrant/appname/vendor/bundle/bin/
有什么建议吗


谢谢。

假设您使用的是linux平台,您可以使用以下答案:

该问题的答案建议在/etc/profile.d脚本上使用puppet文件资源:

file { "/etc/profile.d/my_test.sh"
  content => "
export REDISTOGO_URL=redis://192.168.3.4:6379
export PATH=$PATH:/home/vagrant/appname/vendor/bundle/bin/
"
}

例如,您可以引用第一个。您能更具体一点吗?
export REDISTOGO\u URL=”redis://192.168.3.4:6379“
我的问题是,如何编写一个傀儡清单来在Vagrant machine中导出这些变量?你的问题不是这样表述的。请注意,它令人困惑(至少对我来说),因此我建议您编辑您的文章,重新格式化它。感谢Ben,如果我将这些行添加到puppet manifest中,我会得到以下错误:无法找到该命令,因为PATH环境变量中不包括“/usr/bin:/bin”。命令“curl”在“/usr/bin/curl”中可用。由于PATH环境变量中不包含“/usr/bin”,因此无法找到该命令。curl:command not found ~$echo$PATH:/home/vagrant/appname/vendor/bundle/bin/所有其他环境变量都将从路径中删除。还有其他建议吗?请转义
$
或使用单引号。