Skip to content

Commit

Permalink
create user/group as system accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
jlambert121 committed Jun 22, 2015
1 parent a196ac3 commit 1559c1e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@
if $consul::manage_user {
user { $consul::user:
ensure => 'present',
system => true,
}
}
if $consul::manage_group {
group { $consul::group:
ensure => 'present',
system => true,
}
}
}
12 changes: 10 additions & 2 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,16 @@
end

context "By default, a user and group should be installed" do
it { should contain_user('consul').with(:ensure => :present) }
it { should contain_group('consul').with(:ensure => :present) }
it { should contain_user('consul').with(:ensure => :present, :system => true) }
it { should contain_group('consul').with(:ensure => :present, :system => true) }
end

context "Allow creating non-system accounts" do
let(:params) {{
:system_accounts => false,
}}
it { should contain_user('consul').with(:ensure => :present, :system => false) }
it { should contain_group('consul').with(:ensure => :present, :system => false) }
end

context "When data_dir is provided" do
Expand Down

0 comments on commit 1559c1e

Please sign in to comment.