源码安装 puppet 3.8.5

环境:CentOS 6.5 x86_64


  1. 安装依赖环境:

    ruby 1.8:yum安装

    ruby gem:yum安装

    openssl:yum安装

    gcc 编译环境:yum安装

源码安装 puppet 3.8.5_第1张图片

# yum install ruby gcc glibc rubygems openssl*


2. 安装好后可以安装 hiera、facter、puppet了。

下载源码包。

puppet官方源码包下载地址: https://downloads.puppetlabs.com/ 


hiera版本:1.3.4

facter版本:2.4.5

puppet版本:3.8.5

# tar xf hiera-1.3.4.tar.gz
# ruby hiera-1.3.4/install.rb
# tar xf facter-2.4.5.tar.gz
# ruby facter-2.4.5/install.rb
# tar xf puppet-3.8.5.tar.gz
# ruby puppet-3.8.5/install.rb
# puppet -V  #查看版本号
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- json (LoadError)
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/site_ruby/1.8/puppet/module.rb:3
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/site_ruby/1.8/puppet/parser/files.rb:1
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/site_ruby/1.8/puppet/parser/templatewrapper.rb:1
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/site_ruby/1.8/puppet/parser/scope.rb:6
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/site_ruby/1.8/puppet/parser/methods.rb:2
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/method_call.rb:2
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/site_ruby/1.8/puppet/parser/ast.rb:115
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/site_ruby/1.8/puppet/parser/parser.rb:11
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/site_ruby/1.8/puppet/parser.rb:4
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/site_ruby/1.8/puppet.rb:282
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:12
        from /usr/bin/puppet:7:in `require'
        from /usr/bin/puppet:7

报错,gem里面的json软件包没有安装。

# yum install rubygem-json
# 发现没有该软件包

我这里选择用yum的方式安装 rubygem-json ,首选要安装puppet 的源。

# rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm 
# yum install rubygem-json
# 或者 gem install json

源码安装 puppet 3.8.5_第2张图片

可以正常运行了。


3. 配置puppet 服务脚本

# cp puppet-3.8.5/ext/redhat/client.init  /etc/init.d/puppet    #puppet agent端服务脚本
# cp puppet-3.8.5/ext/redhat/master.init  /etc/init.d/puppetmaster    #puppet master端服务脚本
# chmod +x /etc/init.d/puppet*
# service puppet start

可以正常启动。

本文出自 “Professor哥” 博客,转载请与作者联系!

你可能感兴趣的:(Ruby,puppet,源码安装,puppetlabs)