Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testsomething #11

Merged
merged 3 commits into from Nov 19, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .fixtures.yml
@@ -0,0 +1,6 @@
fixtures:
repositories:
stdlib: git://github.com/puppetlabs/puppetlabs-stdlib.git
concat: git://github.com/puppetlabs/puppetlabs-concat.git
postgresql: git://github.com/puppetlabs/puppetlabs-postgresql.git

6 changes: 0 additions & 6 deletions .travis.yml
Expand Up @@ -12,11 +12,5 @@ rvm:
- 2.1.0
script:
- bundle exec rake test
- echo "$TESTCASE"
- sudo puppet apply -e "$TESTCASE"
env:
- TESTCASE='include bacula::director'
- TESTCASE='include bacula::storage'
- TESTCASE='include bacula::client'
- PUPPET_VERSION="~> 3.6.0" STRICT_VARIABLES=yes
- PUPPET_VERSION="~> 3.7.0" STRICT_VARIABLES=yes
110 changes: 106 additions & 4 deletions Gemfile.lock
@@ -1,23 +1,125 @@
GIT
remote: https://github.com/rodjek/rspec-puppet.git
revision: 6ac97993fa972a15851a73d55fe3d1c0a85172b5
specs:
rspec-puppet (1.0.1)
rspec

GEM
remote: https://rubygems.org/
specs:
facter (1.7.5)
hiera (1.3.2)
CFPropertyList (2.2.8)
addressable (2.3.6)
backports (3.6.4)
coderay (1.1.0)
diff-lcs (1.2.5)
ethon (0.7.1)
ffi (>= 1.3.0)
facter (2.3.0)
CFPropertyList (~> 2.2.6)
faraday (0.9.0)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.9.1)
faraday (>= 0.7.4, < 0.10)
ffi (1.9.6)
gh (0.13.2)
addressable
backports
faraday (~> 0.8)
multi_json (~> 1.0)
net-http-persistent (>= 2.7)
net-http-pipeline
hiera (1.3.4)
json_pure
highline (1.6.21)
json (1.8.1)
json_pure (1.8.1)
puppet (3.5.1)
launchy (2.4.3)
addressable (~> 2.3)
metaclass (0.0.4)
method_source (0.8.2)
mime-types (2.4.3)
mocha (1.1.0)
metaclass (~> 0.0.1)
multi_json (1.10.1)
multipart-post (2.0.0)
net-http-persistent (2.9.4)
net-http-pipeline (1.0.1)
netrc (0.8.0)
pry (0.9.12.6)
coderay (~> 1.0)
method_source (~> 0.8)
slop (~> 3.4)
puppet (3.6.2)
facter (> 1.6, < 3)
hiera (~> 1.0)
json_pure
rgen (~> 0.6.5)
puppet-blacksmith (3.0.3)
puppet (>= 2.7.16)
rest-client
puppet-lint (1.0.1)
puppet-syntax (1.3.0)
rake
puppetlabs_spec_helper (0.8.2)
mocha
puppet-lint
puppet-syntax
rake
rspec
rspec-puppet
pusher-client (0.6.0)
json
websocket (~> 1.0)
rake (10.3.2)
rest-client (1.7.2)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
rgen (0.6.6)
rspec (3.1.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-core (3.1.7)
rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.1.0)
rspec-mocks (3.1.3)
rspec-support (~> 3.1.0)
rspec-support (3.1.2)
slop (3.6.0)
travis (1.7.4)
addressable (~> 2.3)
backports
faraday (~> 0.9)
faraday_middleware (~> 0.9, >= 0.9.1)
gh (~> 0.13)
highline (~> 1.6)
launchy (~> 2.1)
pry (~> 0.9, < 0.10)
pusher-client (~> 0.4)
typhoeus (~> 0.6, >= 0.6.8)
travis-lint (2.0.0)
json
typhoeus (0.6.9)
ethon (>= 0.7.1)
websocket (1.2.1)

PLATFORMS
ruby

DEPENDENCIES
puppet
puppet (~> 3.6.0)
puppet-blacksmith
puppet-lint
puppet-syntax
puppetlabs_spec_helper
rake
rspec
rspec-core
rspec-expectations
rspec-mocks
rspec-puppet!
travis
travis-lint
1 change: 1 addition & 0 deletions Modulefile
Expand Up @@ -9,3 +9,4 @@ project_page 'https://github.com/xaque208/puppet-bacula'
dependency 'puppetlabs/concat', '>=1.0.0'
dependency 'puppetlabs/stdlib', '>=4.4.0'
dependency 'ploperations/puppet', '>=0.12.0'
dependency 'puppetlabs/postgresql', '>=4.1.0'
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -21,7 +21,7 @@ transactions. In its simplest form, the director can be configured with a
simple include.

```Puppet
include bacula::director
class { 'bacula::director': storage => 'mystorage.example.com' }
```

### Storage Setup
Expand All @@ -30,13 +30,13 @@ The storage component allocates disk storage for pools that can be used for
holding backup data.

```Puppet
include bacula::storage
class { 'bacula::storage': director => 'mydirector.example.com' }
```

### Client Setup

The client component is run on each system that needs something backed up.

```Puppet
include bacula::client
class { 'bacula::client': director => 'mydirector.example.com' }
```
3 changes: 3 additions & 0 deletions Rakefile
Expand Up @@ -20,6 +20,9 @@ PuppetLint.configuration.send('disable_class_parameter_defaults')
# http://puppet-lint.com/checks/class_inherits_from_params_class/
PuppetLint.configuration.send('disable_class_inherits_from_params_class')

PuppetLint.configuration.send('disable_case_without_default')
PuppetLint.configuration.send('disable_quoted_booleans')

exclude_paths = [
"pkg/**/*",
"vendor/**/*",
Expand Down
8 changes: 8 additions & 0 deletions manifests/client.pp
@@ -1,3 +1,11 @@
# Class: bacula::client
#
# This class installs and configures the File Daemon to backup a client system.
#
# Sample Usage:
#
# class { 'bacula::client': director => 'mydirector.example.com' }
#
class bacula::client (
$port = '9102',
$listen_address = $::ipaddress,
Expand Down
12 changes: 6 additions & 6 deletions manifests/director.pp
Expand Up @@ -10,7 +10,7 @@
#
# Sample Usage:
#
# include bacula::director
# class { 'bacula::director': storage => 'mystorage.example.com' }
#
class bacula::director (
$port = '9101',
Expand All @@ -36,18 +36,18 @@

case $db_type {
/^(pgsql|postgresql)$/: { include bacula::director::postgresql }
default: { fail("No db_type set") }
default: { fail('No db_type set') }
}

package { $packages:
ensure => present,
}

service { $services:
ensure => running,
enable => true,
subscribe => File[$bacula::ssl::ssl_files],
require => Package[$packages],
ensure => running,
enable => true,
subscribe => File[$bacula::ssl::ssl_files],
require => Package[$packages],
}

file { "${conf_dir}/conf.d":
Expand Down
7 changes: 5 additions & 2 deletions manifests/director/defaults.pp
@@ -1,5 +1,8 @@
class bacula::director::defaults (
){
#: Class bacul::director::defaults
#
# Some default valuse for the bacula director
#
class bacula::director::defaults {

bacula::jobdefs { 'Default': }

Expand Down
6 changes: 3 additions & 3 deletions manifests/director/pool.pp
Expand Up @@ -27,13 +27,13 @@
# }
#
define bacula::director::pool (
$pooltype = 'Backup',
$recycle = 'Yes',
$autoprune = 'Yes',
$volret, # Volume Retention
$maxvoljobs,
$maxvolbytes,
$maxvols,
$pooltype = 'Backup',
$recycle = 'Yes',
$autoprune = 'Yes',
$purgeaction = 'Truncate',
$label = '',
$storage = $bacula::params::bacula_storage
Expand Down
9 changes: 9 additions & 0 deletions manifests/director/postgresql.pp
@@ -1,3 +1,12 @@
# Class: bacula::director::postgresql
#
# Deploys a postgres database server for hosting the Bacula director
# database.
#
# Sample Usage:
#
# none
#
class bacula::director::postgresql(
$make_bacula_tables = '/var/lib/bacula/make_bacula_tables',
$db_name = $bacula::director::db_name,
Expand Down
4 changes: 4 additions & 0 deletions manifests/fileset.pp
@@ -1,3 +1,7 @@
# Define: bacula::fileset
#
# A grouping of files to backup.
#
define bacula::fileset (
$files,
$excludes = '',
Expand Down
8 changes: 4 additions & 4 deletions manifests/params.pp
Expand Up @@ -10,17 +10,17 @@
$monitor = true

$db_type = hiera('bacula::params::db_type', 'pgsql')
$bacula_director = hiera('bacula::params::bacula_director')
$bacula_storage = hiera('bacula::params::bacula_storage')
$bacula_director = hiera('bacula::params::bacula_director', undef)
$bacula_storage = hiera('bacula::params::bacula_storage', undef)
$director_name = hiera('bacula::params::director_name', $bacula_director)
$director_address = hiera('bacula::params::director_address', $director_name)

case $::is_pe {
'false': {
'false',false: {
include puppet::params
$ssl_dir = $puppet::params::puppet_ssldir
}
'true': {
'true',true: {
$ssl_dir = '/etc/puppetlabs/puppet/ssl'
}
}
Expand Down
4 changes: 2 additions & 2 deletions manifests/storage.pp
Expand Up @@ -19,11 +19,11 @@
$user = $bacula::params::bacula_user,
$group = $bacula::params::bacula_group,
$volret_full = '21 days',
$volret_incremental = '8 days',
$maxconcurjobs = '5',
$maxvolbytes_full = '4g',
$maxvoljobs_full = '10',
$maxconcurjobs = '5',
$maxvols_full = '10',
$volret_incremental = '8 days',
$maxvolbytes_incremental = '4g',
$maxvoljobs_incremental = '50',
$maxvols_incremental = '10',
Expand Down
37 changes: 37 additions & 0 deletions spec/classes/storage_spec.rb
@@ -0,0 +1,37 @@
require 'spec_helper'


describe 'bacula::storage' do
let(:facts) {
{
:operatingsystem => 'Debian',
:concat_basedir => '/dne'
}
}
let(:params) { {:director => 'mydirector.lan'} }
it { should contain_class('bacula::storage') }
end

describe 'bacula::director' do
let(:facts) {
{
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => '7.0',
:concat_basedir => '/dne'
}
}
let(:params) { {:storage => 'mystorage.lan'} }
it { should contain_class('bacula::director') }
end

describe 'bacula::client' do
let(:facts) {
{
:operatingsystem => 'Debian',
:concat_basedir => '/dne'
}
}
let(:params) { {:director => 'mydirector.lan'} }
it { should contain_class('bacula::client') }
end
1 change: 1 addition & 0 deletions spec/fixtures/modules/bacula/manifests
1 change: 1 addition & 0 deletions spec/fixtures/modules/bacula/templates
8 changes: 8 additions & 0 deletions spec/spec_helper.rb
@@ -0,0 +1,8 @@
require 'rspec-puppet'

fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))

RSpec.configure do |c|
c.module_path = File.join(fixture_path, 'modules')
c.manifest_dir = File.join(fixture_path, 'manifests')
end