LoginSignup
0
0

More than 5 years have passed since last update.

Chefでuser作成時gid設定でエラー「Couldn't lookup integer GID for group name xxxx」が起きる

Posted at

仕事でChefを始めました。
誤りなどあればご指摘いただけるとありがたいです...

Chef version

Chef Client

12.19.36

Chef Server

12.15.8

recipe抜粋

# for hoge user primary group
group 'fuga' do
    gid '31200'
    action :create
end

# user
user 'hoge' do
    uid '31401'
    gid '31200'
    password nil
    action :create
end

「chef-client」を実行すると...

Couldn't lookup integer GID for group name 31200...

とエラーが発生する

公式のドキュメントで調べてみたが...

https://docs.chef.io/resource_user.html

グループ名じゃなくてグループIDを設定するのかと思ったんですが....

user 'a user' do
  comment 'A random user'
  uid '1234'
  gid '1234'
  home '/home/random'
  shell '/bin/bash'
  password '$1$JJsvHslasdfjVEroftprNn4JHtDi'
end
gid
    Ruby Types: String, Integer
    The identifier for the group.

gidにグループ名を設定したら正常にchef-clientを実行できた

# for hoge user primary group
group 'fuga' do
    gid '31200'
    action :create
end

# user
user 'hoge' do
    uid '31401'
    gid 'fuga' ← グループ名を設定
    password nil
    action :create
end
0
0
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
0
0