Puppet: System Administration Automated

Support

Ticket #1094 (closed defect: fixed)

Opened 9 months ago

Last modified 9 months ago

resource aliases aren't being validated

Reported by: whaymand Assigned to: luke
Priority: normal Milestone: 0.24.3
Component: library Version: 0.24.2
Severity: normal Keywords: resource require alias
Cc: Triage Stage: Accepted
Attached Patches: None Complexity: Unknown

Description

I now get (compared to 0.23.2)

Could not find dependency Package[cron] for Service[crond] at /users/unix/sa_dewha/SVNCheckOut/bootstrap/puppet/modules/zztest/examples/../../zztest/manifests/init.pp:26

For something like

class zztest::setup {
    package { vixie-cron:
        alias => "cron",
        ensure => installed
    }
    service { crond:
        ensure => running,
        enable => true,
        require => Package[cron]
    }
}

Change History

02/26/08 13:50:54 changed by Fujin

  • keywords set to resource require alias.
  • summary changed from 0.24.2rc1 Can't require => package alias to 0.24.2rc1 resources can't require other resources aliases.
  • stage changed from Unreviewed to Accepted.

Able to replicate here with the Package type and the File type.

root@junglist /tmp# cat test.pp
#!/usr/bin/env puppet
package {
   pwgen:
      ensure => installed,
      alias => "pwgentestaliaslol";
}
file {
   "/tmp/testing":
      ensure => present,
      require => Package[pwgentestaliaslol];
}
root@junglist /tmp# ./test.pp
Could not find dependency Package[pwgentestaliaslol] for File[/tmp/testing] at /tmp/./test.pp:11
#!/usr/bin/env puppet
file {
   "/tmp/testing-file-alias":
      alias => "filealiastest",
      ensure => present;
   "/tmp/testing":
      ensure => present,
      require => File[filealiastest];
}
root@junglist /tmp# ./test.pp
Could not find dependency File[filealiastest] for File[/tmp/testing] at /tmp/./test.pp:9

02/26/08 22:13:11 changed by Fujin

Backtrace:

/usr/local/lib/site_ruby/1.8/puppet/parameter.rb:279:in `fail'
/usr/local/lib/site_ruby/1.8/puppet/metatype/metaparams.rb:261:in `validate_relationship'
/usr/local/lib/site_ruby/1.8/puppet/metatype/metaparams.rb:258:in `each'
/usr/local/lib/site_ruby/1.8/puppet/metatype/metaparams.rb:258:in `validate_relationship'
/usr/local/lib/site_ruby/1.8/puppet/type.rb:292:in `finish'
/usr/local/lib/site_ruby/1.8/puppet/type.rb:290:in `collect'
/usr/local/lib/site_ruby/1.8/puppet/type.rb:290:in `finish'
/usr/local/lib/site_ruby/1.8/puppet/type/file.rb:335:in `finish'
/usr/local/lib/site_ruby/1.8/puppet/node/catalog.rb:274:in `finalize'
/usr/local/lib/site_ruby/1.8/puppet/node/catalog.rb:274:in `each'
/usr/local/lib/site_ruby/1.8/puppet/node/catalog.rb:274:in `finalize'
/usr/bin/puppet:214
Could not find dependency File[filealiastest] for File[/tmp/testing] at /tmp/test.pp:9

03/04/08 11:55:35 changed by Fujin

  • status changed from new to assigned.
  • severity changed from normal to major.
  • priority changed from normal to high.
  • version set to 0.24.2.
  • milestone set to 0.24.3.
  • owner changed from community to Fujin.

03/04/08 11:58:35 changed by Fujin

  • summary changed from 0.24.2rc1 resources can't require other resources aliases to resource aliases aren't being validated.

03/04/08 23:11:19 changed by Fujin

  • owner changed from Fujin to luke.
  • priority changed from high to normal.
  • status changed from assigned to new.
  • severity changed from major to normal.

Workaround for now: use the 'name' parameter instead of alias - this requires a little bit of manifest changing, but should work fine.

root@junglist /tmp# cat test.pp
#!/usr/bin/env puppet
package {
   pwgen:
      ensure => installed,
      alias => "pwgentestaliaslol";
}
file {
   "/tmp/testing":
      ensure => present,
      require => Package[pwgentestaliaslol];
}
root@junglist /tmp# ./test.pp
Could not find dependency Package[pwgentestaliaslol] for File[/tmp/testing] at /tmp/./test.pp:11

Workaround: {{{7 root@junglist /tmp# cat test2.pp #!/usr/bin/env puppet file {

"filealiastest":

path => "/tmp", ensure => present;

"/tmp/testing":

ensure => present, require => File[filealiastest];

} root@junglist /tmp# ./test2.pp notice: //File/tmp/testing/ensure: created }}}

03/04/08 23:13:18 changed by Fujin

Ugh, I managed to munge that comment quite well.

Workaround:

root@junglist /tmp# cat test2.pp
#!/usr/bin/env puppet
file {
   "filealiastest":
      path => "/tmp",
      ensure => present;
   "/tmp/testing":
      ensure => present,
      require => File[filealiastest];
}
root@junglist /tmp# ./test2.pp
notice: //File[/tmp/testing]/ensure: created

03/06/08 22:04:30 changed by luke

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [4c0f6c8502a0759519877f3e933e44ba980f7da2].