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

WIP #106

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

WIP #106

Show file tree
Hide file tree
Changes from all commits
Commits
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
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