chefでユーザ作成
chefを使ってユーザを作成する方法
chef solo, knife solo, chef serverで実行できます。
レシピ
# パスワードをhogeに
$ openssl passwd -1 "hoge"
$1$EVTsgD0f$QpzIEDmbxqVN73laspifv.
# hogeユーザの作成
$ vim recipes/default.rb
user "hoge" do
comment "hoge User"
uid 1234
gid "users"
home "/home/hoge"
shell "/bin/bash"
password "$1$EVTsgD0f$QpzIEDmbxqVN73laspifv."
action:create
end
あとはレシピを実行すればhogeユーザが作成されます。
仕様を見る限りユーザの削除もできます。
参考資料