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 dependency issues with apt repository #334

Merged
merged 1 commit into from
Apr 19, 2018
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
8 changes: 5 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,19 @@
-> Concat <| tag == 'icinga2::config::file' |>
~> Class['::icinga2::service']

# Put ::icinga2::repo outside to work around dependency cycle issues with the apt module
include '::icinga2::repo'

anchor { '::icinga2::begin':
notify => Class['::icinga2::service']
notify => Class['::icinga2::service'],
}
-> class { '::icinga2::repo': }
-> class { '::icinga2::install': }
-> File <| ensure == 'directory' and tag == 'icinga2::config::file' |>
-> class { '::icinga2::config': notify => Class['::icinga2::service'] }
-> File <| ensure != 'directory' and tag == 'icinga2::config::file' |>
~> class { '::icinga2::service': }
-> anchor { '::icinga2::end':
subscribe => Class['::icinga2::config']
subscribe => Class['::icinga2::config'],
}

include prefix($features, '::icinga2::feature::')
Expand Down
9 changes: 7 additions & 2 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
gpgcheck => 1,
gpgkey => 'http://packages.icinga.com/icinga.key',
}

Yumrepo['icinga-stable-release'] -> Package<|tag == 'icinga2'|>
}
default: {
fail('Your plattform is not supported to manage a repository.')
Expand All @@ -41,6 +43,7 @@
# handle icinga stable repo before all package resources
# contain class problem!
Apt::Source['icinga-stable-release'] -> Package <| tag == 'icinga2' |>
Class['Apt::Update'] -> Package<|tag == 'icinga2'|>
case $::operatingsystem {
'debian': {
include ::apt, ::apt::backports
Expand Down Expand Up @@ -76,7 +79,7 @@
'suse': {

file { '/etc/pki/GPG-KEY-icinga':
ensure => present,
ensure => file,
source => 'http://packages.icinga.com/icinga.key',
}

Expand All @@ -94,8 +97,10 @@
baseurl => "http://packages.icinga.com/SUSE/${::operatingsystemmajrelease}/release/",
enabled => 1,
gpgcheck => 1,
require => Exec['import icinga gpg key']
require => Exec['import icinga gpg key'],
}

Zypprepo['icinga-stable-release'] -> Package <| tag == 'icinga2' |>
}
default: {
fail('Your plattform is not supported to manage a repository.')
Expand Down