Skip to content

Commit

Permalink
Merge pull request #35 from Project0/develop
Browse files Browse the repository at this point in the history
Some fixes
  • Loading branch information
project0 authored May 4, 2019
2 parents 2f31f5d + 19c6eb2 commit 1eba8f5
Show file tree
Hide file tree
Showing 66 changed files with 98 additions and 12 deletions.
4 changes: 3 additions & 1 deletion manifests/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@
if $manage_package {
package { $package_name:
ensure => $package_ensure,
tag => 'bareos',
tag => ['bareos', 'bareos_client'],
}
}

if $manage_service {
service { $service_name:
ensure => $service_ensure,
enable => $service_enable,
tag => ['bareos', 'bareos_client'],
}
}

Expand All @@ -48,5 +49,6 @@
group => $::bareos::file_group,
require => Package[$package_name],
notify => Service[$service_name],
tag => ['bareos', 'bareos_client'],
}
}
1 change: 1 addition & 0 deletions manifests/client/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -459,5 +459,6 @@
content => template('bareos/resource.erb'),
notify => Service[$::bareos::client::service_name],
require => $_require_res_messages,
tag => ['bareos', 'bareos_client'],
}
}
1 change: 1 addition & 0 deletions manifests/client/director.pp
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,6 @@
group => $::bareos::file_group,
content => template('bareos/resource.erb'),
notify => Service[$::bareos::client::service_name],
tag => ['bareos', 'bareos_client'],
}
}
1 change: 1 addition & 0 deletions manifests/client/messages.pp
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,6 @@
group => $::bareos::file_group,
content => template('bareos/resource.erb'),
notify => Service[$::bareos::client::service_name],
tag => ['bareos', 'bareos_client'],
}
}
4 changes: 3 additions & 1 deletion manifests/console.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
if $manage_package {
package { $package_name:
ensure => $package_ensure,
tag => 'bareos',
tag => ['bareos', 'bareos_console'],

}
}

Expand All @@ -34,5 +35,6 @@
owner => $::bareos::file_owner,
group => $::bareos::file_group,
require => Package[$package_name],
tag => ['bareos', 'bareos_console'],
}
}
1 change: 1 addition & 0 deletions manifests/console/console.pp
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,6 @@
owner => $::bareos::file_owner,
group => $::bareos::file_group,
content => template('bareos/resource.erb'),
tag => ['bareos', 'bareos_console'],
}
}
1 change: 1 addition & 0 deletions manifests/console/director.pp
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,6 @@
owner => $::bareos::file_owner,
group => $::bareos::file_group,
content => template('bareos/resource.erb'),
tag => ['bareos', 'bareos_console'],
}
}
7 changes: 5 additions & 2 deletions manifests/director.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
if $manage_package {
package { $package_name:
ensure => $package_ensure,
tag => 'bareos',
tag => ['bareos', 'bareos_director'],
}
}

if $manage_service {
service { $service_name:
ensure => $service_ensure,
enable => $service_enable,
tag => ['bareos', 'bareos_director'],
}
}

Expand Down Expand Up @@ -59,13 +60,15 @@
group => $::bareos::file_group,
require => Package[$package_name],
notify => Service[$service_name],
tag => ['bareos', 'bareos_director'],
}

