标签归档:foreman

Puppet整合Foreman与Mcollective

一、功能说明

  1.   Marionette Collective(MCollective)是一个与Puppet关系密切的服务运行框架。
  2.   MC依赖Ruby1.9.3或1.8.7,通过Stomp协议通信,因此依赖rubygem 1.2.2+
  3.   在puppet客户端上安装Mcollective服务端
  4.   在puppet服务端上安装Mcollective客户端
  5.   在puppet服务端或单独安装MQ中间件

参考官方文档:https://docs.puppetlabs.com/mcollective/deploy/standard.html 继续阅读

Host save fails if name contains underscore with Failed to save: Name is invalid

当使用Foreman时,在WEB上对主机名包含下划线的主机进行保存操作时,会提示“Name is invalid

或者在/var/log/foreman/production.log日志中会出现类似错误:

| Started POST “/api/hosts/facts” for 124.202.155.164 at 2016-05-12 16:23:06 +0800
2016-05-12T16:23:06 [app] [I] Processing by Api::V2::HostsController#facts as JSON
2016-05-12T16:23:06 [app] [I]   Parameters: {“facts”=>”[FILTERED]”, “certname”=>”mx136v_bak”, “name”=>”mx136v_bak”, “apiv”=>”v2”, :host=>{“name”=>”mx136v_bak”, “certname”=>”mx136v_bak”}}
2016-05-12T16:23:06 [app] [I] Import facts for ‘mx136v_bak’ completed. Added: 0, Updated: 5, Deleted 0 facts
2016-05-12T16:23:06 [app] [W] Action failed
| ActiveRecord::RecordInvalid: Validation failed: Name is invalid
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/validations.rb:56:in `save!’
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods/dirty.rb:33:in `save!’
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:246:in `block in save!’
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status’

| Started POST “/api/hosts/facts” for 124.202.155.164 at 2016-05-12 03:47:06 +0800
2016-05-12T03:47:06 [app] [I] Processing by Api::V2::HostsController#facts as JSON
2016-05-12T03:47:06 [app] [I]   Parameters: {“facts”=>”[FILTERED]”, “certname”=>”s108k_bak.domain.com”, “name”=>”s108k_bak.domain.com”, “apiv”=>”v2”, :host=>{“name”=>”s108k_bak.domain.com”, “certname”=>”s108k_bak.domain.com”}}
2016-05-12T03:47:06 [app] [W] Action failed
| ActiveRecord::RecordInvalid: Validation failed: Name is invalid
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/validations.rb:56:in `save!’
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods/dirty.rb:33:in `save!’
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:246:in `block in save!’
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:295:in `block in with_transaction_r
eturning_status’
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb
:192:in `transaction’
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:208:in `transaction’
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:293:in `with_transaction_returning_
status’
| /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:246:in `save!’

临时解决办法:

修改 /usr/share/foreman/lib/net/validations.rb文件中的 “HOST_REGEXP”
HOST_REGEXP = /\A(([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\z/更改为 HOST_REGEXP = /\A(([a-z0-9]|[a-z0-9][a-z0-9\-_]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\z/

Foreman 企业级配置管理解决方案

构建运维体系

本文是构建运维体系的其中一个关键环节.

什么是 foreman

Foreman 是一个集成的 数据中心生命周期管理工具 ,提供了服务开通,配置管理以及报告功能,和 Puppet Dahboard 一样,Foreman也是一个 Ruby on Rails 程序. Foreman 和 Dashboard 不同的地方是在于,Foreman 更多的关注服务开通和管理数据中心的能力,例如和引导工具,PXE启动服务器,DHCP服务器及服务 器开通工具进行集成.

Foreman 机器统一管理平台:

  • Foreman与puppet集成使用,作为puppet的前端使用
  • Foreman可以作为外部节点分类器
  • Foreman可以通过facter组件显示系统信息,并且可以收集puppet报告
  • Foreman可以管理大规模节点,实现配置版本的回溯

继续阅读

Foreman 企业级配置管理解决方案

构建运维体系

本文是构建运维体系的其中一个关键环节.

什么是 foreman

Foreman 是一个集成的 数据中心生命周期管理工具 ,提供了服务开通,配置管理以及报告功能,和 Puppet Dahboard 一样,Foreman也是一个 Ruby on Rails 程序. Foreman 和 Dashboard 不同的地方是在于,Foreman 更多的关注服务开通和管理数据中心的能力,例如和引导工具,PXE启动服务器,DHCP服务器及服务 器开通工具进行集成.

Foreman 机器统一管理平台:

  • Foreman与puppet集成使用,作为puppet的前端使用
  • Foreman可以作为外部节点分类器
  • Foreman可以通过facter组件显示系统信息,并且可以收集puppet报告
  • Foreman可以管理大规模节点,实现配置版本的回溯

继续阅读