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

Fix ordering in director module class #396

Merged
merged 1 commit into from
Dec 1, 2023
Merged
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
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'],
}
}
}
}
Loading