2011年8月17日水曜日

oracle linux x86でchef-solo動かすまでのログ

** install prereq for guest additions **
yum install gcc
yum install kernel-dev
yum install kernel-uek-devel


** checkinstall のinstall***

$cd /usr/local/src/
$wget http://asic-linux.com.mx/~izto/checkinstall/files/source/checkinstall-1.6.2.tar.gz
$tar zxvf checkinstall-1.6.2.tar.gz
$cd checkinstall-1.6.2.tar.gz
$make install

  $/usr/local/sbin/checkinstall
  $rpm -i /usr/src/redhat/RPMS/x86_64/checkinstall-1.6.2-1.x86_64.rpm

  確認
  yum list checkinstall


**** ruby install**

cd /usr/local/src
wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p352.tar.gz
wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz
wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p352.tar.gz
tar zxvf ruby-1.8.7-p352.tar.gz
cd ruby-1.8.7-p352
./configure --prefix=/usr
make
checkinstall --fstrans=no
--> rpm-buildが必要と言われた

yum install rpm-build  (got from ol5_latest)
ls -ltr /usr/bin  (ruby, testrb, ri, rdoc, irb, erbが入っている)

rpm -i /usr/src/redhat/RPMS/x86_64/ruby-1.8.7-p352-1.x86_64.rpm


*** gem install ***

cd /usr/local/src
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
tar zxf rubygems-1.3.7.tgz
cd rubygems-1.3.7
ruby setup.rb --no-format-executable

gem -v ... ok
[root@localhost ruby-1.8.7-p352]# gem install chef
ERROR:  Loading command: install (LoadError)
    no such file to load -- zlib
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::Commands::InstallCommand


対処
yum install zlib-devel
cd /usr/local/src/ruby-1.8.7-p352/ext/zlib
[root@localhost zlib]# ruby extconf.rb
checking for deflateReset() in -lz... yes
checking for zlib.h... yes
checking for kind of operating system... Unix
creating Makefile

[root@localhost zlib]# ls
Makefile  doc  extconf.rb  mkmf.log  zlib.c
[root@localhost zlib]# make
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_ZLIB_H  -DOS_CODE=OS_UNIX    -fPIC -g -O2   -c zlib.c
gcc -shared -o zlib.so zlib.o -L. -L/usr/lib -Wl,-R/usr/lib -L.  -rdynamic -Wl,-export-dynamic    -lz  -lrt -ldl -lcrypt -lm   -lc
/usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
[root@localhost zlib]# ls -ltr
合計 400
-rw-r--r-- 1 10347 10347   1362  5月 29  2008 extconf.rb
-rw-r--r-- 1 10347 10347  88549  5月 23 13:49 zlib.c
drwxr-xr-x 2 10347 10347   4096  7月  2 18:53 doc
-rw-r--r-- 1 root  root    1411  8月 17 18:16 mkmf.log
-rw-r--r-- 1 root  root    3730  8月 17 18:16 Makefile
-rwxr-xr-x 1 root  root  105396  8月 17 18:17 zlib.so
-rw-r--r-- 1 root  root  152208  8月 17 18:17 zlib.o
[root@localhost zlib]# make install
/usr/bin/install -c -m 0755 zlib.so /usr/lib/ruby/site_ruby/1.8/x86_64-linux
[root@localhost zlib]# ls -ltr
合計 400
-rw-r--r-- 1 10347 10347   1362  5月 29  2008 extconf.rb
-rw-r--r-- 1 10347 10347  88549  5月 23 13:49 zlib.c
drwxr-xr-x 2 10347 10347   4096  7月  2 18:53 doc
-rw-r--r-- 1 root  root    1411  8月 17 18:16 mkmf.log
-rw-r--r-- 1 root  root    3730  8月 17 18:16 Makefile
-rwxr-xr-x 1 root  root  105396  8月 17 18:17 zlib.so
-rw-r--r-- 1 root  root  152208  8月 17 18:17 zlib.o



gemする前にproxy 設定
export http_proxy=http://xxx:80

