Showing with 98 additions and 13 deletions.
  1. +1 −1 Modulefile
  2. +1 −0 README.md
  3. +26 −3 manifests/init.pp
  4. +7 −6 metadata.json
  5. +63 −3 spec/classes/init_spec.rb
2 changes: 1 addition & 1 deletion Modulefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name 'ghoneycutt-pam'
version '2.4.5'
version '2.5.0'
source 'git://github.com/ghoneycutt/puppet-module-pam.git'
author 'ghoneycutt'
license 'Apache License, Version 2.0'
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This module has been tested to work on the following systems using Puppet v3 wit

* EL 5
* EL 6
* Solaris 9
* Solaris 10
* Solaris 11
* Suse 9
Expand Down
29 changes: 26 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,29 @@
}
'Solaris': {
case $::kernelrelease {
'5.9': {
$default_pam_auth_lines = [ 'login auth requisite pam_authtok_get.so.1',
'login auth required pam_dhkeys.so.1',
'login auth required pam_unix_auth.so.1',
'login auth required pam_dial_auth.so.1',
'passwd auth required pam_passwd_auth.so.1',
'other auth requisite pam_authtok_get.so.1',
'other auth required pam_dhkeys.so.1',
'other auth required pam_unix_auth.so.1']

$default_pam_account_lines = ['cron account required pam_projects.so.1',
'cron account required pam_unix_account.so.1',
'other account requisite pam_roles.so.1',
'other account required pam_projects.so.1',
'other account required pam_unix_account.so.1']

$default_pam_password_lines = [ 'other password required pam_dhkeys.so.1',
'other password requisite pam_authtok_get.so.1',
'other password requisite pam_authtok_check.so.1',
'other password required pam_authtok_store.so.1']

$default_pam_session_lines = ['other session required pam_unix_session.so.1']
}
'5.10': {
$default_pam_auth_lines = [ 'login auth requisite pam_authtok_get.so.1',
'login auth required pam_dhkeys.so.1',
Expand Down Expand Up @@ -404,7 +427,7 @@
}

default: {
fail("Pam is only supported on Solaris 10 and 11. Your kernelrelease is identified as <${::kernelrelease}>.")
fail("Pam is only supported on Solaris 9, 10 and 11. Your kernelrelease is identified as <${::kernelrelease}>.")
}
}
}
Expand Down Expand Up @@ -732,7 +755,7 @@

'Solaris': {
case $::kernelrelease {
'5.10': {
'5.9','5.10': {
file { 'pam_conf':
ensure => file,
path => $pam_conf_file,
Expand All @@ -753,7 +776,7 @@
}
}
default: {
fail("Pam is only supported on Solaris 10 and 11. Your kernelrelease is identified as <${::kernelrelease}>.")
fail("Pam is only supported on Solaris 9, 10 and 11. Your kernelrelease is identified as <${::kernelrelease}>.")
}
}
}
Expand Down
13 changes: 7 additions & 6 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
{
"operatingsystem": "Solaris",
"operatingsystemrelease": [
"9",
"10",
"11"
]
Expand Down Expand Up @@ -75,7 +76,7 @@
}
],
"name": "ghoneycutt-pam",
"version": "2.4.5",
"version": "2.5.0",
"source": "git://github.com/ghoneycutt/puppet-module-pam.git",
"author": "ghoneycutt",
"license": "Apache License, Version 2.0",
Expand Down Expand Up @@ -104,17 +105,17 @@
"Gemfile": "6992d521994d948eb6e48acd733a07bf",
"Gemfile.lock": "873e125e8afe971046172cf5e775871d",
"LICENSE": "567e6cc3941d464d60c74d1f4abd5f46",
"Modulefile": "efd1ae77e9d24d8ff74656b9a4e760df",
"README.md": "72dca4e199075f8e79d1bb3a52dd7029",
"Modulefile": "1c26a226002e3f0f93b8de88c4cbf9cd",
"README.md": "7ddbc2ba0f056e80242aa9d6ad1b6b47",
"Rakefile": "8ff6a0f7db638421d1742c5d365d0266",
"files/limits.conf": "2486c66ab9728a793f068ed060c0df61",
"manifests/accesslogin.pp": "e5dd82ec627fa88a449cf1f46be5077e",
"manifests/init.pp": "2ca6fff698f940f8f518e5155f0725fc",
"manifests/init.pp": "f62340f9c308f4460852ef0f8f6f6111",
"manifests/limits/fragment.pp": "6486a3db8487e4817937a08bc3c18a53",
"manifests/limits.pp": "2b87e2f69d38c99694be5f02845bbf0f",
"manifests/service.pp": "9e97853aff8c57df48c8d01c30424d23",
"spec/classes/accesslogin_spec.rb": "326a485b8a7fad24ce75f0bcfb6f7236",
"spec/classes/init_spec.rb": "a2ecd4ceb389066afac5aa462dee6539",
"spec/classes/init_spec.rb": "7706de29bccb805fba7c15c2c70c1554",
"spec/classes/limits_spec.rb": "f243fbe2e25f7f4e47bd2bced260e468",
"spec/defines/limits/fragment_spec.rb": "19aeaf03de246fa093bba518db62957e",
"spec/spec_helper.rb": "3ea886dd135e120afa31e0aab12e85b0",
Expand All @@ -140,4 +141,4 @@
"templates/system-auth-ac.erb": "69dd0a7e44d4edd6bd473748522144f1",
"tests/init.pp": "1b580110b1308350f9b09e1bbca0551e"
}
}
}
66 changes: 63 additions & 3 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@
end
end

