Skip to content

Commit 1007b49

Browse files
committed
New instance parameter 'additional_groups'
User can define additional groups for instance and fenced users. Multiple groups can be defined as an array.
1 parent 5763b24 commit 1007b49

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ db2::install { '11.1':
124124
* `instance_user_uid`: UID of the instance user
125125
* `instance_user_gid`: GID of the instance user
126126
* `instance_user_home`: Home directory of the instance user
127+
* `additional_groups`: An array of additional groups for instance and fence users (optional, default: undef)
127128
* `type`: Type of product this instance is for (default: ese)
128129
* `auth`: Type of auth for this instance (default: server)
129130
* `users_forcelocal`: Force the creation of instance and fence users to be local, true or false. (default: undef)

manifests/instance.pp

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
$instance_user_uid = undef,
1515
$instance_user_gid = undef,
1616
$instance_user_home = undef,
17+
$additional_groups = undef,
1718
$users_forcelocal = undef,
1819
$port = undef,
1920
$type = 'ese',
@@ -32,6 +33,7 @@
3233
home => $fence_user_home,
3334
forcelocal => $users_forcelocal,
3435
managehome => true,
36+
groups => $additional_groups,
3537
}
3638
}
3739
}
@@ -43,6 +45,7 @@
4345
home => $instance_user_home,
4446
forcelocal => $users_forcelocal,
4547
managehome => true,
48+
groups => $additional_groups,
4649
}
4750
}
4851

spec/defines/instance_spec.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,22 @@
6969
:fence_user_uid => '1002',
7070
:fence_user_gid => 'db2fencg',
7171
:fence_user_home => '/db2/fence',
72+
:additional_groups => 'db2group',
7273
}}
7374
it do
7475
is_expected.to contain_user('db2inst').with(
7576
:uid => '1001',
7677
:gid => 'db2instg',
77-
:home => '/db2/inst'
78+
:home => '/db2/inst',
79+
:groups => 'db2group',
7880
)
7981
end
8082
it do
8183
is_expected.to contain_user('db2fence').with(
8284
:uid => '1002',
8385
:gid => 'db2fencg',
8486
:home => '/db2/fence',
87+
:groups => 'db2group',
8588
)
8689
end
8790
end

0 commit comments

Comments
 (0)