ついに
[root@localhost zlib]# gem install chef
Building native extensions.  This could take a while...
[Version 0.7.3] AMQP connection URI parser now respects port
Building native extensions.  This could take a while...
Successfully installed mixlib-config-1.1.2
Successfully installed mixlib-cli-1.2.0
Successfully installed mixlib-log-1.3.0
Successfully installed mixlib-authentication-1.1.4
Successfully installed yajl-ruby-0.8.3
Successfully installed systemu-2.3.0
Successfully installed ohai-0.6.4
Successfully installed mime-types-1.16
Successfully installed rest-client-1.6.3
Successfully installed bunny-0.7.4
Successfully installed json-1.5.2
Successfully installed polyglot-0.3.2
Successfully installed treetop-1.4.10
Successfully installed net-ssh-2.1.4
Successfully installed net-ssh-gateway-1.1.0
Successfully installed net-ssh-multi-1.1
Successfully installed erubis-2.7.0
Successfully installed moneta-0.6.0
Successfully installed highline-1.6.2
Successfully installed uuidtools-2.1.2
Successfully installed chef-0.10.4
21 gems installed
Installing ri documentation for mixlib-config-1.1.2...
Installing ri documentation for mixlib-cli-1.2.0...
Unrecognized directive 'short' in README.rdoc
Unrecognized directive 'long' in README.rdoc
Unrecognized directive 'description' in README.rdoc
Unrecognized directive 'default' in README.rdoc
Unrecognized directive 'required' in README.rdoc
Unrecognized directive 'on' in README.rdoc
Unrecognized directive 'boolean' in README.rdoc
Unrecognized directive 'show_options' in README.rdoc
Unrecognized directive 'exit' in README.rdoc
Unrecognized directive 'proc' in README.rdoc
Installing ri documentation for mixlib-log-1.3.0...
Installing ri documentation for mixlib-authentication-1.1.4...
Installing ri documentation for yajl-ruby-0.8.3...
Installing ri documentation for systemu-2.3.0...
Installing ri documentation for ohai-0.6.4...
Installing ri documentation for mime-types-1.16...
Installing ri documentation for rest-client-1.6.3...
Installing ri documentation for bunny-0.7.4...
Installing ri documentation for json-1.5.2...
Installing ri documentation for polyglot-0.3.2...
Installing ri documentation for treetop-1.4.10...
Installing ri documentation for net-ssh-2.1.4...
Installing ri documentation for net-ssh-gateway-1.1.0...
Installing ri documentation for net-ssh-multi-1.1...
Installing ri documentation for erubis-2.7.0...
Installing ri documentation for moneta-0.6.0...
Installing ri documentation for highline-1.6.2...
Installing ri documentation for uuidtools-2.1.2...
Installing ri documentation for chef-0.10.4...
Installing RDoc documentation for mixlib-config-1.1.2...
Installing RDoc documentation for mixlib-cli-1.2.0...
Unrecognized directive 'short' in README.rdoc
Unrecognized directive 'long' in README.rdoc
Unrecognized directive 'description' in README.rdoc
Unrecognized directive 'default' in README.rdoc
Unrecognized directive 'required' in README.rdoc
Unrecognized directive 'on' in README.rdoc
Unrecognized directive 'boolean' in README.rdoc
Unrecognized directive 'show_options' in README.rdoc
Unrecognized directive 'exit' in README.rdoc
Unrecognized directive 'proc' in README.rdoc
Installing RDoc documentation for mixlib-log-1.3.0...
Installing RDoc documentation for mixlib-authentication-1.1.4...
Installing RDoc documentation for yajl-ruby-0.8.3...
Installing RDoc documentation for systemu-2.3.0...
Installing RDoc documentation for ohai-0.6.4...
Installing RDoc documentation for mime-types-1.16...
Installing RDoc documentation for rest-client-1.6.3...
Installing RDoc documentation for bunny-0.7.4...
Could not find main page README.rdoc
Could not find main page README.rdoc
Could not find main page README.rdoc
Could not find main page README.rdoc
Installing RDoc documentation for json-1.5.2...
Installing RDoc documentation for polyglot-0.3.2...
Installing RDoc documentation for treetop-1.4.10...
Installing RDoc documentation for net-ssh-2.1.4...
Installing RDoc documentation for net-ssh-gateway-1.1.0...
Installing RDoc documentation for net-ssh-multi-1.1...
Installing RDoc documentation for erubis-2.7.0...
Installing RDoc documentation for moneta-0.6.0...
Installing RDoc documentation for highline-1.6.2...
Installing RDoc documentation for uuidtools-2.1.2...
Installing RDoc documentation for chef-0.10.4...
[root@localhost zlib]#