context 'with defaults params on Solaris 9' do
context 'with defaults params on Solaris 8' do
let(:facts) do
{ :osfamily => 'Solaris',
:kernelrelease => '5.9',
:kernelrelease => '5.8',
}
end

it 'should fail' do
expect {
should contain_class('pam')
}.to raise_error(Puppet::Error,/Pam is only supported on Solaris 10 and 11. Your kernelrelease is identified as <5.9>./)
}.to raise_error(Puppet::Error,/Pam is only supported on Solaris 9, 10 and 11. Your kernelrelease is identified as <5.8>./)
end
end
end
Expand Down Expand Up @@ -156,6 +156,17 @@
}
end

context 'with default params on Solaris 9' do
let :facts do
{
:osfamily => 'Solaris',
:kernelrelease => '5.9',
}
end

it { should_not contain_package('pam_package') }
end

context 'with default params on Solaris 10' do
let :facts do
{
Expand Down Expand Up @@ -934,6 +945,55 @@
}
end

context 'with default params on osfamily Solaris with kernelrelease 5.9' do
let :facts do
{
:osfamily => 'Solaris',
:kernelrelease => '5.9',
}
end

it {
should contain_file('pam_conf').with({
'ensure' => 'file',
'path' => '/etc/pam.conf',
'owner' => 'root',
'group' => 'sys',
'mode' => '0644',
})
}

it { should contain_file('pam_conf').with_content("# This file is being maintained by Puppet.
# DO NOT EDIT
# Auth
login auth requisite pam_authtok_get.so.1
login auth required pam_dhkeys.so.1
login auth required pam_unix_auth.so.1
login auth required pam_dial_auth.so.1
passwd auth required pam_passwd_auth.so.1
other auth requisite pam_authtok_get.so.1
other auth required pam_dhkeys.so.1
other auth required pam_unix_auth.so.1
# Account
cron account required pam_projects.so.1
cron account required pam_unix_account.so.1
other account requisite pam_roles.so.1
other account required pam_projects.so.1
other account required pam_unix_account.so.1
# Password
other password required pam_dhkeys.so.1
other password requisite pam_authtok_get.so.1
other password requisite pam_authtok_check.so.1
other password required pam_authtok_store.so.1
# Session
other session required pam_unix_session.so.1
")
}
end

context 'with default params on osfamily Solaris with kernelrelease 5.10' do
let :facts do
{
Expand Down