Puppet on windows: File resource problem

95 views
Skip to first unread message

Mohamed Lrhazi

unread,
Nov 18, 2011, 4:42:44 PM11/18/11
to puppet...@googlegroups.com
Anybody knows what this error, bellow, means, the target file,
C:/Splunk/etc/system/local/inputs.conf, does exist.
sometimes, if I delete the file, it does actually create it, but never
update it if it exists and changed...

The resource is defined as:

    file { "splunk_inputs":        owner   => SYSTEM,        group
=> SYSTEM,        mode    => 664,        require =>
Exec["install_splunk"],        notify => Service["splunk"],
path => "$splunk_home\\etc\\system\\local\\inputs.conf",
content => template("gu_splunk/inputs.conf.windows.erb"),    }
debug: /Stage[main]/Gu_splunk::Windows/File[splunk_inputs]/content:
Executing 'diff -u C:/Splunk/etc/system/local/inputs.conf
C:/Users/ml623/AppData/Local/Temp/
puppet-file20111118-3304-81qt4z-0'
C:/Ruby187/lib/ruby/gems/1.8/gems/win32-process-0.6.5/lib/win32/process.rb:889:in
`create'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/util.rb:336:in `execute_windows'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/util.rb:374:in `execute'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/util/diff.rb:12:in `diff'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/type/file/content.rb:107:in `insync?'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/type/file/content.rb:152:in
`write_temporarily'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/type/file/content.rb:106:in `insync?'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/property.rb:162:in `safe_insync?'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:61:in
`perform_changes'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:60:in
`each'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:60:in
`perform_changes'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:133:in
`evaluate'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/transaction.rb:49:in `apply'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/transaction.rb:84:in `eval_resource'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/transaction.rb:103:in `evaluate'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/util.rb:476:in `thinmark'
C:/Ruby187/lib/ruby/1.8/benchmark.rb:308:in `realtime'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/util.rb:475:in `thinmark'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/transaction.rb:103:in `evaluate'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/transaction.rb:351:in `traverse'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/transaction.rb:99:in `evaluate'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:141:in `apply'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/configurer.rb:121:in
`retrieve_and_apply_catalog'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/util.rb:180:in `benchmark'
C:/Ruby187/lib/ruby/1.8/benchmark.rb:308:in `realtime'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/util.rb:179:in `benchmark'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/configurer.rb:120:in
`retrieve_and_apply_catalog'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/configurer.rb:151:in `run'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/agent.rb:39:in `run'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/agent/locker.rb:21:in `lock'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/agent.rb:39:in `run'
C:/Ruby187/lib/ruby/1.8/sync.rb:230:in `synchronize'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/agent.rb:39:in `run'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/agent.rb:103:in `with_client'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/agent.rb:37:in `run'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/application.rb:172:in `call'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/application.rb:172:in `controlled_run'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/agent.rb:35:in `run'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:336:in `onetime'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:310:in
`run_command'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/application.rb:306:in `run'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/application.rb:410:in `hook'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/application.rb:306:in `run'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/application.rb:401:in `exit_on_fail'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/application.rb:306:in `run'
C:/Ruby187/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:69:in `execute'
C:/Ruby187/bin/puppet:4
err: /Stage[main]/Gu_splunk::Windows/File[splunk_inputs]: Could not
evaluate: CreateProcess() failed: The system cannot find the file
specified.
notice: /Stage[main]/Gu_splunk::Windows/Service[splunk]: Dependency
File[splunk_inputs] has failures: true

Josh Cooper

unread,
Nov 18, 2011, 5:13:25 PM11/18/11
to puppet...@googlegroups.com
Hi Mohamed,

This is issue https://projects.puppetlabs.com/issues/10417 Windows doesn't have a 'diff.exe' command by default.

You can work around this by setting show_diff = false or by specifying appropriate values for 'diff' and 'diff_args'

Josh


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.




--
Josh Cooper
Developer, Puppet Labs

Mohamed Lrhazi

unread,
Nov 18, 2011, 6:17:28 PM11/18/11
to puppet...@googlegroups.com
Thanks a lot Josh.

Mohamed Lrhazi

unread,
Nov 19, 2011, 9:35:51 PM11/19/11
to puppet...@googlegroups.com
I should note that "--test" enables "--show_diff", even if you add
"--show_diff false" to the command line... took me a while to figure
that out!

On Fri, Nov 18, 2011 at 5:13 PM, Josh Cooper <jo...@puppetlabs.com> wrote:

Josh Cooper

unread,
Nov 20, 2011, 7:21:37 PM11/20/11
to puppet...@googlegroups.com
On Sat, Nov 19, 2011 at 6:35 PM, Mohamed Lrhazi <lrh...@gmail.com> wrote:
I should note that "--test" enables "--show_diff", even if you add
"--show_diff false" to the command line... took me a while to figure
that out!


I was hoping to be able to use fc.exe (file compare) on Windows in lieu of diff, but it doesn't work so well. If you know of another utility that comes pre-installed with Windows that can do diffs, I'd love to hear about it. Otherwise, we'll have to set show_diff to false by default on Windows.

Thanks,
Josh

Mohamed Lrhazi

unread,
Nov 20, 2011, 9:01:20 PM11/20/11
to puppet...@googlegroups.com
One odd thing is that setting "show_diff=false" in puppet.conf, in
"agent" stanza seems to be ignored, I get the error still.

I am not a Windows guy, but I installed GNU diff and it seems like it
could be pretty straightforward to deploy:

- Get installer : http://gnuwin32.sourceforge.net/downlinks/diffutils.php
- Run it: C:\Temp\diffutils-2.8.7-1.exe /silent
- Add "diff' to puppet.conf:
diff = "C:\Program Files\GnuWin32\bin\diff"

et voila.

Thanks,
Mohamed.

Reply all
Reply to author
Forward
0 new messages