Skip to content

Commit

Permalink
Merge pull request #396 from Icinga/bug/director-wrong-ordering
Browse files Browse the repository at this point in the history
Fix ordering in director module class
  • Loading branch information
lbetz authored Dec 1, 2023
2 parents 42b30f6 + 9408ef8 commit 40b4fa7
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 18 deletions.
1 change: 1 addition & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* `icingaweb2::install`: Installs Icinga Web 2 and extra packages.
* `icingaweb2::module::director::config`: Configure the director module.
* `icingaweb2::module::director::install`: Install the director module.
* `icingaweb2::module::director::kickstart`: Import or update the database schema. Also start the initial kickstart run if required.
* `icingaweb2::module::director::service`: Manage the director service.
* `icingaweb2::module::icingadb::config`: Configure the icingadb module.
* `icingaweb2::module::icingadb::install`: Install the icingadb module.
Expand Down
6 changes: 5 additions & 1 deletion manifests/module/director.pp
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,12 @@

class { 'icingaweb2::module::director::install': }
-> class { 'icingaweb2::module::director::config': }
~> class { 'icingaweb2::module::director::service': }
-> class { 'icingaweb2::module::director::kickstart': }
-> class { 'icingaweb2::module::director::service':
subscribe => Class['icingaweb2::module::director::config'],
}
contain icingaweb2::module::director::install
contain icingaweb2::module::director::config
contain icingaweb2::module::director::service
contain icingaweb2::module::director::kickstart
}
17 changes: 0 additions & 17 deletions manifests/module/director/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
$install_method = $icingaweb2::module::director::install_method
$db = $icingaweb2::module::director::db
$db_resource = $icingaweb2::module::director::db_resource_name
$import_schema = $icingaweb2::module::director::import_schema
$kickstart = $icingaweb2::module::director::kickstart
$use_tls = $icingaweb2::module::director::use_tls
$tls = $icingaweb2::module::director::tls + {
cacert_file => icingaweb2::pick($icingaweb2::module::director::tls['cacert_file'], $icingaweb2::config::tls['cacert_file']),
Expand Down Expand Up @@ -63,19 +61,4 @@
content => "[Service]\nUser=${service_user}",
}
}

if $import_schema {
exec { 'director-migration':
command => "${icingacli_bin} director migration run",
onlyif => "${icingacli_bin} director migration pending",
}

if $kickstart {
exec { 'director-kickstart':
command => "${icingacli_bin} director kickstart run",
onlyif => "${icingacli_bin} director kickstart required",
require => Exec['director-migration'],
}
}
}
}
27 changes: 27 additions & 0 deletions manifests/module/director/kickstart.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# @summary
# Import or update the database schema. Also start the initial kickstart run if required.
#
# @api private
#
class icingaweb2::module::director::kickstart {
assert_private()

$import_schema = $icingaweb2::module::director::import_schema
$kickstart = $icingaweb2::module::director::kickstart
$icingacli_bin = $icingaweb2::globals::icingacli_bin

if $import_schema {
exec { 'director-migration':
command => "${icingacli_bin} director migration run",
onlyif => "${icingacli_bin} director migration pending",
}

if $kickstart {
exec { 'director-kickstart':
command => "${icingacli_bin} director kickstart run",
onlyif => "${icingacli_bin} director kickstart required",
require => Exec['director-migration'],
}
}
}
}

0 comments on commit 40b4fa7

Please sign in to comment.