Skip to content

Instantly share code, notes, and snippets.

@btm
Created January 31, 2009 03:52
Show Gist options
  • Save btm/55425 to your computer and use it in GitHub Desktop.
Save btm/55425 to your computer and use it in GitHub Desktop.
package "dellomsa"
if node[:platform_version] == "8.04"
remote_file "/etc/pam.d/common-auth" do
source "common-auth"
end
remote_file "/etc/pam.d/common-password" do
source "common-password"
end
end
remote_file "/lib32/libselinux.so.1" do
source "libselinux.so.1"
end
remote_file "/lib32/libsepol.so.1" do
source "libsepol.so.1"
end
remote_file "/lib32/security/pam_unix.so" do
source "pam_unix.so"
end
remote_file "/lib32/security/pam_nologin.so" do
source "pam_nologin.so"
end
remote_file "/etc/pam.d/omauth" do
source "omauth"
end
service "dataeng" do
supports :restart => true
action [ :enable, :start ]
pattern "/opt/dell/srvadmin/dataeng/bin/dsm_sa_datamgr32d"
end
service "dsm_om_connsvc" do
supports :restart => true
action [ :enable, :start ]
pattern "/opt/dell/srvadmin/iws/bin/linux/dsm_om_connsvc32d -run"
end
class dell-agent {
package { dellomsa: }
# Installed by default even if you aren't using smb, not included in ia32-libs
line {"common-auth-nosmb":
line => "auth optional pam_smbpass.so migrate missingok",
file => "/etc/pam.d/common-auth",
ensure => absent
}
line {"common-password-nosmb":
line => "password optional pam_smbpass.so nullok use_authtok use_first_pass missingok",
file => "/etc/pam.d/common-password",
ensure => absent
}
# Dell links against the 32bit version of these
file {"/lib32/libselinux.so.1":
source => "puppet:///dell-agent/libselinux.so.1"
}
file {"/lib32/libsepol.so.1":
source => "puppet:///dell-agent/libsepol.so.1"
}
file {"/lib32/security/pam_unix.so":
source => "puppet:///dell-agent/pam_unix.so"
}
file {"/lib32/security/pam_nologin.so":
source => "puppet:///dell-agent/pam_nologin.so"
}
file { "/etc/pam.d/omauth":
source => "puppet:///dell-agent/omauth",
require => Package['dellomsa'],
require => [ Line['common-auth-nosmb'],
Line['common-password-nosmb']
],
require => [ File['/lib32/libselinux.so.1'],
File['/lib32/security/pam_nologin.so'],
File['/lib32/libselinux.so.1'],
File['/lib32/security/pam_unix.so']
]
}
service { dataeng:
enable => true,
ensure => running,
require => Package['dellomsa'],
pattern => "/opt/dell/srvadmin/dataeng/bin/dsm_sa_datamgr32d"
}
# The web server on port 1311
service { dsm_om_connsvc:
enable => true,
ensure => running,
require => Service['dataeng'],
require => File['/etc/pam.d/omauth'],
pattern => "/opt/dell/srvadmin/iws/bin/linux/dsm_om_connsvc32d -run"
}
}
class omsa {
package { "dellomsa":
name => "dellomsa",
ensure => present,
}
# set the webserver (dsm_om_connsvc port 1311) to start on startup
# must load mptctl before dataeng
exec { "omsa-config":
command => "/usr/sbin/update-rc.d dsm_om_connsvc defaults ; /etc/init.d/dsm_om_connsvc start ; /sbin/modprobe mptctl ; /bin/grep ^mptctl$ /etc/modules || (echo mptctl >> /etc/modules ; /etc/init.d/dataeng restart )",
refreshonly => true,
subscribe => Package[dellomsa],
}
munin_plugin_file { "omreport_temp":
plugin => "omreport_temp",
}
case $architecture {
"amd64": {
# We need to hack together authentication
# this is a hack, there's no libpam-modules32, etc.
remotefile { "dellomsa-amd64-libs":
module => "omsa",
source => "dellomsa.amd64.libs.tgz",
path => "/opt/dell/dellomsa.amd64.libs.tgz",
mode => 0755,
owner => root,
group => root,
subscribe => Package[dellomsa]
}
exec { "install-pam-lib32":
command => "/bin/tar -xvzf /opt/dell/dellomsa.amd64.libs.tgz -C/",
refreshonly => true,
subscribe => File[dellomsa-amd64-libs],
}
exec { "update-omsa-pam":
command => "/bin/sed -i.bak -e '/^#/!{s/lib\/security/lib32\/security/}' /etc/pam.d/omauth",
refreshonly => true,
subscribe => File[dellomsa-amd64-libs],
}
}
default: {}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment