假设我在AWS工作,并将EBS卷附加到实例。该卷是根卷的副本,只要它是通过快照另一个实例的根卷创建的。
我想在我的EBS卷上运行木偶,但不要将其装入的路径硬编码到我的木偶清单中。假设它安装在/tmp/new-root-vol
。有没有办法在没有在清单本身中指定它的情况下对该路径运行puppet?
换句话说,如何在运行时不知道/tmp/new-root-vol/testfile
命名空间的情况下创建/tmp/new-root-vol
这个清单片段?
file {'testfile':
path => '/testfile',
content => 'Hello, volume'
}
一种可能性可能是chroot
。只要可以从新根目录访问puppet可执行文件,此feature request表明它可能有效。
答案 0 :(得分:0)
我不知道你能做到这一点的任何方式。但是,您可以在site.pp中创建一个变量(或包含另一个类似constants.pp的清单)并使用变量:
site.pp
$root_dir = '/'
node default {
include your_manifests
}
你提交
file {'testfile':
path => "${root_dir}testfile",
content => 'Hello, volume'
}
您甚至可以更改每个节点的根目录。