From 7c299b190206ac85b384706600ae05bd954b7521 Mon Sep 17 00:00:00 2001 From: varac Date: Sun, 2 Apr 2017 23:50:32 +0200 Subject: Change to notify instead of subscribe After making the module compatible with puppetlabs/concat, subscribing to the config file failed with: Error: Failed to apply catalog: Could not find dependency File[/etc/unbound/unbound.conf] for Service[unbound] at /etc/puppet/modules/unbound/manifests/service.pp:21 So we use notify now from every concat::fragment --- manifests/forward.pp | 5 +++-- manifests/init.pp | 5 +++-- manifests/service.pp | 1 - manifests/stub.pp | 5 +++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/manifests/forward.pp b/manifests/forward.pp index 740c004..4509f81 100644 --- a/manifests/forward.pp +++ b/manifests/forward.pp @@ -25,8 +25,9 @@ define unbound::forward ( $real_settings = { forward-zone => merge($zone_name, $settings) } concat::fragment { "unbound ${title}": - target => $unbound::params::config, + target => $unbound::params::config, content => template('unbound/unbound.conf.erb'), - order => 3, + order => 3, + notify => Service[$unbound::params::service] } } diff --git a/manifests/init.pp b/manifests/init.pp index 8b1c3e5..e06207e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -109,8 +109,9 @@ class unbound ( } concat::fragment { 'unbound server': - target => $unbound::params::config, + target => $unbound::params::config, content => template('unbound/unbound.conf.erb'), - order => 1, + order => 1, + notify => Service[$unbound::params::service] } } diff --git a/manifests/service.pp b/manifests/service.pp index f96f453..847aec5 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -17,6 +17,5 @@ class unbound::service { service { $unbound::params::service: ensure => running, hasstatus => $unbound::params::hasstatus, - subscribe => File[$unbound::params::config], } } diff --git a/manifests/stub.pp b/manifests/stub.pp index 02797fd..0845b0e 100644 --- a/manifests/stub.pp +++ b/manifests/stub.pp @@ -25,8 +25,9 @@ define unbound::stub ( $real_settings = { stub-zone => merge($zone_name, $settings) } concat::fragment { "unbound ${title}": - target => $unbound::params::config, + target => $unbound::params::config, content => template('unbound/unbound.conf.erb'), - order => 2, + order => 2, + notify => Service[$unbound::params::service] } } -- cgit v1.2.3