Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/spec/fixtures/modules/sudo
/spec/fixtures/modules/tsm
/pkg/
.project
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one last thing. please do not add editor specific files to the pull request (.project from geppetto). you do not have to update your fork again, i'm going to merge your changes now and remove the file afterwards.

thanks
toni

18 changes: 18 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>puppet-tsm</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.puppetlabs.geppetto.pp.dsl.ui.puppetNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
</projectDescription>
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Storage Manager (TSM) client on the following operating systems:
* Oracle Linux 5/6
* Scientific Linux 5/6
* Solaris 10/11
* Debian 7

##Setup

Expand All @@ -47,6 +48,19 @@ These usually are
* gskcrypt64-8.0.14.26.linux.x86_64.rpm
* TIVsm-BA.x86_64.rpm

For Debian you need an apt repository that contains the deb packages.
IBM only provides rpms so you might need to use alien to convert the
rpms IBM provides in the TSM installation tar.gz.
For info on converting rpms to debs consult:
http://www.planetcobalt.net/sdb/tsm_debian.shtml

These usually are

* TIVsm-API64.deb
* TIVsm-BA.deb
* gskcrypt64.deb
* gskssl64.deb

For Solaris 10 and 11 you need a HTTP server that provides the
following packages for downloading:

Expand Down Expand Up @@ -136,6 +150,7 @@ The module has been tested on:
* RedHat Enterprise Linux 5/6
* Solaris 10 i386/sparc
* Solaris 11 i386/sparc
* Debian 7

##Development

