Jennings, Jared L CTR USAF AFMC 96 SK/CCI
2013-Feb-11 16:26 UTC
[Puppet Users] file resource, multiple owner values
With Puppet 2.7.20, it seems that when I write file { ''/tmp/bla'': owner => [''root'', ''jared''] } then if the owner of /tmp/bla is either root or jared, nothing happens, and if not, the owner is changed to root. More generically speaking, my reading of the code suggests that if the owner of the file is in the given list (the ''should'' value), the owner property of the file is insync, and if owner is not insync, the file is chowned to should[0]. And likewise with the group property. But I couldn''t find anything in the documentation that says I can provide multiple values for these properties, and what I should expect to happen. This behavior when I provide multiple values for owner is just what I want! But I don''t want to depend on it if it might go away. Does anyone else use the owner and group properties this way? Is there documentation for this behavior that I''ve missed? -- Jared Jennings, RHCE, Network Admin, SURVICE Engineering Co. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Jennings, Jared L CTR USAF AFMC 96 SK/CCI
2013-Feb-11 16:34 UTC
RE: [Puppet Users] file resource, multiple owner values
> This behavior when I provide multiple values for owner is just what I > want! But I don''t want to depend on it if it might go away. Doesanyone> else use the owner and group properties this way? Is theredocumentation> for this behavior that I''ve missed?Ah. From <http://docs.puppetlabs.com/guides/custom_types.html#customizing-behavio ur>: By default, if a property is assigned multiple values in an array: It is considered in sync if any of those values matches the current value. If none of those values match, the first one will be used when syncing the property. -- Jared Jennings, RHCE, Network Admin, SURVICE Engineering Co. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Fascinating. I propose opening a documentation bug, if there is indeed no mention of the functionality. I suppose there isn''t, because this is the first time I hear about this. Cheers, Felix On 02/11/2013 05:26 PM, Jennings, Jared L CTR USAF AFMC 96 SK/CCI wrote:> With Puppet 2.7.20, it seems that when I write > > file { ''/tmp/bla'': > owner => [''root'', ''jared''] > } > > then if the owner of /tmp/bla is either root or jared, nothing happens, > and if not, the owner is changed to root. More generically speaking, my > reading of the code suggests that if the owner of the file is in the > given list (the ''should'' value), the owner property of the file is > insync, and if owner is not insync, the file is chowned to should[0]. > And likewise with the group property. But I couldn''t find anything in > the documentation that says I can provide multiple values for these > properties, and what I should expect to happen. > > This behavior when I provide multiple values for owner is just what I > want! But I don''t want to depend on it if it might go away. Does anyone > else use the owner and group properties this way? Is there documentation > for this behavior that I''ve missed? > > -- Jared Jennings, RHCE, Network Admin, SURVICE Engineering Co. > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.