if $manage_database {
File <| |> -> exec { 'bareos director init catalog':
File <| tag == 'bareos_director' |> -> exec { 'bareos director init catalog':
command => '/usr/lib/bareos/scripts/create_bareos_database && /usr/lib/bareos/scripts/make_bareos_tables && /usr/lib/bareos/scripts/grant_bareos_privileges',
notify => Service[$::bareos::director::service_name],
refreshonly => true,
tag => ['bareos', 'bareos_director'],
}
}
}
3 changes: 2 additions & 1 deletion manifests/director/catalog.pp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@
content => template('bareos/resource.erb'),
notify => [
Service[$::bareos::director::service_name],
]
],
tag => ['bareos', 'bareos_director'],
}
if $::bareos::manage_database {
File["${::bareos::director::config_dir}/${_resource_dir}/${name}.conf"] ~> Exec['bareos director init catalog']
Expand Down
1 change: 1 addition & 0 deletions manifests/director/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -384,5 +384,6 @@
content => template('bareos/resource.erb'),
notify => Service[$::bareos::director::service_name],
require => $_require_resource,
tag => ['bareos', 'bareos_director'],
}
}
1 change: 1 addition & 0 deletions manifests/director/console.pp
Original file line number Diff line number Diff line change
Expand Up @@ -276,5 +276,6 @@
content => template('bareos/resource.erb'),
notify => Service[$::bareos::director::service_name],
require => $_require_resource,
tag => ['bareos', 'bareos_director'],
}
}
1 change: 1 addition & 0 deletions manifests/director/counter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@
content => template('bareos/resource.erb'),
notify => Service[$::bareos::director::service_name],
require => $_require_resource,
tag => ['bareos', 'bareos_director'],
}
}
1 change: 1 addition & 0 deletions manifests/director/director.pp
Original file line number Diff line number Diff line change
Expand Up @@ -475,5 +475,6 @@
content => template('bareos/resource.erb'),
notify => Service[$::bareos::director::service_name],
require => $_require_resource,
tag => ['bareos', 'bareos_director'],
}
}
1 change: 1 addition & 0 deletions manifests/director/fileset.pp
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,6 @@
group => $::bareos::file_group,
content => template('bareos/resource.erb'),
notify => Service[$::bareos::director::service_name],
tag => ['bareos', 'bareos_director'],
}
}
1 change: 1 addition & 0 deletions manifests/director/job.pp
Original file line number Diff line number Diff line change
Expand Up @@ -823,5 +823,6 @@
content => template('bareos/resource.erb'),
notify => Service[$::bareos::director::service_name],
require => $_require_resource,
tag => ['bareos', 'bareos_director'],
}
}
1 change: 1 addition & 0 deletions manifests/director/jobdefs.pp
Original file line number Diff line number Diff line change
Expand Up @@ -814,5 +814,6 @@
content => template('bareos/resource.erb'),
notify => Service[$::bareos::director::service_name],
require => $_require_resource,
tag => ['bareos', 'bareos_director'],
}
}
1 change: 1 addition & 0 deletions manifests/director/messages.pp
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,6 @@
group => $::bareos::file_group,
content => template('bareos/resource.erb'),
notify => Service[$::bareos::director::service_name],
tag => ['bareos', 'bareos_director'],
}
}
1 change: 1 addition & 0 deletions manifests/director/pool.pp
Original file line number Diff line number Diff line change
Expand Up @@ -329,5 +329,6 @@
content => template('bareos/resource.erb'),
notify => Service[$::bareos::director::service_name],
require => $_require_resource,
tag => ['bareos', 'bareos_director'],
}
}
1 change: 1 addition & 0 deletions manifests/director/profile.pp
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,6 @@
group => $::bareos::file_group,
content => template('bareos/resource.erb'),
notify => Service[$::bareos::director::service_name],
tag => ['bareos', 'bareos_director'],
}
}
1 change: 1 addition & 0 deletions manifests/director/schedule.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@
group => $::bareos::file_group,
content => template('bareos/resource.erb'),
notify => Service[$::bareos::director::service_name],
tag => ['bareos', 'bareos_director'],
}
}
1 change: 1 addition & 0 deletions manifests/director/storage.pp
Original file line number Diff line number Diff line change
Expand Up @@ -339,5 +339,6 @@
content => template('bareos/resource.erb'),
notify => Service[$::bareos::director::service_name],
require => $_require_resource,
tag => ['bareos', 'bareos_director'],
}
}
5 changes: 4 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
if $manage_package {
package { $package_name:
ensure => $package_ensure,
tag => 'bareos',
tag => ['bareos', 'bareos_core'],
}
}

Expand All @@ -51,6 +51,7 @@
ensure => present,
forcelocal => true,
system => true,
tag => ['bareos', 'bareos_core'],
}
-> user { $file_owner:
ensure => present,
Expand All @@ -60,6 +61,7 @@
shell => '/bin/false',
groups => ['disk', 'tape', $file_group],
system => true,
tag => ['bareos', 'bareos_core'],
}
}

Expand All @@ -71,5 +73,6 @@
mode => $::bareos::file_dir_mode,
owner => $::bareos::file_owner,
group => $::bareos::file_group,
tag => ['bareos', 'bareos_core'],
}
}
4 changes: 3 additions & 1 deletion manifests/monitor.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
if $manage_package {
package { $package_name:
ensure => $package_ensure,
tag => 'bareos',
tag => ['bareos', 'bareos_monitor'],
}
}

