- Digg the Blog » Blog Archive » Master of Puppets #1: ralsh
- 日本IBM広報 (IBMJapan_PR) on Twitter
ftnk.jp -> ~fumi -> ChangeLog -> 2009-07 -> 2009-07-06
2009-07 / 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
2009-07-06 Mon
■ 今日の del.icio.us (2009-07-06)
puppet のバージョンを上げようと思い,
rpm を作っている時に,ralsh の存在に気づいたのでメモ.
Puppet の RAL(って何?)を直接扱うためのコマンド.
ralsh --helpすると説明がでるんだけど,そこには以下のような例がある.
EXAMPLEどうやら,Puppet の設定を吐いてくれるみたい.
===
This example uses ``ralsh`` to return Puppet configuration for the user
``luke``::
$ ralsh user luke user { 'luke': home => '/home/luke', uid => '100', ensure => 'present', comment => 'Luke Kanies,,,', gid => '1000', shell => '/bin/bash', groups => ['sysadmin','audio','video','puppet'] }
他にも,package
# ralsh package puppet-server
package { 'puppet-server':
ensure => '0.24.5-1.el5'
}
service
# ralsh service puppet-server
service { 'puppet-server':
ensure => 'running',
enable => 'false'
}
等の設定を吐いてくれるっぽい.
また,
- Digg the Blog » Blog Archive » Master of Puppets #1: ralsh
http://blog.digg.com/?p=335
によると,以下のように引数を渡してやると,
ユーザ newuser を作成し,その設定を吐いてくれるみたい.
# 以下の例では managehome がないので /home/newuser は作られない.
~$ ralsh user newuser uid=9999 gid=9999 home=/home/newuser shell=/bin/bash ensure=present
notice: /User[newuser]/ensure: created
user { ‘newuser’:
uid => ‘9999′,
gid => ‘9999′,
home => ‘/home/newuser’,
shell => ‘/bin/bash’,
password => ‘!’,
ensure => ‘present’
}
また,以下のように cron の設定もできるみたい.
~$ ralsh cron check_my_mail command="/usr/bin/fetchmail mail.my.mail.server" user=plathrop hour='*' minute='*/30' ensure=present
notice: /Cron[check_my_mail]/ensure: created
cron { ‘check_my_mail’:
command => ‘/usr/bin/fetchmail mail.my.mail.server’,
monthday => ‘absent’,
hour => ['*'],
environment => ”,
target => ‘plathrop’,
special => ”,
minute => ['*/30'],
user => ‘plathrop’,
ensure => ‘present’,
weekday => ‘absent’,
month => ‘absent’
}
Puppet で cron を扱えるというのは知らなかったんだけど,これは /etc/cron.d にでもファイルを書いてくれるのだろうか.
/etc/cron.d 以下にファイルを書いてくれるなら,
source を使って直接ファイルを配布した方が簡単な気もする.
このへんはどうなってるか,あとで試す.
- puppet - Trac
http://reductivelabs.com/trac/puppet
ref.
- puppet-mode [2009-07-04-3]
- puppet を使ってみる [2009-04-03-1]
- Puppet による変更をメールで通知する [2008-08-29-7]
- Puppet を使って client にパッケージをインストールする [2008-08-28-3]
- CentOS 5.2 に puppet を rpm でインストールする [2008-08-28-1]





