Serverspec ユーザとグループの存在を確認するサンプル

環境
Serverspec
RHEL8.6

構文

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
describe group('グループ名') do
it { should exist }
end
describe group('グループ名') do it { should exist } end
describe group('グループ名') do
  it { should exist }
end

ユーザやグループの存在を確認するには、groupやuserを利用します。

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
describe group('cft') do
it { should exist }
end
describe user('cft') do
it { should exist }
end
describe group('cft') do it { should exist } end describe user('cft') do it { should exist } end
describe group('cft') do
  it { should exist }
end

describe user('cft') do
  it { should exist }
end

 

Serverspec

Posted by arkgame