Ask Your Question

identical template copied every time the agent runs

asked 2013-03-20 08:59:18 -0600

simonC gravatar image

updated 2013-03-20 09:54:39 -0600

I have a template for jboss7 config named standalone.xml.erb

every time I run the agent on the client machine this template is loaded from puppet master even if the template on the client is the same.

How can I prevent there a log to see why puppet is considering the template as changed?

i'm using puppet 2.6

puppet code :

file {"${jboss_home}/standalone/configuration/standalone.xml":
  content => template('four_pm/jboss/standalone.xml.erb'),
  notify  => Service['jboss'],

full puppet agent output

[root@instance-00002 ~]# puppet agent --test
info: Retrieving plugin
info: Loading facts in drbd
info: Loading ...
edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2013-03-20 12:20:18 -0600

jonn gravatar image

I believe that JBoss manages standalone.xml whilst the application server is running, so I suspect it is changing the file underneath you. What happens if you shut down JBoss before running puppet --test, then start up afterwards once the template changes have been made?

I've not done this myself, but if you need to manage JBoss whilst it is up, I believe there's a CLI you can use ( which may be possible to drive via puppet.

edit flag offensive delete link more


@jonn you are right ... i will go for jboss CLI to change options in standalone.xml

simonC gravatar imagesimonC ( 2013-03-21 05:16:06 -0600 )edit

answered 2013-03-20 15:09:12 -0600

Stefan gravatar image

Puppet is replacing the file because the md5 checksum of the target file differs from the content that is generated by your template. You can see the message here:

notice: /File[/usr/share/jboss-as/standalone/configuration/standalone.xml]/content: content changed '{md5}4b69200f1d74524d24850f2c74822e40' to '{md5}d25c1516399ae4a3b0559b097c8ed8e4'

So there are basically two options:

  • puppet silently fail to replace the file, so the file stays out of sync
  • something else is reverting the change, e.g. the startup/restart of the jboss service
edit flag offensive delete link more

answered 2013-03-20 09:28:53 -0600

llowder gravatar image

There are a few things you can do. Run the agent using -t or --test

* --test:   Enable the most common options used for testing. These are 'onetime',   'verbose', 'ignorecache', 'no-daemonize', 'no-usecacheonfailure',   'detailed-exit-codes', 'no-splay', and 'show_diff'.

The "show_diff" is the key one here. Combine that with --debug (on the agent, and possibly the master as well) and you should be able to see what has changed.

If you know the different md5sums from different runs, you can also go to the master and look at the content that way - but I am not sure what sort of history that maintains.

Without ... (more)

edit flag offensive delete link more


I've added the full puppet agent output in my question ....i'm runing with --test option and every run it returnes the same diff for that template even if ...(more)

simonC gravatar imagesimonC ( 2013-03-20 09:47:07 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-03-20 08:59:18 -0600

Seen: 570 times

Last updated: Mar 20 '13