Expand All @@ -36,5 +36,7 @@
owner => $::bareos::file_owner,
group => $::bareos::file_group,
require => Package[$package_name],
tag => ['bareos', 'bareos_monitor'],

}
}
1 change: 1 addition & 0 deletions manifests/monitor/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@
owner => $::bareos::file_owner,
group => $::bareos::file_group,
content => template('bareos/resource.erb'),
tag => ['bareos', 'bareos_monitor'],
}
}
1 change: 1 addition & 0 deletions manifests/monitor/director.pp
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@
owner => $::bareos::file_owner,
group => $::bareos::file_group,
content => template('bareos/resource.erb'),
tag => ['bareos', 'bareos_monitor'],
}
}
1 change: 1 addition & 0 deletions manifests/monitor/monitor.pp
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,6 @@
owner => $::bareos::file_owner,
group => $::bareos::file_group,
content => template('bareos/resource.erb'),
tag => ['bareos', 'bareos_monitor'],
}
}
1 change: 1 addition & 0 deletions manifests/monitor/storage.pp
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,6 @@
owner => $::bareos::file_owner,
group => $::bareos::file_group,
content => template('bareos/resource.erb'),
tag => ['bareos', 'bareos_monitor'],
}
}
15 changes: 13 additions & 2 deletions manifests/repository.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# This class will be automatically included when a resource is defined.
# It is not intended to be used directly by external resources like node definitions or other modules.
class bareos::repository(
$release = 'latest'
$release = 'latest',
$gpg_key_fingerprint = undef,
) {

$url = "http://download.bareos.org/bareos/release/${release}/"
Expand All @@ -20,6 +21,16 @@
$osmajrelease = $::operatingsystemmajrelease
}

if $gpg_key_fingerprint {
$_gpg_key_fingerprint = $gpg_key_fingerprint
} elsif $release == 'latest' or versioncmp($release, '18.2') >= 0 {
# >= bareos-18.2
$_gpg_key_fingerprint = 'A0CF E15F 71F7 9857 4AB3 63DD 1182 83D9 A786 2CEE'
} else {
# >= bareos-15.2
$_gpg_key_fingerprint = '0143 857D 9CE8 C2D1 82FE 2631 F93C 028C 093B FBA2'
}

case $os {
/(?i:redhat|centos|fedora)/: {
case $os {
Expand Down Expand Up @@ -60,7 +71,7 @@
release => '/',
repos => '',
key => {
id => '0143857D9CE8C2D182FE2631F93C028C093BFBA2',
id => regsubst($_gpg_key_fingerprint, ' ', '', 'G'),
source => "${location}/Release.key",
},
}
Expand Down
4 changes: 3 additions & 1 deletion manifests/storage.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@
if $manage_package {
package { $package_name:
ensure => $package_ensure,
tag => 'bareos',
tag => ['bareos', 'bareos_storage'],
}
}

if $manage_service {
service { $service_name:
ensure => $service_ensure,
enable => $service_enable,
tag => ['bareos', 'bareos_storage'],
}
}

Expand All @@ -51,5 +52,6 @@
group => $::bareos::file_group,
require => Package[$package_name],
notify => Service[$service_name],
tag => ['bareos', 'bareos_storage'],
}
}
1 change: 1 addition & 0 deletions manifests/storage/autochanger.pp
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@
content => template('bareos/resource.erb'),
notify => Service[$::bareos::storage::service_name],
require => $_require_resource,
tag => ['bareos', 'bareos_storage'],
}
}
1 change: 1 addition & 0 deletions manifests/storage/device.pp
Original file line number Diff line number Diff line change
Expand Up @@ -581,5 +581,6 @@
group => $::bareos::file_group,
content => template('bareos/resource.erb'),
notify => Service[$::bareos::storage::service_name],
tag => ['bareos', 'bareos_storage'],
}
}
1 change: 1 addition & 0 deletions manifests/storage/director.pp
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,6 @@
group => $::bareos::file_group,
content => template('bareos/resource.erb'),
notify => Service[$::bareos::storage::service_name],
tag => ['bareos', 'bareos_storage'],
}
}
1 change: 1 addition & 0 deletions manifests/storage/messages.pp
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,6 @@
group => $::bareos::file_group,
content => template('bareos/resource.erb'),
notify => Service[$::bareos::storage::service_name],
tag => ['bareos', 'bareos_storage'],
}
}
1 change: 1 addition & 0 deletions manifests/storage/ndmp.pp
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,6 @@
group => $::bareos::file_group,
content => template('bareos/resource.erb'),
notify => Service[$::bareos::storage::service_name],
tag => ['bareos', 'bareos_storage'],
}
}
1 change: 1 addition & 0 deletions manifests/storage/storage.pp
Original file line number Diff line number Diff line change
Expand Up @@ -509,5 +509,6 @@
content => template('bareos/resource.erb'),
notify => Service[$::bareos::storage::service_name],
require => $_require_resource,
tag => ['bareos', 'bareos_storage'],
}
}
Loading

0 comments on commit 1eba8f5

Please sign in to comment.