Issue #4131 has been updated by Markus Roberts.
I can not reproduce, but (using 'x' for the host name) I get:
<pre>
notice: /Stage[main]//Host[x]/host_aliases: host_aliases changed '' to 'alias1'
notice: /Stage[main]//Host[x]/target: target changed '/etc/hosts' to '/tmp/host'
debug: Flushing host provider target /etc/hosts
debug: Finishing transaction 13599040
info: FileBucket got a duplicate file /private/etc/hosts
({md5}0cc2c9ae4b7ebc3ad1068e96fc73f1d9)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1262:in
`initialize'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1262:in
`open'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1262:in
`copy_file'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1261:in
`open'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1261:in
`copy_file'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:463:in
`copy_file'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:383:in
`cp'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1395:in
`fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1411:in
`fu_each_src_dest0'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1393:in
`fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:382:in
`cp'
./lib/puppet/util/filetype.rb:116:in `write'
./lib/puppet/util/filetype.rb:55:in `real_write'
./lib/puppet/util/filetype.rb:55:in `write'
./lib/puppet/provider/parsedfile.rb:102:in `flush_target'
./lib/puppet/provider/parsedfile.rb:74:in `flush'
./lib/puppet/provider/parsedfile.rb:72:in `each'
./lib/puppet/provider/parsedfile.rb:72:in `flush'
./lib/puppet/provider/parsedfile.rb:356:in `flush'
./lib/puppet/type.rb:674:in `flush'
./lib/puppet/transaction/resource_harness.rb:95:in `evaluate'
./lib/puppet/transaction.rb:49:in `apply'
./lib/puppet/transaction.rb:114:in `eval_children_and_apply_resource'
./lib/puppet/transaction.rb:92:in `eval_resource'
./lib/puppet/transaction.rb:143:in `evaluate'
./lib/puppet/util.rb:427:in `thinmark'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/benchmark.rb:308:in
`realtime'
./lib/puppet/util.rb:426:in `thinmark'
./lib/puppet/transaction.rb:142:in `evaluate'
./lib/puppet/transaction.rb:135:in `each'
./lib/puppet/transaction.rb:135:in `evaluate'
./lib/puppet/resource/catalog.rb:148:in `apply'
./lib/puppet/application/apply.rb:128:in `main'
./lib/puppet/application/apply.rb:35:in `run_command'
./lib/puppet/application.rb:305:in `run'
./lib/puppet/application.rb:403:in `exit_on_fail'
./lib/puppet/application.rb:305:in `run'
./lib/puppet/util/command_line.rb:52:in `execute'
bin/puppet:73
./lib/puppet/util/filetype.rb:64:in `write'
./lib/puppet/provider/parsedfile.rb:102:in `flush_target'
./lib/puppet/provider/parsedfile.rb:74:in `flush'
./lib/puppet/provider/parsedfile.rb:72:in `each'
./lib/puppet/provider/parsedfile.rb:72:in `flush'
./lib/puppet/provider/parsedfile.rb:356:in `flush'
./lib/puppet/type.rb:674:in `flush'
./lib/puppet/transaction/resource_harness.rb:95:in `evaluate'
./lib/puppet/transaction.rb:49:in `apply'
./lib/puppet/transaction.rb:114:in `eval_children_and_apply_resource'
./lib/puppet/transaction.rb:92:in `eval_resource'
./lib/puppet/transaction.rb:143:in `evaluate'
./lib/puppet/util.rb:427:in `thinmark'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/benchmark.rb:308:in
`realtime'
./lib/puppet/util.rb:426:in `thinmark'
./lib/puppet/transaction.rb:142:in `evaluate'
./lib/puppet/transaction.rb:135:in `each'
./lib/puppet/transaction.rb:135:in `evaluate'
./lib/puppet/resource/catalog.rb:148:in `apply'
./lib/puppet/application/apply.rb:128:in `main'
./lib/puppet/application/apply.rb:35:in `run_command'
./lib/puppet/application.rb:305:in `run'
./lib/puppet/application.rb:403:in `exit_on_fail'
./lib/puppet/application.rb:305:in `run'
./lib/puppet/util/command_line.rb:52:in `execute'
bin/puppet:73
err: /Stage[main]//Host[x]: Could not evaluate:
Puppet::Util::FileType::FileTypeFlat could not write /etc/hosts: Permission
denied - /etc/hosts
debug: Finishing transaction 13688910
</pre>
----------------------------------------
Bug #4131: host moves resources from default file to target ( I assume this
applies to all parsedfiles)
http://projects.puppetlabs.com/issues/4131
Author: Dan Bode
Status: Needs more information
Priority: Normal
Assigned to: Dan Bode
Category:
Target version:
Affected version: 2.6alpha1
Keywords:
Branch:
use the host resource and puppet resource:
I expect the following to fail:
<pre>
# puppet resource host test1 ensure=present target="/tmp/host"
host_aliases=alias1
notice: /Host[test1]/ensure: created
err: /Host[test1]: Could not evaluate: ip is a required attribute for hosts
host { 'test1':
host_aliases => ['alias1'],
target => '/tmp/host',
ensure => 'present'
}
</pre>
If there is already an entry for this host in /etc/hosts (the default target),
puppet will use the ip address of that host and move it to the new target
location.
<pre>
# echo '127.0.0.2 test1'> /etc/hosts
[r...@puppet2 puppet_spec]# puppet resource host test1 ensure=present
target="/tmp/host" host_aliases=alias1
notice: /Host[test1]/host_aliases: host_aliases changed '' to 'alias1'
notice: /Host[test1]/target: target changed '/etc/hosts' to '/tmp/host'
host { 'test1':
host_aliases => ['alias1'],
target => '/tmp/host',
ensure => 'present'
}
</pre>
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.