baculaweb

pdk
Puppet module for baculaweb - a web based reporting and monitoring tool for Bacula
Andreas Stürz

Andreas Stürz

andeman

1,528 downloads

1,528 latest version

5.0 quality score

Version information

  • 0.1.0 (latest)
released Jan 15th 2020
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
  • Puppet >= 4.10.0 < 7.0.0
  • CentOS
    ,
    OracleLinux
    ,
    RedHat
    ,
    Scientific

Start using this module

Documentation

andeman/baculaweb — version 0.1.0 Jan 15th 2020

baculaweb

Table of Contents

Overview

This module install and configures the baculaweb a web based reporting and monitoring tool for Bacula.

You can find the baculaweb documention here: https://www.bacula-web.org/

The module only install and configure the webapp itself. You still require a webserver (nginx or apache) with php.

Requirements

Optional Setup Requirements

Recommended modules for apache + php setup:

The needed requirements for the webserver and for php are documented here:

http://docs.bacula-web.org/en/latest/02_install/requirements.html

Beginning with baculaweb

All parameters for the baculaweb module are contained within the main baculaweb class, so for any function of the module, set the options you want. All configuration parameters can be assigned hiera. The default values are also lookuped up by hiera. See the common usages below for examples.

Usage

Install and enable baculaweb

include baculaweb

Configure bacula catalog databases

To get baculaweb up and running configure at least one bacula catalog database with the paramter catalog_db.

See the following example for the different catalog database types:

class { 'baculaweb':
  catalog_db => [
    {
      'label'    => 'EXAMPLE: MySQL backup catalog',
      'host'     => 'localhost',
      'login'    => 'bacula',
      'password' => 'verystrongpassword',
      'db_name'  => 'bacula',
      'db_type'  => 'mysql',
      'db_port'  => 3306,
    },
    {
      'label'    => 'EXAMPLE: PostgreSQL backup catalog',
      'host'     => 'localhost',
      'login'    => 'bacula',
      'password' => 'verystrongpassword',
      'db_name'  => 'bacula',
      'db_type'  => 'mysql',
      'db_port'  => 3306,
    },
    {
      'label'   => 'EXAMPLE: SQLite backup catalog',
      'db_name' => '/path/to/database',
      'db_type' => 'sqlite',
    },
  ]
}

Using Hiera:

baculaweb::catalog_db:
  - label: 'EXAMPLE: MySQL backup catalog'
    host: 'localhost'
    login: 'bacula'
    password: 'verystrongpassword'
    db_name: 'bacula'
    db_type: 'mysql'
    db_port: 3306
  - label: 'EXAMPLE: PostgreSQL backup catalog'
    host: 'localhost'
    login: 'bacula'
    password: 'verystrongpassword'
    db_name: 'bacula'
    db_type: 'pgsql'
    db_port: 5432
  - label: 'EXAMPLE: SQLite backup catalog'
    db_name: '/path/to/database'
    db_type: 'sqlite'

Configure custom installation options

Configure custom directories, ownerships and version:

class { 'baculaweb':
  version           => '8.3.3'
  root_dir          => '/var/www/html/bacula-web',
  extract_base_dir  => '/opt/bacula-web',
  user              => 'apache',
  group             => 'apache'
}

Using Hiera:

baculaweb:
  version: '8.3.3'
  root_dir: '/var/www/html/bacula-web'
  extract_base_dir: '/opt/bacula-web'
  user: 'apache'
  group: 'apache'

Configure baculaweb

You find an overview of the baculaweb settings here: http://docs.bacula-web.org/en/latest/02_install/configure.html

See the following example to configure the settings:

class { 'baculaweb':
  language              => 'en_US',
  hide_empty_pools      => true,
  show_inactive_clients => true,
  datetime_format       => 'Y-m-d H:i:s',
  enable_users_auth     => false,
  debug                 => false,
  catalog_db            => [
    {
      'label'    => 'MySQL backup catalog',
      'host'     => 'localhost',
      'login'    => 'bacula',
      'password' => 'verystrongpassword',
      'db_name'  => 'bacula',
      'db_type'  => 'mysql',
      'db_port'  => 3306,
    },
  ]
}

Using Hiera:

baculaweb:
  language: 'en_US'
  hide_empty_pools: true
  show_inactive_clients: true
  datetime_format: 'Y-m-d H:i:s'
  enable_users_auth: false
  debug: false
  catalog_db:
    - label: 'MySQL backup catalog'
      host: 'localhost'
      login: 'bacula'
      password: 'verystrongpassword'
      db_name: 'bacula'
      db_type: 'mysql'
      db_port: 3306

Reference

See REFERENCE.md

Limitations

For a list of supported operating systems, see metadata.json

Development

This module uses puppet_litmus for running acceptance tests.

Setup testing and development environment (MacOSX)

Install required software with brew

brew cask install docker
brew cask install puppetlabs/puppet/pdk
brew cask install puppet-bolt
brew install rbenv
rbenv init
echo 'eval "$(rbenv init -)"' >> $HOME/.zshrc
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
rbenv install 2.6.5

Then execute the following command in the root dir of the module:

rbenv local 2.6.5
gem install bundle
bundle install --path .bundle/gems/

To configure the CentOS docker container:

bundle exec rake 'litmus:provision_list[default]'
bolt command run 'yum -y install http php php php-gettext php-mysql php-pdo php-pgsql php-process' -n localhost:2222 -i inventory.yaml
bolt command run 'service httpd start' -n localhost:2222 -i inventory.yaml 

docker exec -it waffleimage_centos7_-2222 /bin/bash

vim /etc/httpd/conf.d/bacula-web.conf
<Directory /var/www/html/bacula-web>
  AllowOverride All
</Directory>

vim /etc/php.ini
date.timezone = Europe/Berlin

service httpd restart

Build ssh tunnel and access the baculaweb application:

ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@localhost -p 2222 -L 27000:localhost:80 -Nf
http://localhost:27000/

http://localhost:27000/

Running acceptance tests

Update module code in container & run tests:

bolt command run 'puppet module uninstall andeman-baculaweb' -n localhost:2222 -i inventory.yaml 
bundle exec rake litmus:install_module
bundle exec rake litmus:acceptance:parallel

Running unit tests

pdk test unit

Release Notes

See CHANGELOG.md