要安装节点上的模块运行somethig喜欢:puppet module install SomeModuleOnForge
如何在木偶中“需要”外部模块?
有没有把这段代码清单中,而不必每一个节点上安装它的方法吗?
我知道我可以写一些自定义代码来做到这一点,但它不存在像是需要外部模块的东西吗?或者我必须下载模块的代码并将其放入我自己的回购站中?
使其更具体。我正在windows上做这个以及使用Josh Cooper powershell模块,但是我无法使其工作。我的文件夹结构如下所示:
- 木偶
- 体现
- site.pp
- 模块
- PowerShell的
- LIB
- 木偶
- 提供商
- EXEC
- powershell.rb
- EXEC
- 提供商
- 木偶
- LIB
- PowerShell的
- 体现
我简单愚蠢site.pp看起来是这样的:
include powershell
node default {
notify {"Stuff from default":}
}
node 'MYCOMPUTER' {
notify {"MYCOMPUTER":}
}
node 'winpuppet' {
notify {"Notify from random":}
}
exec {'get_eventstore':
command => 'Invoke-WebRequest http://download.geteventstore.com/binaries/EventStore-OSS-Win-v3.0.0-rc9.zip -OutFile c:\\downloads\\EventStore-OSS-Win-v3.0.0-rc9.zip',
creates => "c:/downloads/EventStore-OSS-Win-v3.0.0-rc9.zip",
provider => powershell,
}
file {'c:/downloads/EventStore-OSS-Win-v3.0.0-rc9.zip':
mode => 0755,
require => Exec["get_eventstore"],
}
notify {"I'm notifying you.":}
这应该只是一个复制文件,没什么大碍,因为我还在学习。
您是否正在使用没有中央主人的“puppet apply”?如果没有,为什么要在每个代理上安装模块? – 2014-09-01 12:45:03
我的计划是使用git而不是主设置进行分发。 – 2014-09-01 18:05:47