[root@localhost zlib]# knife
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- openssl.so (LoadError)
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/1.8/openssl.rb:17
        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/1.8/net/https.rb:102
        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/gems/1.8/gems/chef-0.10.4/lib/chef/rest.rb:23
        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/gems/1.8/gems/chef-0.10.4/lib/chef/knife.rb:26
        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/gems/1.8/gems/chef-0.10.4/lib/chef/application/knife.rb:18
        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/gems/1.8/gems/chef-0.10.4/bin/knife:23
        from /usr/bin/knife:19:in `load'
        from /usr/bin/knife:19



[root@localhost zlib]# chef-solo
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- openssl.so (LoadError)
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/lib/ruby/1.8/openssl.rb:17
        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/1.8/net/https.rb:102
        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/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/rest.rb:23
        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/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/search/query.rb:21
        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/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/mixin/language.rb:19
        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/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource.rb:22
        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/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource/file.rb:19
        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/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/provider/file.rb:21
        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/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/provider/cookbook_file.rb:20
        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/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/providers.rb:20
        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/gems/1.8/gems/chef-0.10.4/bin/../lib/chef.rb:25
        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/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application/solo.rb:18
        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/gems/1.8/gems/chef-0.10.4/bin/chef-solo:23
        from /usr/bin/chef-solo:19:in `load'
        from /usr/bin/chef-solo:19
[root@localhost zlib]#


対処
cd /usr/local/src/ruby-1.8.7-p352
./configure --prefix=/usr --disable-option-checking --with-openssl-dir=/usr/lib/openssl
make
checkinstall --fstrans=no
rpm -i /usr/src/redhat/RPMS/x86_64/ruby-1.8.7-p352-1.x86_64.rpm


このあとknifeしてもだめだたt。。。




yum install openssl-devel




