[chef] Re: Re: Re: Re: List all tags [SEC=UNCLASSIFIED]


Chronological Thread 
  • From: Mark Pimentel < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: List all tags [SEC=UNCLASSIFIED]
  • Date: Mon, 12 Nov 2012 08:32:00 -0500

I do here.  I tag the node with an environment identifier (dev, dit, sit etc).  An environments I use to simply control the cookbook development tracks.  This way I could reuse cookbook development tracks to any number of environments (or tags in my case).  I find this to be much more flexible than to tie nodes to environments to identify its operational environment.


On Mon, Nov 12, 2012 at 1:20 AM, AJ Christensen < " target="_blank"> > wrote:
I don't know that many people actually use tags (they are just glorified attributes anyway).

http://wiki.opscode.com/display/chef/Search should show you how to do this from a Recipe/shef/..

Cheers,

AJ


On 12 November 2012 17:18, Sam Lor < " target="_blank"> > wrote:

Great, thanks AJ.

I do not know (yet) how to get/use it inside Chef/shef but given the output format, the following commands give me the list of all tags with nothing more and nothing less.

knife search node tags:\* -a tags | sed '1d;/^$/d' | egrep -v "^id:|^tags:" | sort | uniq | tr -d ' '


From: AJ Christensen < " target="_blank"> >
To: " target="_blank">
Date: 12/11/2012 04:25 PM
Subject: [chef] Re: List all tags





***
This email message has been processed by MIMEsweeper
***

'knife search node "tags:*" -a tags' or equivalent in a recipe (etc). Search for all nodes with any tags and print the tags attribute.

Cheers,

AJ


On 12 November 2012 16:21, < " target="_blank"> > wrote:
Is there an easy/efficient way to list all the tags rather than the list of
tags for a given node(s)? I suppose I could list all the tags for all nodes and
build a unique list of those.

Apologies for this naive question because I am new to Chef and Ruby but I
failed to find an answer via on-line search of Chef documentation and the
mailing list archive. Thanks.



Please consider the environment before printing this document

 

 

NOTICE

This e-mail and any attachments are intended for the addressee(s) only and may be confidential. They may contain legally privileged or copyright material. You should not read, copy, use or disclose them without authorisation. If you are not the intended recipient please contact the sender as soon as possible by return e-mail and then please delete both messages. This notice should not be removed.

 





--
Thanks,

Mark



Archive powered by MHonArc 2.6.16.

§