Skip to content

Commit 1dc934c

Browse files
authored
Merge pull request #439 from CoreyCook8/patch-1
Remove workaround from user.pp
2 parents 2884c11 + e8e4547 commit 1dc934c

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

manifests/user.pp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -234,21 +234,15 @@
234234
ensure => 'absent',
235235
forcelocal => $forcelocal,
236236
home => $_home,
237-
managehome => false, # Workaround for PUP-9706; see below.
237+
managehome => $managehome,
238238
}
239-
# The core `user` resource will fail when removing users on Solaris if
240-
# `ensure => 'absent', managhome => true` and the homedir does not exist.
241-
# We therefore force `managehome => false` when `ensure => 'absent'`, and
242-
# remove the homedir as a separate operation.
243-
# See https://tickets.puppetlabs.com/browse/PUP-9706
244-
if $purge_user_home {
239+
if $purge_user_home and !$managehome {
245240
file { $_home:
246241
ensure => 'absent',
247242
recurse => true,
248243
force => true,
249244
}
250245
}
251-
# End workaround.
252246
User[$name] -> Group <| ensure == 'absent' |>
253247
if $create_group {
254248
# Only remove the group if it is the same as user name as it may be shared.

spec/defines/accounts_user_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,7 @@
269269
purge_user_home: false }
270270
end
271271

272-
it { is_expected.to contain_user(title).with('ensure' => params[:ensure]) }
273-
it { is_expected.to contain_user(title).with('managehome' => params[:purge_user_home]) }
272+
it { is_expected.to contain_user(title).with('ensure' => params[:ensure]) }
274273
it { is_expected.not_to contain_accounts__home_dir(user_vars[:dan_home]) }
275274
it { is_expected.not_to contain_file("#{user_vars[:dan_home]}/.ssh") }
276275
end

0 commit comments

Comments
 (0)