[root@localhost rubygems-1.3.7]# cd ../ruby-1.8.7-p352
[root@localhost ruby-1.8.7-p352]# ls
"$as_dir"      class.c        dmydln.c      inits.c           missing.h    re.c         st.h
COPYING        class.o        dmyext.c      inits.o           mkconfig.rb  re.h         st.o
COPYING.ja     common.mk      dmyext.o      install-sh        node.h       re.o         string.c
ChangeLog      compar.c       doc           instruby.rb       numeric.c    regex.c      string.o
GPL            compar.o       enum.c        intern.h          numeric.o    regex.h      struct.c
LEGAL          config.guess   enum.o        io.c              object.c     regex.o      struct.o
LGPL           config.h       enumerator.c  io.o              object.o     ruby         test
Makefile       config.log     enumerator.o  keywords          pack.c       ruby.1       time.c
Makefile.in    config.status  env.h         lex.c             pack.o       ruby.c       time.o
NEWS           config.sub     error.c       lib               parse.c      ruby.h       util.c
README         configure      error.o       libruby-static.a  parse.o      ruby.o       util.h
README.EXT     configure.in   eval.c        main.c            parse.y      rubyio.h     util.o
README.EXT.ja  cygwin         eval.o        main.o            prec.c       rubysig.h    variable.c
README.ja      defines.h      ext           marshal.c         prec.o       rubytest.rb  variable.o
ToDo           dir.c          file.c        marshal.o         process.c    runruby.rb   version.c
array.c        dir.o          file.o        math.c            process.o    sample       version.h
array.o        distruby.rb    gc.c          math.o            random.c     signal.c     version.o
bcc32          djgpp          gc.o          mdoc2man.rb       random.o     signal.o     vms
bignum.c       dln.c          hash.c        miniruby          range.c      sprintf.c    win32
bignum.o       dln.h          hash.o        misc              range.o      sprintf.o    wince
bin            dln.o          ia64.s        missing           rbconfig.rb  st.c         x68
[root@localhost ruby-1.8.7-p352]# cd ext/
[root@localhost ext]# ls
Setup         Setup.nt    curses  etc       iconv    pty         sdbm      syck    win32ole
Setup.atheos  Setup.x68   dbm     extmk.rb  io       purelib.rb  socket    syslog  zlib
Setup.dj      Win32API    digest  fcntl     nkf      racc        stringio  thread
Setup.emx     bigdecimal  dl      gdbm      openssl  readline    strscan   tk
[root@localhost ext]# cd openssl/
[root@localhost openssl]# ls
Makefile           ossl_bio.c     ossl_engine.c   ossl_pkcs5.c     ossl_rand.c         ossl_x509crl.c
extconf.rb         ossl_bio.h     ossl_engine.h   ossl_pkcs5.h     ossl_rand.h         ossl_x509ext.c
lib                ossl_bn.c      ossl_hmac.c     ossl_pkcs7.c     ossl_ssl.c          ossl_x509name.c
mkmf.log           ossl_bn.h      ossl_hmac.h     ossl_pkcs7.h     ossl_ssl.h          ossl_x509req.c
openssl_missing.c  ossl_cipher.c  ossl_ns_spki.c  ossl_pkey.c      ossl_ssl_session.c  ossl_x509revoked.c
openssl_missing.h  ossl_cipher.h  ossl_ns_spki.h  ossl_pkey.h      ossl_version.h      ossl_x509store.c
ossl.c             ossl_config.c  ossl_ocsp.c     ossl_pkey_dh.c   ossl_x509.c         ruby_missing.h
ossl.h             ossl_config.h  ossl_ocsp.h     ossl_pkey_dsa.c  ossl_x509.h
ossl_asn1.c        ossl_digest.c  ossl_pkcs12.c   ossl_pkey_ec.c   ossl_x509attr.c
ossl_asn1.h        ossl_digest.h  ossl_pkcs12.h   ossl_pkey_rsa.c  ossl_x509cert.c
[root@localhost openssl]# ls /usr/local/ssl
ls: /usr/local/ssl: そのようなファイルやディレクトリはありません
[root@localhost openssl]# ls /usr/local/ssl
ls: /usr/local/ssl: そのようなファイルやディレクトリはありません
[root@localhost openssl]# ls /usr/local
bin  etc  games  include  lib  lib64  libexec  sbin  share  src
[root@localhost openssl]# ruby extconf.rb --with-openssl-dir=/usr/local/openssl
=== OpenSSL for Ruby configurator ===
=== Checking for system dependent stuff... ===
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for assert.h... yes
=== Checking for required stuff... ===
checking for openssl/ssl.h... yes
checking for OpenSSL_add_all_digests() in -lcrypto... yes
checking for SSL_library_init() in -lssl... yes
checking for openssl/conf_api.h... yes
checking for rb_str_set_len() in ruby.h... yes
checking for rb_block_call() in ruby.h... yes
=== Checking for OpenSSL features... ===
checking for ERR_peek_last_error()... yes
checking for BN_mod_add()... yes
checking for BN_mod_sqr()... yes
checking for BN_mod_sub()... yes
checking for BN_pseudo_rand_range()... yes
checking for BN_rand_range()... yes
checking for CONF_get1_default_config_file()... yes
checking for EVP_CIPHER_CTX_copy()... no
checking for EVP_CIPHER_CTX_set_padding()... yes
checking for EVP_CipherFinal_ex()... yes
checking for EVP_CipherInit_ex()... yes
checking for EVP_DigestFinal_ex()... yes
checking for EVP_DigestInit_ex()... yes
checking for EVP_MD_CTX_cleanup()... yes
checking for EVP_MD_CTX_create()... yes
checking for EVP_MD_CTX_destroy()... yes
checking for EVP_MD_CTX_init()... yes
checking for HMAC_CTX_cleanup()... yes
checking for HMAC_CTX_copy()... no
checking for HMAC_CTX_init()... yes
checking for PEM_def_callback()... yes
checking for PKCS5_PBKDF2_HMAC()... no
checking for PKCS5_PBKDF2_HMAC_SHA1()... yes
checking for X509V3_set_nconf()... yes
checking for X509V3_EXT_nconf_nid()... yes
checking for X509_CRL_add0_revoked()... yes
checking for X509_CRL_set_issuer_name()... yes
checking for X509_CRL_set_version()... yes
checking for X509_CRL_sort()... yes
checking for X509_NAME_hash_old()... no
checking for X509_STORE_get_ex_data()... no
checking for X509_STORE_set_ex_data()... no
checking for OBJ_NAME_do_all_sorted()... yes
checking for SSL_SESSION_get_id()... yes
checking for OPENSSL_cleanse()... yes
checking for SSLv2_method()... yes
checking for SSLv2_server_method()... yes
checking for SSLv2_client_method()... yes
checking for SSL_set_tlsext_host_name() in openssl/ssl.h... no
checking for SSL_set_tlsext_host_name in openssl/ssl.h... no
checking for openssl/engine.h... yes
checking for ENGINE_add()... yes
checking for ENGINE_load_builtin_engines()... yes
checking for ENGINE_load_openbsd_dev_crypto()... no
checking for ENGINE_get_digest()... yes
checking for ENGINE_get_cipher()... yes
checking for ENGINE_cleanup()... yes
checking for ENGINE_load_4758cca()... no
checking for ENGINE_load_aep()... no
checking for ENGINE_load_atalla()... no
checking for ENGINE_load_chil()... no
checking for ENGINE_load_cswift()... no
checking for ENGINE_load_nuron()... no
checking for ENGINE_load_sureware()... no
checking for ENGINE_load_ubsec()... no
checking for openssl/ocsp.h... yes
checking for EVP_CIPHER_CTX.flags in openssl/evp.h... yes
checking for EVP_CIPHER_CTX.engine in openssl/evp.h... yes
checking for X509_ATTRIBUTE.single in openssl/x509.h... yes
=== Checking done. ===
creating extconf.h
creating Makefile
Done.
[root@localhost openssl]# make
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_x509crl.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_ssl_session.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_x509cert.c
ossl_x509cert.c: In function ‘ossl_x509_inspect’:
ossl_x509cert.c:693: 警告: initialization discards qualifiers from pointer target type
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_bio.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_pkey_ec.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_pkey_dh.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_bn.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_x509ext.c
ossl_x509ext.c: In function ‘ossl_x509ext_initialize’:
ossl_x509ext.c:286: 警告: passing argument 2 of ‘d2i_X509_EXTENSION’ from incompatible pointer type
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_hmac.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_rand.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_pkey_rsa.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c openssl_missing.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_ssl.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_config.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_pkcs5.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_pkcs12.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_x509name.c
ossl_x509name.c: In function ‘ossl_x509name_initialize’:
ossl_x509name.c:143: 警告: passing argument 2 of ‘d2i_X509_NAME’ from incompatible pointer type
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_engine.c
ossl_engine.c: In function ‘ossl_engine_inspect’:
ossl_engine.c:347: 警告: initialization discards qualifiers from pointer target type
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_ns_spki.c
ossl_ns_spki.c: In function ‘ossl_spki_initialize’:
ossl_ns_spki.c:67: 警告: passing argument 2 of ‘d2i_NETSCAPE_SPKI’ from incompatible pointer type
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_x509attr.c
ossl_x509attr.c: In function ‘ossl_x509attr_initialize’:
ossl_x509attr.c:104: 警告: passing argument 2 of ‘d2i_X509_ATTRIBUTE’ from incompatible pointer type
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_pkey_dsa.c
ossl_pkey_dsa.c: In function ‘ossl_dsa_initialize’:
ossl_pkey_dsa.c:165: 警告: passing argument 1 of ‘PEM_ASN1_read_bio’ from incompatible pointer type
ossl_pkey_dsa.c:165: 警告: passing argument 4 of ‘PEM_ASN1_read_bio’ from incompatible pointer type
ossl_pkey_dsa.c: In function ‘ossl_dsa_to_public_key’:
ossl_pkey_dsa.c:370: 警告: passing argument 2 of ‘ASN1_dup’ from incompatible pointer type
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_asn1.c
ossl_asn1.c: In function ‘decode_bool’:
ossl_asn1.c:317: 警告: passing argument 2 of ‘d2i_ASN1_BOOLEAN’ from incompatible pointer type
ossl_asn1.c: In function ‘decode_int’:
ossl_asn1.c:332: 警告: passing argument 2 of ‘d2i_ASN1_INTEGER’ from incompatible pointer type
ossl_asn1.c: In function ‘decode_enum’:
ossl_asn1.c:372: 警告: passing argument 2 of ‘d2i_ASN1_ENUMERATED’ from incompatible pointer type
ossl_asn1.c: In function ‘decode_null’:
ossl_asn1.c:389: 警告: passing argument 2 of ‘d2i_ASN1_NULL’ from incompatible pointer type
ossl_asn1.c: In function ‘decode_obj’:
ossl_asn1.c:406: 警告: passing argument 2 of ‘d2i_ASN1_OBJECT’ from incompatible pointer type
ossl_asn1.c: In function ‘decode_time’:
ossl_asn1.c:434: 警告: passing argument 2 of ‘d2i_ASN1_TIME’ from incompatible pointer type
ossl_asn1.c: In function ‘ossl_asn1_decode0’:
ossl_asn1.c:726: 警告: passing argument 1 of ‘ASN1_get_object’ from incompatible pointer type
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_pkey.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_digest.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_x509store.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_x509req.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_ocsp.c
ossl_ocsp.c: In function ‘ossl_ocspreq_initialize’:
ossl_ocsp.c:114: 警告: passing argument 2 of ‘d2i_OCSP_REQUEST’ from incompatible pointer type
ossl_ocsp.c: In function ‘ossl_ocspres_initialize’:
ossl_ocsp.c:321: 警告: passing argument 2 of ‘d2i_OCSP_RESPONSE’ from incompatible pointer type
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_pkcs7.c
ossl_pkcs7.c: In function ‘ossl_pkcs7si_new’:
ossl_pkcs7.c:89: 警告: passing argument 2 of ‘ASN1_dup’ from incompatible pointer type
ossl_pkcs7.c: In function ‘DupPKCS7SignerPtr’:
ossl_pkcs7.c:102: 警告: passing argument 2 of ‘ASN1_dup’ from incompatible pointer type
ossl_pkcs7.c: In function ‘ossl_pkcs7ri_new’:
ossl_pkcs7.c:115: 警告: passing argument 2 of ‘ASN1_dup’ from incompatible pointer type
ossl_pkcs7.c: In function ‘DupPKCS7RecipientPtr’:
ossl_pkcs7.c:128: 警告: passing argument 2 of ‘ASN1_dup’ from incompatible pointer type
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_x509.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_x509revoked.c
ossl_x509revoked.c: In function ‘ossl_x509revoked_new’:
ossl_x509revoked.c:48: 警告: passing argument 2 of ‘ASN1_dup’ from incompatible pointer type
ossl_x509revoked.c: In function ‘DupX509RevokedPtr’:
ossl_x509revoked.c:64: 警告: passing argument 2 of ‘ASN1_dup’ from incompatible pointer type
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/openssl/include    -fPIC -g -O2   -c ossl_cipher.c
ossl_cipher.c: In function ‘ossl_cipher_init’:
ossl_cipher.c:191: 警告: initialization discards qualifiers from pointer target type
ossl_cipher.c: In function ‘ossl_cipher_update_deprecated’:
ossl_cipher.c:314: 警告: assignment discards qualifiers from pointer target type
gcc -shared -o openssl.so ossl_x509crl.o ossl_ssl_session.o ossl_x509cert.o ossl_bio.o ossl_pkey_ec.o ossl_pkey_dh.o ossl_bn.o ossl_x509ext.o ossl_hmac.o ossl_rand.o ossl_pkey_rsa.o ossl.o openssl_missing.o ossl_ssl.o ossl_config.o ossl_pkcs5.o ossl_pkcs12.o ossl_x509name.o ossl_engine.o ossl_ns_spki.o ossl_x509attr.o ossl_pkey_dsa.o ossl_asn1.o ossl_pkey.o ossl_digest.o ossl_x509store.o ossl_x509req.o ossl_ocsp.o ossl_pkcs7.o ossl_x509.o ossl_x509revoked.o ossl_cipher.o -L. -L/usr/lib -Wl,-R/usr/lib -L/usr/local/openssl/lib -Wl,-R/usr/local/openssl/lib -L.  -rdynamic -Wl,-export-dynamic    -lssl -lcrypto  -lrt -ldl -lcrypt -lm   -lc
/usr/bin/ld: skipping incompatible /usr/lib/libssl.so when searching for -lssl
/usr/bin/ld: skipping incompatible /usr/lib/libssl.a when searching for -lssl
/usr/bin/ld: skipping incompatible /usr/lib/libcrypto.so when searching for -lcrypto
/usr/bin/ld: skipping incompatible /usr/lib/libcrypto.a when searching for -lcrypto
[root@localhost openssl]#
[root@localhost openssl]#
[root@localhost openssl]# make install
/usr/bin/install -c -m 0755 openssl.so /usr/lib/ruby/site_ruby/1.8/x86_64-linux
mkdir -p /usr/lib/ruby/site_ruby/1.8/net
mkdir -p /usr/lib/ruby/site_ruby/1.8/openssl
/usr/bin/install -c -m 644 ./lib/net/telnets.rb /usr/lib/ruby/site_ruby/1.8/net
/usr/bin/install -c -m 644 ./lib/net/ftptls.rb /usr/lib/ruby/site_ruby/1.8/net
/usr/bin/install -c -m 644 ./lib/openssl.rb /usr/lib/ruby/site_ruby/1.8
/usr/bin/install -c -m 644 ./lib/openssl/bn.rb /usr/lib/ruby/site_ruby/1.8/openssl
/usr/bin/install -c -m 644 ./lib/openssl/pkcs7.rb /usr/lib/ruby/site_ruby/1.8/openssl
/usr/bin/install -c -m 644 ./lib/openssl/ssl.rb /usr/lib/ruby/site_ruby/1.8/openssl
/usr/bin/install -c -m 644 ./lib/openssl/config.rb /usr/lib/ruby/site_ruby/1.8/openssl
/usr/bin/install -c -m 644 ./lib/openssl/digest.rb /usr/lib/ruby/site_ruby/1.8/openssl
/usr/bin/install -c -m 644 ./lib/openssl/ssl-internal.rb /usr/lib/ruby/site_ruby/1.8/openssl
/usr/bin/install -c -m 644 ./lib/openssl/x509.rb /usr/lib/ruby/site_ruby/1.8/openssl
/usr/bin/install -c -m 644 ./lib/openssl/cipher.rb /usr/lib/ruby/site_ruby/1.8/openssl
/usr/bin/install -c -m 644 ./lib/openssl/buffering.rb /usr/lib/ruby/site_ruby/1.8/openssl
/usr/bin/install -c -m 644 ./lib/openssl/x509-internal.rb /usr/lib/ruby/site_ruby/1.8/openssl
[root@localhost openssl]#



