@ Mattの提案に加えて、自分のgithubの設定に基づいて各個人の設定環境をインスタンス化するcustom puppet moduleを作成しました。結果として人形モジュールusers
は次のようになります。
users/
├── manifests
│ ├── init.pp # base level configurations for all users
│ ├── jake.pp # custom setup for jake
│ ├── james.pp # custom setup for james
│ ├── jane.pp # custom setup for jane
│ ├── jim.pp # custom setup for jim
│ ├── jimbo.pp # custom setup for joe
│ ├── jimmy.pp # custom setup for jimmy
│ ├── joe.pp # custom setup for julie
│ └── julie.pp # custom setup for jimbo
└── templates
関連ちらほらは、各ユーザーのカスタム設定ファイルです。例えば、ここでjim.pp
がどのように見えるかです:
class users::jim {
# make sure that all base configuration in init.pp is set up first
require users
# add the user here
user { 'jim':
# comment => 'Dean Malmgren',
home => '/home/jim',
shell => '/bin/bash',
uid => 201,
managehome => 'true',
groups => ['sudo', 'vagrant'],
provider => 'useradd',
password => '$6$kxHLEuHW$78m3zHVLu0XUUDaU4bT.PEg./FfcloJiWml',
}
# clone the repository the first time
exec { 'jim-clone-dotfiles':
command => 'git clone git://github.com/jim/dotfiles.git && python dotfiles/create_softlinks.py',
cwd => '/home/jim',
creates => '/home/jim/dotfiles',
user => 'jim',
group => 'jim',
require => [ Package['git'] ],
}
# fetch and update if jim decides to update his dotfiles repo
exec { 'jim-update-dotfiles':
command => 'git merge --ff-only origin/master && python create_softlinks.py',
cwd => '/home/jim/dotfiles',
unless => 'git fetch && git diff --exit-code origin/master',
user => 'jim',
group => 'jim',
require => Exec['jim-clone-dotfiles'],
}
}
これは、自分のワークステーション上で開発し、特定のユーザーに最適です。リモートマシン上のすべての*ユーザーのためのユーザー環境の構築にも取り組んでいればうれしいでしょう。 – dino
この答えを更新して、 '$ user_name'変数の使い方に必要な' 'マークを含めてください。詳細はhttp://stackoverflow.com/q/34345939/328275を参照してください。 – axiopisty