itamae配置管理工具

联合创作 · 2023-09-27 01:54

受Chef启发的配置管理工具,但更简单,轻便。原名Lightchef。


概念



  • Chef-like DSL (但不兼容 Chef)


  • 比Chef更简单、轻便


  • 只有食谱


  • Idempotent



安装



$ gem install itamae

开始


创建一个 recipe 文件 recipe.rb:



package 'nginx' do
  action :installendservice 'nginx' do
  action [:enable, :start]end

然后执行itamae命令将 recipe 应用到本地计算机。



$ itamae local recipe.rb
 INFO : Starting Itamae...
 INFO : Recipe: /home/user/recipe.rb
 INFO :    package[nginx]
 INFO :       action: install
 INFO :          installed will change from 'false' to 'true'
 INFO :    service[nginx]
 INFO :       action: enable
 INFO :       action: start

或者你也可以通过 itamae ssh将recipe应用到远程计算机。



$ itamae ssh --host host001.example.jp recipe.rb

您还可以通过itamae ssh--vagrant申请一个recipe到Vagrant VM。



$ itamae ssh --vagrant --host vm_name recipe.rb

点击 Itamae Wiki 查看更多信息


运行测试


要求:Vagrant



$ bundle exec rake spec
浏览 25
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报