knife できたよ^-----





[root@localhost ~]# mkdir -p ~/chef-repo/.chef
[root@localhost ~]# mkdir -p ~/chef-repo/cookbooks
[root@localhost ~]# cd ~/chef-repo/.chef
[root@localhost .chef]# cp /media/sf_share/knife.rb .
[root@localhost .chef]# cp /media/sf_share/xxx.pem .
[root@localhost .chef]# cp /media/sf_share/xxx.pem .

vi knife.rbで以下を追加
http_proxy                "http://xxxxm:80"
https_proxy               "http://xxx:80"

require 'rest-client'
RestClient.proxy = "http://xxx:80"


mkdir /etc/chef
vi /etc/chef/solo.rb
以下を追加
home_path = ENV['HOME']
file_cache_path "#{home_path}/chef-repo"
cookbook_path "#{home_path}/chef-repo/cookbooks"

proxy setting for chef (knife)

I wanted to use knife commands to download and upload to chef hosts.

My chef version is 0.10.4.

1. Add "http_proxy", "https_proxy" to knife.rb. Only "http_proxy" will not do. Need both.
   See if knife works with "knife node list"
2. The above will do for just download but doesn't work for uploads.
   You will need to add" require 'rest-client'" and RestClient.proxy = "http://yourproxyserver:port"
   Test by "knife cookbook upload xxxxx"

