Bug #757

interface type does not allow changing of target

Added by Marcin Owsiany almost 5 years ago. Updated over 4 years ago.

Status:Closed Start date:
Priority:Low Due date:
Assignee:Luke Kanies % Done:

0%

Category:-
Target version:0.24.0
Affected Puppet version:0.25.4 Branch:
Keywords:
Votes: 0

Description

Using the somewhat not-officially-released-but-available 0.23.2:

With the following .pp file:

interface { "codguweb01-ssc0":
        onboot => true,
        ifopts => "netmask + broadcast + group nafo deprecated -failover",
        target => "/tmp/interface-test/hostname.ce0",
        require => Interface[[foobar]],
        interface => "ce0"
}
interface { "foobar":
        interface_type => "alias",
        onboot => true,
        ifopts => "netmask + broadcast +",
        target => "/tmp/interface-test/hostname.ce0",
        interface => "ce0"
}

I get the following error:


debug: Prefetching sunos resources for interface
debug: //Interface[codguweb01-ssc0]/require: requires Interface[foobar]
debug: //Interface[foobar]: Changing ensure
debug: //Interface[foobar]: 1 change(s)
debug: //Interface[foobar]/ensure: setting present (currently absent)
notice: //Interface[foobar]/ensure: created
debug: Flushing interface provider target
/opt/lib/ruby/site_ruby/1.8/puppet/util/filetype.rb:72:in @exists?'
/opt/lib/ruby/site_ruby/1.8/puppet/util/filetype.rb:72:in @backup'
/opt/lib/ruby/site_ruby/1.8/puppet/util/filetype.rb:104:in @write'
/opt/lib/ruby/site_ruby/1.8/puppet/util/filetype.rb:50:in @real_write'
/opt/lib/ruby/site_ruby/1.8/puppet/util/filetype.rb:50:in @write'
/opt/lib/ruby/site_ruby/1.8/puppet/provider/parsedfile.rb:86:in @flush_target'
/opt/lib/ruby/site_ruby/1.8/puppet/provider/parsedfile.rb:74:in @flush'
/opt/lib/ruby/site_ruby/1.8/puppet/provider/parsedfile.rb:72:in @each'
/opt/lib/ruby/site_ruby/1.8/puppet/provider/parsedfile.rb:72:in @flush'
/opt/lib/ruby/site_ruby/1.8/puppet/provider/parsedfile.rb:324:in @flush'
/opt/lib/ruby/site_ruby/1.8/puppet/metatype/evaluation.rb:40:in @flush'
/opt/lib/ruby/site_ruby/1.8/puppet/transaction.rb:77:in @apply'
/opt/lib/ruby/site_ruby/1.8/puppet/transaction.rb:231:in @eval_resource'
/opt/lib/ruby/site_ruby/1.8/puppet/util.rb:444:in @thinmark'
/opt/lib/ruby/1.8/benchmark.rb:293:in @measure'
/opt/lib/ruby/1.8/benchmark.rb:307:in @realtime'
/opt/lib/ruby/site_ruby/1.8/puppet/util.rb:443:in @thinmark'
/opt/lib/ruby/site_ruby/1.8/puppet/transaction.rb:230:in @eval_resource'
/opt/lib/ruby/site_ruby/1.8/puppet/transaction.rb:301:in @evaluate'
/opt/lib/ruby/site_ruby/1.8/puppet/util.rb:444:in @thinmark'
/opt/lib/ruby/1.8/benchmark.rb:293:in @measure'
/opt/lib/ruby/1.8/benchmark.rb:307:in @realtime'
/opt/lib/ruby/site_ruby/1.8/puppet/util.rb:443:in @thinmark'
/opt/lib/ruby/site_ruby/1.8/puppet/transaction.rb:300:in @evaluate'
/opt/lib/ruby/site_ruby/1.8/puppet/transaction.rb:294:in @collect'
/opt/lib/ruby/site_ruby/1.8/puppet/transaction.rb:294:in @evaluate'
/opt/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:68:in @apply'
/opt/bin/puppet:194
err: Could not apply complete configuration: Puppet::Util::FileType::FileTypeFlat could not write : can't convert nil into String
debug: Storing state
debug: Stored state in 0.08 seconds

Changing newparam(:target) to newproperty(:target) in interface.rb fixes the problem for me. The only ugly thing remaining is that prefetch seems to ignore the target, since I then get the following messages on every run, when using a non-standard target file (i.e. not /etc/hostname.*):

debug: Prefetching sunos resources for interface
debug: //Interface[codguweb01-ssc0]/require: requires Interface[foobar]
debug: //Interface[foobar]: Changing ensure
debug: //Interface[foobar]: 1 change(s)
debug: //Interface[foobar]/ensure: setting present (currently absent)
notice: //Interface[foobar]/ensure: created
debug: Flushing interface provider target /tmp/interface-test/hostname.ce0
debug: Finishing transaction 3692616 with 0 changes
debug: //Interface[codguweb01-ssc0]: Changing ensure
debug: //Interface[codguweb01-ssc0]: 1 change(s)
debug: //Interface[codguweb01-ssc0]/ensure: setting present (currently absent)
notice: //Interface[codguweb01-ssc0]/ensure: created
debug: Flushing interface provider target /tmp/interface-test/hostname.ce0

please not the “currently absent” bit, which is reported even if the interface is already in /tmp/interface-test/hostname.ce0.

History

Updated by Marcin Owsiany almost 5 years ago

Turns out I also get the first error when I only use “interface => ce0”, without even specifying “target=>…”.

Updated by Marcin Owsiany over 4 years ago

Please have a look at #820: the fix I suggested breaks the redhat provider.

Updated by Luke Kanies over 4 years ago

  • Status changed from 1 to Closed
  • 7 set to invalid

I removed the usage of target at all in commit:eee9f5e3260a1b053333f3ab88e95241ef710d00, making this ticket invalid now.

Also available in: Atom PDF