Expand Down
15 changes: 15 additions & 0 deletions files/InclExcl.debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
exclude /var/cache/.../*
exclude /var/crash/.../*
exclude /var/lib/slocate/*
exclude /var/lock/.../*
exclude /var/log/.../*
exclude /var/run/.../*
exclude /var/spool/.../*
exclude /.../core
exclude /.../lost+found
exclude /.../tmp/.../*
exclude.dir /mnt
exclude.dir /proc
exclude.dir /sys
exclude.fs /dev/shm
exclude.fs /dev/pts
61 changes: 61 additions & 0 deletions files/dsmsched.debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash
#
### BEGIN INIT INFO
# Provides: dsmcsched
# Required-Start: $local_fs $remote_fs $syslog networking
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: dsmc scheduler
# Description: IBM Tivoli Backup Client
### END INIT INFO
#

# PATH=${PATH}:/usr/adsm:/usr/local/sbin
# export PATH
export LANG=is_IS
DSM_DIR=/opt/tivoli/tsm/client/ba/bin
DSM_CONFIG=/opt/tivoli/tsm/client/ba/bin/dsm.opt
export DSM_DIR DSM_CONFIG
linke=`ls -d /opt/tivoli/tsm/client/ba/bin/is_IS`
if test "$linke"
then
sleep 0
else
ln -s /opt/tivoli/tsm/client/ba/bin/en_US /opt/tivoli/tsm/client/ba/bin/is_IS
fi
# See how we were called.
case "$1" in
start)
echo -n "Starting dsmc. "
dsmc sch -RunAsService > /dev/null 2>&1 &
echo
;;
stop)
echo -n "Stopping dsmc: "
pid=`/bin/ps ax | /bin/grep -w dsmc | /bin/grep -v grep | /bin/grep -v dsmcsched | /usr/bin/awk '{print $1}'`
if test "$pid"
then
kill $pid
echo
fi
;;
restart)
$0 stop
$0 start
;;
status)
pid=`/bin/ps ax | /bin/grep -w dsmc | /bin/grep -v grep | /bin/grep -v dsmcsched | /usr/bin/awk '{print $1}'`
if test "$pid"
then
echo "dsmc is running with PID: "$pid
else
echo "dsmc is not running "
fi
;;
*)
echo "Usage: dsmcsched {start|stop|restart|status}"
exit 1
esac

exit 0
9 changes: 6 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
# List of tsm package to be installed
# packages - optional
# Default:
# Linux: ['TIVsm-BA']
# Redhat: ['TIVsm-BA']
# Debian: ['TIVsm-API64', 'TIVsm-BA', 'gskcrypt64', 'gskssl64']
# Solaris i386: ['gsk8cry32','gsk8cry64','gsk8ssl32','gsk8ssl64','TIVsmCapi', 'TIVsmCba']
# Solaris sparc: ['gsk8cry64','gsk8ssl64','TIVsmCapi', 'TIVsmCba']
#
Expand Down Expand Up @@ -79,7 +80,8 @@
# Where to find the tsm service script for deployment
# service_script_source - optional
# Default:
# Linux: puppet://modules/tsm/dsmsched.redhat
# Redhat: puppet://modules/tsm/dsmsched.redhat
# Debian: puppet://modules/tsm/dsmsched.debian
# Solaris: puppet://modules/tsm/tsmsched.solaris
#
# [*tsm_pwd*]
Expand Down Expand Up @@ -131,7 +133,8 @@
# Where to find a default include/exclude file
# inclexcl_source - optional
# Default:
# Linux: puppet://modules/tsm/InclExcl.redhat
# Redhat: puppet://modules/tsm/InclExcl.redhat
# Debian: puppet://modules/tsm/InclExcl.debian
# Solaris: puppet://modules/tsm/InclExcl.solaris
#
# [*config_hash*]
Expand Down
1 change: 1 addition & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# === Authors
#
# Toni Schmidbauer <toni@stderr.at>
# David Orn Johannsson <davideaglephotos@gmail.com>
#
# === Copyright
#
Expand Down
7 changes: 7 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
$service_script_source = 'puppet:///modules/tsm/dsmsched.redhat'
$inclexcl_source = 'puppet:///modules/tsm/InclExcl.redhat'
}
debian: {
$packages = ['tivsm-api64', 'tivsm-ba', 'gskcrypt64', 'gskssl64']
$service_name = 'dsmsched'
$service_script = '/etc/init.d/dsmsched'
$service_script_source = 'puppet:///modules/tsm/dsmsched.debian'
$inclexcl_source = 'puppet:///modules/tsm/InclExcl.debian'
}
solaris: {
case $::hardwareisa {
i386: {
Expand Down
3 changes: 3 additions & 0 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
redhat: {
include tsm::service::redhat
}
debian: {
include tsm::service::debian
}
solaris: {
include tsm::service::solaris
}
Expand Down
32 changes: 32 additions & 0 deletions manifests/service/debian.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# == Class: tsm::service::debian
#
# Manage tsm service on debian
#
# === Authors
#
# Toni Schmidbauer <toni@stderr.at>
# David Orn Johannsson <davideaglephotos@gmail.com>
#
# === Copyright
#
# Copyright 2014 Toni Schmidbauer
#
class tsm::service::debian {

file { $::tsm::service_script:
ensure => file,
owner => 'root',
group => 'root',
mode => '0755',
source => $::tsm::service_script_source,
}

service { $::tsm::service_name:
ensure => $::tsm::service_ensure,
enable => $::tsm::service_enable,
hasstatus => true,
hasrestart => true,
}

File[$::tsm::service_script] -> Service[$::tsm::service_name]
}
123 changes: 122 additions & 1 deletion spec/classes/tsm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

describe 'tsm' do

['RedHat', 'Solaris'].each do |system|
['RedHat', 'Solaris', 'Debian'].each do |system|

let :facts do
{
Expand Down Expand Up @@ -139,6 +139,28 @@
})
end
end

context 'on Debian 7' do
let :facts do
{
:osfamily => 'Debian',
:operatingsystemmajrelease => '7',
:architecure => 'amd64',
:concat_basedir => '/dne',
}
end

it do
should contain_file('/opt/tivoli/tsm/client/ba/bin/InclExcl').with({
'ensure' => 'file',
'replace' => 'false',
'owner' => 'root',
'group' => 'root',
'mode' => '0644',
'source' => 'puppet:///modules/tsm/InclExcl.debian'
})
end
end

context 'on Solaris' do
let :facts do
Expand Down Expand Up @@ -278,6 +300,105 @@

end
end

context 'tsm::install on Debian 7' do
let :facts do
{
:osfamily => 'Debian',
:operatingsystemmajrelease => '7',
:architecure => 'amd64',
:concat_basedir => '/dne',

}
end

describe 'when tsm::service_manage is false' do
it { should_not contain_class('tsm::service::debian')}
end

describe 'should install tsm packages ' do
let(:params) do
{
:tcp_server_address => 'tsm',
}
end

it { should contain_tsm__installpkg('tivsm-ba').with_ensure('installed') }
it { should contain_tsm__installpkg('tivsm-api64').with_ensure('installed') }
it { should contain_tsm__installpkg('gskcrypt64').with_ensure('installed') }
it { should contain_tsm__installpkg('gskssl64').with_ensure('installed') }
end

describe 'should allow package_ensure to be overridden'do
let(:params) do {
:tcp_server_address => 'tsm',
:package_ensure => 'latest'
}
end

it do
should contain_tsm__installpkg('tivsm-api64').with({
:ensure => 'latest',
})
end
end

describe 'should allow package_name to be overridden'do
let(:params) {{
:tcp_server_address => 'tsm',
:packages => ['deadbeaf']
}}

it { should contain_tsm__installpkg("deadbeaf").with_ensure('installed') }
end
end

context 'tsm::service on Debian 7' do
let :facts do
{
:osfamily => 'Debian',
:operatingsystemmajrelease => '7',
:architecure => 'amd64',
:concat_basedir => '/dne',
}
end

describe 'when tsm::service_manage is false' do
it { should_not contain_class('tsm::service::debian')}
end

describe 'when tsm::service_manage is true' do
let(:params) do
{
:tcp_server_address => 'tsm',
:service_manage => true,
}
end

it { should contain_class('tsm::service::debian')}

it do
should contain_file('/etc/init.d/dsmsched').with({
'ensure' => 'file',
'owner' => 'root',
'group' => 'root',
'mode' => '0755',
'source' => 'puppet:///modules/tsm/dsmsched.debian'
})
end

it do
should contain_service('dsmsched').with({
'ensure' => 'running',
'enable' => 'true',
'hasstatus' => 'true',
'hasrestart' => 'true',
})
end

it { should contain_service('dsmsched').that_requires('File[/etc/init.d/dsmsched]') }
end
end

context 'tsm::install on Solaris 10 i386' do
let :facts do
Expand Down
12 changes: 12 additions & 0 deletions spec/defines/installpkg_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@

it { should contain_package('TIVsm-BA').with_ensure('installed') }
end

context 'on Debian' do
let(:title) { 'tivsm-ba'}

let :facts do
{
:osfamily => 'Debian'
}
end

it { should contain_package('tivsm-ba').with_ensure('installed') }
end

context 'on Solaris' do
let :facts do
Expand Down