Also, be sure to have ruby version 1.8.7 or above because uploading will not work with 1.8.6.
Because chef uses ruby's "tap" method and it is supported from 1.8.7.













**My knife.rb example************************





current_dir = File.dirname(__FILE__)
log_level                :debug
log_location             STDOUT
node_name                "xxx"
client_key               "#{current_dir}/xxx.pem"
validation_client_name   "xxx-validator"
validation_key           "#{current_dir}/xxx-validator.pem"
chef_server_url          "https://api.opscode.com/organizations/xxx"
cache_type               'BasicFile'
cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )
cookbook_path            ["#{current_dir}/../cookbooks"]
http_proxy                "http://setyourproxyserver:80"
https_proxy               "http://setyourproxyserver:80"

require 'rest-client'
RestClient.proxy = "http://setyourproxyserver:80"




**************************************************


2011年8月10日水曜日

centos からインスタンス作成後にやる必要のある設定


cookbookでs3cmdを使っているとエラーする。

s3ダウンロードのための設定ができていないので、行う必要がある。詳しくは
s3のファイルをダウンロードする方法

以下2点設定するとOKになった。
・ /etc/s3conf/s3config.ymlにawsのアクセスキーを設定
・export AWS_CALLING_FORMAT="SUBDOMAIN"

2011年8月9日火曜日

