Ask Your Question
1

identical template copied every time the agent runs

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

simonC gravatar image

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

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 this...is 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 ...
(more)
edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
3

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

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 (community.jboss.org/wiki/CommandLineInterface) which may be possible to drive via puppet.

edit flag offensive delete link more

Comments

@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 -0500 )edit
1

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

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
0

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

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

Comments

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 -0500 )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

Stats

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

Seen: 514 times

Last updated: Mar 20 '13