Hi all, I wanted to check I''m not doing anything wrong before I lodge a bug. I think composite tags should work according to this doc: http://docs.puppetlabs.com/puppet/3/reference/lang_tags.html#restricting-catalog-runs However I do not get the expected behaviour with my test using Puppet 3: $ puppet apply test.pp --noop --tags "woof,service" Notice: /Stage[main]//File[/tmp/foo]/ensure: current_value absent, should be present (noop) Notice: /Stage[main]//File[/tmp/bar]/ensure: current_value absent, should be present (noop) Notice: /Stage[main]//Service[foo]/ensure: current_value stopped, should be running (noop) For this catalog: file { ''/tmp/foo'': ensure => present, tag => [ ''woof'', ''cow'' ], } service { ''foo'': ensure => running, tag => [ ''woof'', ''cow'' ], } file { ''/tmp/bar'': ensure => present, notify => Service[''foo''], } It should only work on the service, not everything. Bug, yes? -Luke -- 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.
As far as I can tell, if a provided tag matches any tag in the resource, it will be applied. Since you provide woof and service, file { ''/tmp/foo'': is run because it is tagged woof, service { ''foo'': is run because it is tagged woof and is a service, and file { ''/tmp/bar'': is run because it is a service. On Monday, March 25, 2013 5:35:30 AM UTC-7, Luke Bigum wrote:> > Hi all, > > I wanted to check I''m not doing anything wrong before I lodge a bug. I > think composite tags should work according to this doc: > > > http://docs.puppetlabs.com/puppet/3/reference/lang_tags.html#restricting-catalog-runs > > However I do not get the expected behaviour with my test using Puppet 3: > > $ puppet apply test.pp --noop --tags "woof,service" > Notice: /Stage[main]//File[/tmp/foo]/ensure: current_value absent, should > be present (noop) > Notice: /Stage[main]//File[/tmp/bar]/ensure: current_value absent, should > be present (noop) > Notice: /Stage[main]//Service[foo]/ensure: current_value stopped, should > be running (noop) > > For this catalog: > > file { ''/tmp/foo'': > ensure => present, > tag => [ ''woof'', ''cow'' ], > } > service { ''foo'': > ensure => running, > tag => [ ''woof'', ''cow'' ], > } > file { ''/tmp/bar'': > ensure => present, > notify => Service[''foo''], > } > > It should only work on the service, not everything. > > Bug, yes? > > -Luke >-- 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.
On Monday, March 25, 2013 5:25:20 PM UTC, Ellison Marks wrote:> As far as I can tell, if a provided tag matches any tag in the resource, > it will be applied. Since you provide woof and service, file { ''/tmp/foo'': > is run because it is tagged woof, service { ''foo'': is run because it is > tagged woof and is a service, and file { ''/tmp/bar'': is run because it is a > service. >Nope, File[/tmp/bar] is not a Service, it''s a file :-) It shouldn''t match the tags specified if it''s treated as a logical AND or a logical OR. My Puppet output is bogus though, I pasted the wrong command for that manifest (symptom of trying out a bunch of different combinations), this is the correct output: $ puppet apply test.pp --noop --tags "woof,service" Notice: /Stage[main]//File[/tmp/foo]/ensure: current_value absent, should be present (noop) Notice: /Stage[main]//Service[foo]/ensure: current_value stopped, should be running (noop) However you have got me thinking that the tags behave like a logical OR rather than in a composite nature that I originally assumed. -Luke On Monday, March 25, 2013 5:35:30 AM UTC-7, Luke Bigum wrote:>> >> Hi all, >> >> I wanted to check I''m not doing anything wrong before I lodge a bug. I >> think composite tags should work according to this doc: >> >> >> http://docs.puppetlabs.com/puppet/3/reference/lang_tags.html#restricting-catalog-runs >> >> However I do not get the expected behaviour with my test using Puppet 3: >> >> $ puppet apply test.pp --noop --tags "woof,service" >> Notice: /Stage[main]//File[/tmp/foo]/ensure: current_value absent, should >> be present (noop) >> Notice: /Stage[main]//File[/tmp/bar]/ensure: current_value absent, should >> be present (noop) >> Notice: /Stage[main]//Service[foo]/ensure: current_value stopped, should >> be running (noop) >> >> For this catalog: >> >> file { ''/tmp/foo'': >> ensure => present, >> tag => [ ''woof'', ''cow'' ], >> } >> service { ''foo'': >> ensure => running, >> tag => [ ''woof'', ''cow'' ], >> } >> file { ''/tmp/bar'': >> ensure => present, >> notify => Service[''foo''], >> } >> >> It should only work on the service, not everything. >> >> Bug, yes? >> >> -Luke >> >-- 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.
I read a little more stuff. From the docs: All language statements enclosed in a node, define or class structure will automatically be tagged with the name of that statement. These automatically-applied tags will be inherited by any object enclosed in that class, regardless of the depth of enclosure. Notice that that doesn''t include resources. I guess resources aren''t valid auto-tags, so that would be why the two are being included: they''re tagged woof. You specified to include anything tagged service, but nothing was tagged as such. On Monday, March 25, 2013 10:43:51 AM UTC-7, Luke Bigum wrote:> > On Monday, March 25, 2013 5:25:20 PM UTC, Ellison Marks wrote: > >> As far as I can tell, if a provided tag matches any tag in the resource, >> it will be applied. Since you provide woof and service, file { ''/tmp/foo'': >> is run because it is tagged woof, service { ''foo'': is run because it is >> tagged woof and is a service, and file { ''/tmp/bar'': is run because it is a >> service. >> > > Nope, File[/tmp/bar] is not a Service, it''s a file :-) It shouldn''t match > the tags specified if it''s treated as a logical AND or a logical OR. > > My Puppet output is bogus though, I pasted the wrong command for that > manifest (symptom of trying out a bunch of different combinations), this is > the correct output: > > $ puppet apply test.pp --noop --tags "woof,service" > Notice: /Stage[main]//File[/tmp/foo]/ensure: current_value absent, should > be present (noop) > Notice: /Stage[main]//Service[foo]/ensure: current_value stopped, should > be running (noop) > > However you have got me thinking that the tags behave like a logical OR > rather than in a composite nature that I originally assumed. > > -Luke > > On Monday, March 25, 2013 5:35:30 AM UTC-7, Luke Bigum wrote: >>> >>> Hi all, >>> >>> I wanted to check I''m not doing anything wrong before I lodge a bug. I >>> think composite tags should work according to this doc: >>> >>> >>> http://docs.puppetlabs.com/puppet/3/reference/lang_tags.html#restricting-catalog-runs >>> >>> However I do not get the expected behaviour with my test using Puppet 3: >>> >>> $ puppet apply test.pp --noop --tags "woof,service" >>> Notice: /Stage[main]//File[/tmp/foo]/ensure: current_value absent, >>> should be present (noop) >>> Notice: /Stage[main]//File[/tmp/bar]/ensure: current_value absent, >>> should be present (noop) >>> Notice: /Stage[main]//Service[foo]/ensure: current_value stopped, should >>> be running (noop) >>> >>> For this catalog: >>> >>> file { ''/tmp/foo'': >>> ensure => present, >>> tag => [ ''woof'', ''cow'' ], >>> } >>> service { ''foo'': >>> ensure => running, >>> tag => [ ''woof'', ''cow'' ], >>> } >>> file { ''/tmp/bar'': >>> ensure => present, >>> notify => Service[''foo''], >>> } >>> >>> It should only work on the service, not everything. >>> >>> Bug, yes? >>> >>> -Luke >>> >>-- 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.