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

Add acceptance test #109

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Add acceptance test #109

wants to merge 10 commits into from

Conversation

smortex
Copy link
Member

@smortex smortex commented Mar 14, 2022

We have an example in this project and can run acceptance tests against it. Will it work?

@smortex
Copy link
Member Author

smortex commented Mar 16, 2022

With no experience with this module, fixing acceptance tests might be tricky… I feel like somebody used to the module can quickly manage to fix these tests so that we can have more coverage during tests. @FlorentPoinsaut maybe wink wink wink 😉 ?

The idea would be to adjust examples/init.pp until it works on all supported OS…

@FlorentPoinsaut
Copy link
Member

I take a look.

@FlorentPoinsaut
Copy link
Member

There are a problem with dependency packages (*_package_name) set in param class.
For Bareos 18.2 and 19.2, it need *-python-plugin package but for 20 and 21 versions, it is *-python3-plugin.
I don't find a way to do this without moving this variables form param class to repository class.
May I do that or you see another solution?

@smortex
Copy link
Member Author

smortex commented Mar 17, 2022

Okay, if I follow correctly the package lists are OS dependent and dependent on the usage of external repos. Maybe me can have for each OS the list of packages by repo in params.pp, e.g.:

$system_director_packages = ['foo']
$bareos_director_packages = ['python2-foo']

And for another OS:

$system_director_packages = ['python-foo']
$bareos_director_packages = ['python3-foo']

Then depending on the repo used we use the suited variable in the main manifest:

class bareos (
  # ...
  $director_package_name = undef, # change to undef so we can pick later
) inherits bareos::params {

  # Get the right packages for fallback if not provided
  $default_director_packages = $manage_repo ? {
    true  => $bareos_director_packages,
    false => $system_director_packages,
  }

  # pick the right package
  $director_packages = pick($director_package_name, $default_director_packages)

  # use it
  package { $director_packages:
    # ...
  }
}

That way we don't change the interface for end users of the module and all the actual data is in params.pp (making it easy to switch to hiera data in the future).

Probably not the only way to do it?

@jhoblitt
Copy link
Member

jhoblitt commented Oct 6, 2022

Rebased on current master.

@jhoblitt
Copy link
Member

jhoblitt commented Nov 3, 2022

It looks like this is failing because the bareos-database-mysql doesn't exist for baseos 21: https://www.bareos.com/end-of-life-mysql/

@jhoblitt
Copy link
Member

jhoblitt commented Nov 3, 2022

Rebased on current master.

jhoblitt and others added 7 commits November 21, 2022 10:45
As of bareos 21, the only supported db is `postgres` and the `DB Driver`
configuration directive itself is deprecated.  The puppet parameter is
being left in place "for the moment" to catch existing users of this
module which may have been setting a different DB backend via hiera.

See: https://docs.bareos.org/Configuration/Director.html#config-Dir_Catalog_DbDriver
Resolves these warnings:

    Notice: /Stage[main]/Bareos/File[/etc/bareos/bareos-dir-export]: Not removing directory; use 'force' to override
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants