LoginSignup
1
1

More than 5 years have passed since last update.

puppet入門3 ファイルを配布

Last updated at Posted at 2013-11-22

ファイルを配布してみよう

準備

ファイルを配布する場合、/etc/puppet/fileserver.confに設定を記述する。

/etc/puppet/fileserver.conf
[common]
  path /etc/puppet/files/common
  allow *
ディレクトリの作成
# mkdir -p /etc/puppet/files/common
# cd /etc/puppet/files/common
# cat > .vimrc <<EOF
sy on
se nowrap
se nowrapscan
se hlsearch
colorscheme desert
EOF
site.pp
node 'puppetmaster.safe' {
  package { ['w3m',
             'nkf',
             'ctags']:
    ensure => installed,
  }
  file { '/root/.vimrc':
    owner  => 'root',
    group  => 'root',
    mode   => '644',
    source => "puppet:///common/.vimrc",
  }
}

配布

# puppet agent --server=puppetmaster.safe --no-daemonize --verbose
Notice: Starting Puppet client version 3.3.2
Info: Retrieving plugin
Info: Caching catalog for puppetmaster.safe
Info: Applying configuration version '1385083559'
Notice: /Stage[main]//Node[puppetmaster.safe]/File[/root/.vimrc]/ensure: defined content as '{md5}001dd63fdb11576f7ed5c9466e1f6d32'
Notice: Finished catalog run in 0.34 seconds
/var/log/messages
Nov 22 04:25:58 puppetmaster puppet-agent[4915]: Starting Puppet client version 3.3.2
Nov 22 04:25:58 puppetmaster puppet-agent[4920]: Retrieving plugin
Nov 22 04:25:59 puppetmaster puppet-master[916]: Compiled catalog for puppetmaster.safe in environment production in 0.02 seconds
Nov 22 04:25:59 puppetmaster puppet-agent[4920]: Caching catalog for puppetmaster.safe
Nov 22 04:25:59 puppetmaster puppet-agent[4920]: Applying configuration version '1385083559'
Nov 22 04:26:00 puppetmaster puppet-agent[4920]: (/Stage[main]//Node[puppetmaster.safe]/File[/root/.vimrc]/ensure) defined content as '{md5}001dd63fdb11576f7ed5c9466e1f6d32'
Nov 22 04:26:00 puppetmaster puppet-agent[4920]: Finished catalog run in 0.34 seconds
  • /root/.vimrc が作成されたことを確認。

次はpuppet入門4 ハマった場合の対処とか

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1