solaris11 puppet

僕は誤字脱字が多いですが、頑張って解釈して読んで下さい。


巷では、Windows8の話題で盛り上がっていましたが、同時期にsolaris11.1がリリースされておりました。

Windows8は、インストールしただけではWindows8タッチパネルになりませんが、
solaris11.1は、インストールしただけでタッチパネルになります(嘘です)

solaris11.1はインストールしただけで、クラウド環境を作れます。(本当)


Gentooは、インストールするだけで一苦労ですね。(僕がお休みの間に勝手にサーバがGentooになっておりますが)


そんなどうでもいい話しを置いておきます。


solaris11 に puppet2.7 を インストールしてみました。

たぶん、間違っている部分がたくさんあると思いますが、いい感じに解釈をお願い致します。

後で修正してきます。


sourceforge.jpからJapan OpenSolaris Users Group Packagesのパッケージを取得します。

hg clone http://hg.sourceforge.jp/view/jposug/contrib-spec-files/

CBE(Common Build Environment)でパッケージを作ります。
googleで『solaris11 Common Build Environment』検索すればOK!

ruby-18/facter
puppetをビルドして下さいね。

リポジトリ登録
CBEでビルドしたパッケージのリポジトリを登録します。

root@puppet-master:~# pkg set-publisher -O http://192.168.1.80 ando_ando_ando_repo

rubyのインストール

  root@puppet-master:~# pkg install ruby-18
             Packages to install:  1
                    Create boot environment: No
                    Create backup boot environment: No
  
                    DOWNLOAD                                  PKGS       FILES    XFER (MB)
                    Completed                                  1/1 12001/12001      6.3/6.3                                                                                                                                                                      
  
                    PHASE                                        ACTIONS
                    Install Phase                            14016/14016 
  
                    PHASE                                          ITEMS
                    Package State Update Phase                       1/1 
                    Image State Update Phase                         2/2 


puppetのインストール

  root@puppet-master:~# pkg install pkg:/system/management/puppet/server@2.7.16-0.0.175.0.0.0.2.0
  root@puppet-master:~# pkg install puppet
             Packages to install:  1
                    Create boot environment: No
                    Create backup boot environment: No
                                Services to change:  1
  
                                DOWNLOAD                                  PKGS       FILES    XFER (MB)
                                Completed                                  1/1     814/814      1.1/1.1
  
                                PHASE                                        ACTIONS
                                Install Phase                              1008/1008 
  
                                PHASE                                          ITEMS
                                Package State Update Phase                       1/1 
                                Image State Update Phase                         2/2 


puppetのインストール確認

  root@puppet-master:~#  svcs -a | grep puppet
  online         14:08:28 svc:/network/puppetd:default
  online         14:35:46 svc:/network/puppetmasterd:default


puppetのパス設定

  root@puppet-master:~# vim .profile 
  export PATH=/usr/bin:/usr/sbin:/usr/ruby/1.8/sbin/:/usr/ruby/1.8/bin/


Puppetサーバ/クライアント間の証明書の設定

puppetサーバのhostsファイル編集

  root@puppet-master:~# vim /etc/hosts
  192.168.1.2 puppet

puppetクライアントのhostsファイル編集::

  root@puppet:~# vim /etc/hosts
  192.168.1.3 puppet-master

Puppetサーバの起動

  root@puppet-master:~# puppetmasterd --debug --no-daemonize --verbose
  debug: Failed to load library 'shadow' for feature 'libshadow'
  debug: Puppet::Type::User::ProviderLdap: true value when expecting false
  debug: Puppet::Type::User::ProviderUseradd: file chage does not exist
  debug: Puppet::Type::User::ProviderPw: file pw does not exist
  debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl does not exist
  debug: Failed to load library 'selinux' for feature 'selinux'
  debug: Failed to load library 'ldap' for feature 'ldap'
  notice: Starting Puppet master version 2.7.16
  debug: Finishing transaction 70405690
  debug: No file server configuration file; autocreating modules mount with default permissions
  debug: No file server configuration file; autocreating plugins mount with default permissions

selinuxのエラーがでてますね。selinuxはあの人に聞きましょうね。

Puppetクライアントの起動

 root@puppet:~# puppetd --server puppet-master --waitforcert 60 --test


puppetサーバを一時停止する

  root@puppet-master:~# puppetmasterd --debug --no-daemonize --verbose
  ^Cnotice: Caught INT; calling stop


puppetサーバで署名リクエストの確認

  root@puppet-master:~# puppetca --list
    puppet (BB:AA:CC:71:57:9B:AD:3A:B5:EC:26:4B:38:79:25:01)


puppetサーバで署名

 root@puppet-master:~# puppetca --sign puppet
 notice: Signed certificate request for puppet
 notice: Removing file Puppet::SSL::CertificateRequest puppet at '/etc/puppet/ssl/ca/requests/puppet.pem' 


puppetサーバでマニフェストの記述

  root@puppet-master:~# vim /etc/puppet/manifests/site.pp
  node 'puppet' {
            file { '/etc/inet/hoststest':
            owner => 'root',
            group => 'root',
            mode  => 644,
           }
  }


puppetサーバ起動

  root@puppet-master:~# puppetmasterd --no-daemonize --verbose
  notice: Starting Puppet master version 2.7.16


puppetクライアント起動

  root@puppet:/etc/inet# puppetd --server puppet-master --no-daemonize --verbose
  notice: Starting Puppet client version 2.7.16
  info: Caching catalog for puppet
  info: Applying configuration version '1351054723'
  notice: /Stage[main]//Node[puppet]/File[/etc/inet/hoststest]/mode: mode changed '0600' to '0644'
  notice: Finished catalog run in 0.05 seconds


puppetクライアント側でマニフェスト通り変更されているか確認

  root@puppet:/etc/inet# ls -al /etc/inet/hoststest
  -rw-r--r--   1 root     root           4 Oct 24 13:51 /etc/inet/hoststest

solaris11には、puppet3.0.0以上をオススメします。
puppet2.7だとエラーがちらほらでました。

次はSolaris11.1 puppet3で真面目に書きたいと思います。