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

concat::fragment does not seem to notify properly #740

Open
faxm0dem opened this issue Aug 19, 2022 · 5 comments
Open

concat::fragment does not seem to notify properly #740

faxm0dem opened this issue Aug 19, 2022 · 5 comments

Comments

@faxm0dem
Copy link

Describe the Bug

When using a notify meta parameter in a concat::fragment, the target resource doesn't get notified.

Expected Behavior

When a concat::fragment's state changes, it should properly notify the target resource.

Steps to Reproduce

Example code:

service { 'foo':
  ensure => 'running',
}

concat { '/tmp/foo':
  ensure => 'present',
}

concat::fragment { '/tmp/foo bar':
  target  => '/tmp/foo',
  content => 'bar',
  order   => '10',
  notify  => Service['foo'],
}
  1. Make sure service foo is running
  2. Make sure file /tmp/foo is not present
  3. Run puppet apply on the above code
Notice: Compiled catalog for localhost in environment production in 0.08 seconds
Notice: /Stage[main]/Main/Concat[/tmp/foo]/File[/tmp/foo]/ensure: defined content as '{sha256}fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9'
Notice: Applied catalog in 0.03 seconds

As you can see, even though the file changed, it didn't trigger restart of the service.

Environment

  • Version 6.2.0
  • Platform Debian 11.4
@b4ldr
Copy link
Collaborator

b4ldr commented Sep 9, 2022

looks like this could be the same issue as MODULES-7533 (also see #430)

@ekohl
Copy link
Collaborator

ekohl commented Sep 9, 2022

For some reason these meta parameters are explicitly not copied here:

excluded_metaparams = [:before, :notify, :require, :subscribe, :tag]

It was introduced in dd88b1a but it doesn't explain why those were excluded.

@vchepkov
Copy link

IMHO, one should use concat's resource notify, not an single fragment - result is the same, isn't it?

@faxm0dem
Copy link
Author

I can imagine cases where one fragment should notify the service, but not another.
For instance, a changed comment in a config file shouldn't restart the service.

@b4ldr
Copy link
Collaborator

b4ldr commented Jul 19, 2023

IMHO, one should use concat's resource notify, not an single fragment - result is the same, isn't it?

A real world example we have for this is the puppet.conf file on the puppetserver. most changes to this file are only read by the agent and dont require any notify. however changes to the server section require the puppetserver to be reloaded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants