我让 Puppet + Augeas 在 bash_profile 中分配变量值,但是我还没有找到从文件中导出变量的方法。
augeas { "bash_profile-${user}-${name}":
incl => "/home/${user}/.bash_profile",
lens => 'Shellvars.lns',
changes => "set ${variable_name} '\"${literal_value}\"'",
}
结果是:
# .bash_profile
variable="value"
但我需要的是:
# .bash_profile
export variable="value"
# or
variable="value"
export variable
这张Puppet 票似乎应该指向正确的方向,但我不知道如何编写导出语句