Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
crazymind1337 committed Jun 10, 2022
1 parent b0e9cd4 commit 77c4809
Show file tree
Hide file tree
Showing 102 changed files with 1,549 additions and 4,367 deletions.
13 changes: 6 additions & 7 deletions .fixtures.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
fixtures:
repositories:
concat: https://github.com/puppetlabs/puppetlabs-concat.git
stdlib: https://github.com/puppetlabs/puppetlabs-stdlib.git
apt: https://github.com/puppetlabs/puppetlabs-apt.git
yumrepo_core:
repo: https://github.com/puppetlabs/puppetlabs-yumrepo_core.git
puppet_version: ">= 6.0.0"
forge_modules:
apt: 'puppetlabs-apt'
stdlib: 'puppetlabs-stdlib'
yumrepo_core: 'puppetlabs-yumrepo_core'
symlinks:
bareos: "#{source_dir}"
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false, :groups => [:test]
puppetversion = ENV['PUPPET_GEM_VERSION'] || '>= 6.0'
gem 'puppet', puppetversion, :require => false, :groups => [:test]

gem 'facterdb'
gem 'parallel_tests'
gem 'rspec-puppet-facts'

# vim: syntax=ruby
62 changes: 12 additions & 50 deletions manifests/client.pp
Original file line number Diff line number Diff line change
@@ -1,54 +1,16 @@
# == Class: bareos::client
# This class manages the bareos client (file-daemon) service, packages and configuration directory.
# Parameters should be configured in the upper class `::bareos`.

# 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.
# @summary
#
# @api private
#
class bareos::client (
$manage_service = $bareos::manage_service,
$manage_package = $bareos::manage_package,
$package_name = $bareos::client_package_name,
$package_ensure = $bareos::package_ensure,
$service_name = $bareos::client_service_name,
$service_ensure = $bareos::service_ensure,
$service_enable = $bareos::service_enable,
$config_dir = "${bareos::config_dir}/bareos-fd.d"
) inherits bareos {
include bareos::client::client

if $manage_package {
package { $package_name:
ensure => $package_ensure,
tag => ['bareos', 'bareos_client'],
}
}

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

# directories
$config_client_dirs = [
$config_dir,
"${config_dir}/client",
"${config_dir}/director",
"${config_dir}/messages",
]
contain bareos::client::config
contain bareos::client::package
contain bareos::client::service

file { $config_client_dirs:
ensure => directory,
purge => true,
recurse => true,
force => true,
mode => $bareos::file_dir_mode,
owner => $bareos::file_owner,
group => $bareos::file_group,
require => Package[$package_name],
notify => Service[$service_name],
tag => ['bareos', 'bareos_client'],
}
Class['bareos::client::package'] -> Class['bareos::client::config']
Class['bareos::client::config'] ~> Class['bareos::client::service']
Class['bareos::client::package'] ~> Class['bareos::client::service']
}
Loading

0 comments on commit 77c4809

Please sign in to comment.