chef今後のタスク

weblogic
レシピ
サイレントインストール
template でattributeを使えるようにするだけ
ドメイン作成
wlstオフラインで作成。
そのためには、wlst用の環境変数をセットする。
また、ドメイン作成のpyファイル作成して実行。
サーバー作成
サーバー作成のpyファイル。サーバー名とポートはノードattributeから取得。
クラスタ作成
クラスタ作成のpyファイル。ターゲットサーバーはattribute。
webサーバー連携設定
デプロイ
s3からwarダウンロードしてそれをwlstのデプロイコマンド
起動


cohe
レシピ

インストール
ec2設定
pof使用設定
起動
テストケース


oracle linux へのchefいんすとーる

tux
soloで。



templateに対して任意の値をセットするにはどうすればいいか?

マニュアルに書いてある
http://wiki.opscode.com/display/chef/Templates

attributeを使いたい場合

 <%= %>の間にattributeを入れる 

attribute例

 node[:fqdn] = "latte"

reciepeの中のresourceのvariablesにセットする場合
 <%= @ %>の間に変数名を入れる

resource例
template "/tmp/foo" do
  source "foo.erb"
  variables({
    :x_men => "are keen"
  })
end

サンプルtemplate

The node <%= node[:fqdn] %> thinks the x-men <%= @x_men %>