LoginSignup
1
1

More than 5 years have passed since last update.

proxmox3.4でpuppetmaster構築

Last updated at Posted at 2015-08-27

インストール

apt-get install -y puppetmaster git

設定

  • rootで操作
自分自身が登録されていることを確認
puppet cert --list --all
cd /etc/puppet/
git config --global user.name tukiyo3
git config --global user.email tukiyo3@gmail.com
git init && git add -A && git commit -m "init"
cd manifests

パッケージのインストール

/etc/puppet/manifests/site.pp
node 'prime.local' {
  package { ['w3m', 'vim', 'nkf', 'git']:
    ensure => installed,
  } 
}
動作確認
# テスト実行
puppet agent --server=prime.local --test --verbose --noop
# オプション短縮形
puppet agent --server=prime.local -t -v --noop
  • もしroot権限のため実行できないと出た場合は--enableオプションをつける。
適用
puppet agent --server=prime.local -t -v

ファイル配布(proxmox用)

ディレクトリ作成
mkdir -p /etc/puppet/files/proxmox
/etc/puppet/files/proxmox/pve-enterprise.list
#deb https://enterprise.proxmox.com/debian wheezy pve-enterprise
deb http://download.proxmox.com/debian wheezy pve-no-subscription
/etc/puppet/manifests/site.pp
node 'prime.local' {
  file { '/etc/apt/sources.list.d/pve-enterprise.list':
    source => "puppet:///proxmox/pve-enterprise.list",
    # ファイルが更新された時にapt-get updateする
    notify => Exec['apt-update'],
  }
  # 定義
  exec { "apt-update":
    command => "/usr/bin/apt-get update"
  }
}
/etc/puppet/fileserver.conf
[proxmox]
  path /etc/puppet/files/proxmox
  allow *.local
  • fileserver.confを書き換えはpuppetmasterの再起動は不要。
~/bin/puppetrun.sh
#!/bin/sh
set -eu
SERVER=prime.local

puppet agent --server=$SERVER -t -v --noop
echo "press enter to execute.."
read ENTER
puppet agent --server=$SERVER -t -v
sh ~/bin/puppetrun.sh
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