安装puppet需要安装ruby,facter,puppet,我选择使用源码安装,过程如下:
1、安装ruby,我使用的版本是ruby-2.0.0-rc2
-
wget -P /opt/
-
cd /opt/
-
tar zxf ruby-2.0.0-rc2.tar.gz
-
./configure --prefix=/usr/local/webserver/puppet
-
make
-
make install
在make时可能会报错:
make[2]: *** [ossl_pkey_ec.o] Error 1
make[1]: *** [ext/openssl/all] Error 2
解决办法:
修改文件ext/openssl/ossl_pkey_ec.c,增加标红部分
-
753
-
754 if (id == s_GFp_simple) {
-
755 method = EC_GFp_simple_method();
-
756 } else if (id == s_GFp_mont) {
-
757 method = EC_GFp_mont_method();
-
758 } else if (id == s_GFp_nist) {
-
759 method = EC_GFp_nist_method();
-
760 #if !defined(OPENSSL_NO_EC2M)
-
761 } else if (id == s_GF2m_simple) {
-
762 method = EC_GF2m_simple_method();
-
763 #endif
-
764 }
-
765
-
815 if (id == s_GFp) {
-
816 new_curve = EC_GROUP_new_curve_GFp;
-
817 #if !defined(OPENSSL_NO_EC2M)
-
818 } else if (id == s_GF2m) {
-
819 new_curve = EC_GROUP_new_curve_GF2m;
-
820 #endif
-
821 } else {
-
822 ossl_raise(rb_eArgError, "unknown symbol, must be :GFp or :GF2m");
-
823 }
2、安装ruby扩展
-
/usr/local/webserver/puppet/bin/ruby -r base64 -e "puts:installed"
-
/usr/local/webserver/puppet/bin/ruby -r cgi -e "puts:installed"
-
/usr/local/webserver/puppet/bin/ruby -r digest/md5 -e "puts:installed"
-
/usr/local/webserver/puppet/bin/ruby -r etc -e "puts:installed"
-
/usr/local/webserver/puppet/bin/ruby -r fileutils -e "puts:installed"
-
/usr/local/webserver/puppet/bin/ruby -r ipaddr -e "puts:installed"
-
/usr/local/webserver/puppet/bin/ruby -r openssl -e "puts:installed"
-
/usr/local/webserver/puppet/bin/ruby -r strscan -e "puts:installed"
-
/usr/local/webserver/puppet/bin/ruby -r syslog -e "puts:installed"
-
/usr/local/webserver/puppet/bin/ruby -r uri -e "puts:installed"
-
/usr/local/webserver/puppet/bin/ruby -r webrick -e "puts:installed"
-
/usr/local/webserver/puppet/bin/ruby -r webrike/https -e "puts:installed"
-
/usr/local/webserver/puppet/bin/ruby -r xmlrpc -e "puts:installed"
错误解决:/usr/local/webserver/puppet/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- openssl (LoadError)
from /usr/local/webserver/puppet/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
解决方法:
-
yum -y install openssl-dev* libssl*
-
cd /data/soft/ruby-2.0.0-rc2/ext/openssl
-
ruby extconf.rb
-
make
-
make install
3、安装ruby-shadow
-
git clone https://github.com/apalmblad/ruby-shadow
-
-
cd ruby-shadow/
-
-
ruby extconf.rb
-
-
make
-
-
make install
4、安装facter
-
wget http://downloads.puppetlabs.com/facter/facter-2.4.4.tar.gz -P /opt
-
tar zxf facter-2.4.4.tar.gz
-
cd facter-2.4.4
-
/usr/local/webserver/puppet/bin/ruby install.rb
5、安装puppet
-
wget http://downloads.puppetlabs.com/puppet/puppet-2.7.26.tar.gz -P /opt/
-
tar zxf puppet-2.7.26.tar.gz
-
cd puppet-2.7.26
-
/usr/local/webserver/puppet/bin/ruby install.rb --full
-
cp /opt/puppet-2.7.26/examples/etc/puppet/puppet.conf /etc/puppet/
-
cp /opt/puppet-2.7.26/examples/etc/puppet/fileserver.conf /etc/puppet/
-
cp /opt/puppet-2.7.26/examples/etc/puppet/tagmail.conf /etc/puppet/
阅读(2698) | 评论(0) | 转发(0) |