Issue #4560 has been updated by Ian Ward Comfort.

Sure. I'll try to be brief but my use-case is a little involved.

I often use custom definitions to encapsulate functionality within modules, but 
still allow multiple modules to interact with each other.  I have a postfix 
module that manages Postfix on all my hosts -- MTAs, final-delivery mailhosts, 
as well as null clients.  I also have a user module which handles all my user 
accounts.

I want my human & system user accounts to be treated differently by Postfix -- 
for example, on a null client nc.stanford.edu I want to send email as 
[email protected], but I want system mail to come from, e.g., 
[email protected] and [email protected].  I effect this by leaving 
$myorigin alone and adding a canonical mapping for icomfort -> 
[email protected].  On a mail gateway, however, I want a virtual mapping 
that sends icomfort's mail to my preferred mailhost; say [email protected] 
-> [email protected].

My user module passes information to the postfix module about which users are 
human using a custom definition, postfix::human.  This is pseudo-code but it 
captures the design well enough.

<pre>
$mail_domain = 'stanford.edu'
$user_mail_host = 'mh.stanford.edu'

define user::human {
  user { $name: }
  postfix::human { $name: }
}

define postfix::human {
  @postfix::canonical { $name:
    address => "$n...@$mail_domain",
  }
  @postfix::virtual { "$n...@$mail_domain":
    address => "$n...@$user_mail_host",
  }
}

class postfix::nullclient {
  Postfix::Canonical<| tag == 'postfix::human' |>
}

class postfix::gateway {
  Postfix::Virtual<| tag == 'postfix::human' |>
}

user::human { 'icomfort': }
</pre>

I can't realize all canonical or (Postfix-)virtual mappings in my postfix 
subclasses because I use (Puppet-)virtual mapping resources for other 
functionality, as well.
----------------------------------------
Bug #4560: Virtual resources inside definitions not properly realized by tag
http://projects.puppetlabs.com/issues/4560

Author: Ian Ward Comfort
Status: Needs more information
Priority: Normal
Assigned to: 
Category: 
Target version: 
Affected version: 2.6.1rc2
Keywords: realize virtual resource definition tag
Branch: 


This problem bit my production environment, running 0.25.5, but I can reproduce 
the problem with 2.6.1rc2, so I'm filing against that.

Consider this sample manifest:
<pre>
define mydef { @notify { $name: } }
mydef { 'foo': }
Notify<| tag == 'mydef' |>
</pre>

Given the metaparameter documentation for 'tag', I would expect this manifest 
to generate a real notify resource and a message at catalog-run time, but it 
does not.

If the last line is change to `Notify<||>`, to realize all virtual notify 
resources, the notification appears properly.

More curiously, if the definition is changed to `define mydef { @notify { 
$name: tag => 'mydef' } }`, with an explicit tag of the definition name, the 
notification *also* appears properly.


-- 
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.

Reply via email to