Skip to content

Commit

Permalink
Merge pull request #960 from lsst-it/IT-4834/csilva_b
Browse files Browse the repository at this point in the history
 (common) fix sshd_config for csilva_b user
  • Loading branch information
jhoblitt authored Oct 20, 2023
2 parents 59c1582 + d570d31 commit f5e88cd
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 18 deletions.
4 changes: 2 additions & 2 deletions hieradata/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ ssh::server::match_block:
type: "user"
options:
AuthorizedKeysFile: ".ssh/authorized_keys"
hreinking_b:
<<: *authorized_keys
jhoblitt_b:
<<: *authorized_keys
cbarria_b:
<<: *authorized_keys
csilva_b:
<<: *authorized_keys
# easy_ipa server options
# defines the uid/gid of the admin user
# needs to be coordinated between master + replicas
Expand Down
47 changes: 31 additions & 16 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -363,26 +363,41 @@ def node_files
end
end

it do
is_expected.to contain_user('csilva_b').with(
ensure: 'present',
groups: ['wheel_b'],
purge_ssh_keys: true,
)
admin_users = %w[
jhoblitt_b
cbarria_b
csilva_b
]

(admin_users + ['root']).each do |user|
it do
is_expected.to contain_ssh__server__match_block(user).with(
type: 'user',
options: {
'AuthorizedKeysFile' => '.ssh/authorized_keys',
},
)
end
end

it do
is_expected.to contain_user('hreinking_b').with(
ensure: 'absent',
)
admin_users.each do |user|
it do
is_expected.to contain_user(user).with(
ensure: 'present',
groups: ['wheel_b'],
purge_ssh_keys: true,
)
end
end

it do
is_expected.to contain_file('/home/hreinking_b').with(
ensure: 'absent',
recurse: true,
force: true,
)
%w[
lssttech
sysadmin
athebo
athebo_b
hreinking_b
].each do |user|
it { is_expected.to contain_user(user).with_ensure('absent') }
end

it { is_expected.to contain_class('systemd').with_manage_udevd(true) }
Expand Down

0 comments on commit f5e88cd

Please sign in to comment.