Skip to content

Commit

Permalink
(WIP) add postgresql db to acceptance test
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoblitt committed Nov 3, 2022
1 parent 68ddca3 commit bc389ec
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
21 changes: 19 additions & 2 deletions examples/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,28 @@
# Learn more about module testing here:
# https://docs.puppet.com/guides/tests_smoke.html
#
class { 'bareos':
}

include postgresql::server

class { 'bareos': }

class { 'bareos::director::director':
password => 'pw',
}

postgresql::server::db { 'bareos_catalog':
user => 'dbuser',
password => postgresql::postgresql_password('bareos', 'dbpass'),
}
-> bareos::director::catalog { 'bareos_catalog':
db_driver => 'postgresql',
db_name => 'bareos_catalog',
db_address => '127.0.0.1',
db_port => 3306,
db_user => 'dbuser',
db_password => 'dbpass',
}

class { 'bareos::client::client':
}
class { 'bareos::storage::storage':
Expand Down
1 change: 1 addition & 0 deletions manifests/director.pp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@

if $manage_database {
File <| tag == 'bareos_director' |> -> exec { 'bareos director init catalog':
user => 'postgres',
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,
Expand Down
5 changes: 5 additions & 0 deletions spec/support/acceptance/setup.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

configure_beaker do |host|
install_module_from_forge_on(host, 'puppetlabs/postgresql', '> 8 < 9')
end

0 comments on commit bc389ec

Please sign in to comment.