DevOps工具与验收测试实践
1. Puppet与Vagrant在DevOps中的应用
1.1 Puppet模块操作
Puppet借助 puppet-module-tool
,能够在Puppet Forge(http://forge.puppetlabs.com )上创建、安装和搜索模块。自Puppet 2.7.12版本起, puppet-module-tool
已被集成到核心组件中。大多数Puppet模块会发布到Puppet Forge,但其源代码通常存于GitHub,方便作为子模块添加,操作步骤如下:
1. 进入项目根目录:
cd project-root
- 添加子模块:
git submodule add git://github.com/puppetlabs/puppetlabs-firewall.git modules/firewall
- 提交更改:
git commit -m "Add the firewall module to manage iptables"
添加到项目树后,在特定机器上使用该模块也较为简单。例如,添加防火墙设置的代码如下: