#chef

fujin lol nah not much time for bugs here man 08:02
i help out here in spare time 08:02
i work full time at Heavy Water operations with @dje 08:03
we have 5 or so clients that we do devops for 08:03
I think darrin still says we do operations for 'em 08:03
but I ship a shit load of code 08:03
neurodamage fujin: nice, good to see other folks in a similar boat, doing the same thing with a consultancy working for some clients :) 08:11
plu is there some best practice how to handle `apt-get update`? 08:17
nevermind. This seems exactly what I want: https://github.com/fnichol/chef-apt 08:22
fujin plu: that's a fork of the opscode one 08:24
plu whops 08:32
fujin: thanks, didnt notice that :) 08:32
so that's what I want, right? https://github.com/opscode/cookbooks/tree/master/apt 08:33
fujin http://ckbk.it/apt 08:35
you can follow it there and it'll email you when a new version is uploaded, etc 08:36
plu ah that's cool! Thanks, didnt know about that. Still new to the whole chef thing :) 08:46
nacer ohai 09:43
gadolin hey, Mother Internet and Father Google, did not help me, are you aware of any hyperic cookbook? 09:49
nacer gadolin: don't seem so 09:53
gadolin nacer: thx, i am getting thrilled, when thinking about hyperic, which we use, it is just overcomplex, I need to migrate to nagios one day 10:37
nacer gadolin: you can make a cookbook to, it's not that difficult 10:49
gadolin: you only want to deploy agent ? 10:49
gadolin nacer: yes, with 5 config files, at the moment we build two rpm one with standard agent and second with configuration, instead i am going to have cookbook installing default rpm, and putting config files in place. 10:50
nacer: so the cookbook fits for that purpose ideally 10:51
c64 Hi guys! 12:20
Why would File.open not work in a provider? 12:20
File.open(a, 'r') do |fh| 12:20
had an error: NoMethodError: private method `open' called for Chef::Provider::File:Class 12:20
laurent\ c64: use ::File.open 12:24
ashb c64: because File is not the File you think - what laurent\ said 12:24
c64 :: means global contect? 12:24
context? 12:24
bawt context is important 12:24
ashb yes 12:25
c64 really cool 12:26
thanks! 12:26
ranjibd Chef also has a file class 12:28
c64 ranjibd: Yeah - that makes ssense 12:29
ranjibd hence ::File to access the stdlib file class 12:29
c64? 12:29
ranjibd? 12:29
bawt ranjibd is right. somehow the nodes are now reporting their FQDN incorrectly... 12:29
ranjibd fujin? 12:29
bawt fujin is the resident git ninja and looks cute with a neck beard 12:29
ranjibd kiss? 12:29
bawt kiss is very, very much the operative sense here :) 12:29
BryanWB ranjibd: hey buddy 12:30
ranjibd whats up dude ? 12:30
BryanWB ranjibd: did u read about celluloid ? looks fascinating 12:30
ranjibd yeah 12:30
was reading about aws new offering SWF 12:30
BryanWB i still haven't gotten my head around what that is 12:31
need to read blgo post 12:32
ranjibd for what purpose you want to use it? 12:33
BryanWB celluloid? concurrency, tho i don't actually need any concurrency right now, just out of curiosity 12:33
ranjibd ok.. 12:34
BryanWB, have u used akka? in scala? 12:36
BryanWB, celluloud will let u do similar stuff on ruby.. 12:36
but it depends upon ur architecture where you want to push the scaling issue.. a variety of middle ware exists 12:37
like chef uses amqp/rabbit .. 12:37
while folks from erlang predominantly uses actors bases messaging .. 12:37
if you look at Boundary 's architecture they uses zeromq+erlang+scala ,,, 12:38
very trippy ,, 12:38
c64 Hmmm. I've run into another of these compile-time vs run-time issues.... 12:40
computing a hash on a file which is created by chef a few lines before 12:40
well, is _supposed_ to be created by chef a few lines before.... 12:41
What's the basic way to solve that? Specifically, I have a chef::user thingy which creates a user and home directory 12:42
I need to be sure that it's run before anything else 12:42
...or, equivalently, that everything else is run AFTER 12:43
ashb cna you gist the cookbook? 12:43
genreally if you want a block to run at resolve time vis compile time then you use the ruby resource 12:43
c64 "ruby block" ? 12:44
"ruby_block" ? 12:44
ashb http://wiki.opscode.com/display/chef/Resources#Resources-RubyBlock 12:44
c64 ashb: cool 12:45
That clears stuff up a bit 12:45
Last time I used a ruby_block, I called it with an action 12:47
do I NEED to call it? 12:47
or does it just run 12:47
? 12:47
BryanWB it will just run 12:47
rgsteele Is using a hash as an attribute as simple as: http://pastie.org/3431779? 13:32
ashb rgsteele: dunno- does it work? 13:37
rgsteele ashb: Still writing the guts of the cookbook, wanted to verify against the docs but didn't see what I was looking for. I'll find out when I get the first draft committed :) 13:38
ashb it probably will, but will set the entier thing or not at all 13:39
i.e. you won't get partial defaults 13:39
which might or might not be what you want 13:39
gadolin can someone advice, why its not revolving node['...'], mysqlNodes = search(:node, "chef_environment:#{node['chef_environment']} AND role:mysql")? 13:55
i issue ohai and it printed a lot information but particurarly this attribute is not set 13:58
BryanWB ranjibd: do u know maven? 14:03
zts gadolin: chef_environment isn't set by ohai, so you won't see it thee 14:06
gadolin: as a guess, try changing your search to say "roles:mysql" (roles with an s) 14:06
gadolin zts: thx, the issue is with #{node['chef_environment']}, i replcated it with node.chef_environment and seems to work 14:37
ssd7 Ohai chefs 14:58
BryanWB ssd7: good morning! 15:02
sivy coderanger: do you know anything about the cookbook here: http://community.opscode.com/cookbooks/redis 15:55
it depends on metachef, which is giving me a syntaz error 15:56
https://gist.github.com/003a44e1f2a1b1522333 15:56
Andorbal Hey all... 16:03
Does anyone have an examples of executing a powershell script (using the powershell resource) from another provider? 16:04
I'd like to use the webadministration powershell module to manage IIS instead of the appcmd command that the current iis cookbook uses because appcmd has some limitations I need to work around 16:06
dyer Is there anyone around that can help me w/ an OHAI issue I am seeing? I dont understand why a plugin seems to run multiple times 16:10
KarlHungus silverware looks awesome 16:11
atomic-penguin KarlHungus, what is silverware, yet another unsearchable Chef-related term? 16:11
KarlHungus atomic-penguin: metachef is being renamed silverware, from what i can tell 16:11
atomic-penguin: and yes its unsearchable unless youre logged into google ;) if you're like me and are logged in then ALL results are tech related 16:12
https://github.com/infochimps-labs/ironfan-pantry/tree/master/cookbooks/silverware 16:12
atomic-penguin KarlHungus, yeah, I get tech results heavily weighted in my search. Also interested in actual cooking as a hobby though. 16:14
KarlHungus oh, you're screwed, then :P 16:14
miah guh 16:14
JasonBox heh 16:16
forever adding -ruby to searches 16:16
BryanWB KarlHungus: silverware is awesome 16:20
KarlHungus BryanWB: do tell. can you share your experiences? 16:20
BryanWB KarlHungus: starting to work w/ it now 16:20
KarlHungus BryanWB: cool. i'm heading down that path also 16:21
BryanWB but am customizing the related install_from lwrp 16:21
KarlHungus i'm in a freebsd env, so i expect i'll have to do a fair amount of tweaking 16:21
BryanWB KarlHungus: u should really listen to the podcsast then where it is explained in great detail the author himself 16:21
KarlHungus BryanWB: food fight? 16:21
BryanWB yeah 16:21
KarlHungus thats what tipped me off. i red the notes, but the podcast hasnt made it to the top of my queue yet 16:22
sivy BryanWB: interesting, i ran into a metashef bug today 16:22
metachef 16:22
KarlHungus BryanWB: one thing i want to solve is how to test silverware/metachef with vagrant 16:22
BryanWB sivy: until recently, mrflip (author) was only one using those cookbooks, so m not surprised if other run into bugs 16:23
rgsteele So, if a chef template, when populated, ends up being identical in content to the actual file on the filesystem, is there any way to prevent it from replacing the file on the filesystem (or alternatively, preventing the notify action from being executed)? 16:23
sivy BryanWB: i'm trtying to use http://community.opscode.com/cookbooks/redis 16:23
which depends on metachef 16:23
BryanWB KarlHungus: u gotta listen to the podcast ;), he talks about that too w/ ironfan-ci 16:23
sivy: there is a fair amount of confusion recently w/ metachef as everything being renamed 16:23
KarlHungus BryanWB: ahh. will do. i'll contain my excitement and questions until after i've listened, then 16:24
BryanWB sorry, don't mean ltfp u 16:24
:) 16:24
KarlHungus hah, no worries 16:24
sivy heh 16:24
rgsteele Ah, apparently it won't if the hashes are the same. Good ol' RTFM. 16:25
sivy is this "old" ruby or something? 16:26
define_method(name) do |val=nil| 16:26
i'm not really a ruby guy - just enought o write my chef recipes 16:27
I'm getting a syntax err on |val=nil| 16:27
miah im really confused by what you're trying to do 16:28
sivy ah, apaprently it's "new" ruby (>1.9 only) 16:28
miah: found that in another cookbook -it's not my code 16:28
pauldale hey guys, we're getting these messages on different recipes now - any idea what might cause it? 16:35
ec2-50-19-183-222.compute-1.amazonaws.com [Wed, 22 Feb 2012 16:32:33 +0000] FATAL: NoMethodError: undefined method `[]' for nil:NilClass 16:35
thom pauldale: you'll need to post the entire backtrace to something like gist.github.com 16:36
sivy pauldale: i was getting those from [].each blocks where one of the entries in the array was not defined 16:37
pauldale https://gist.github.com/1885934 16:38
thom pauldale: and the stacktrace mentioned 16:38
pauldale I added the stack trace to the end of the same gist 16:39
sivy pauldale: yeah, i had the same exact error 16:40
what's at or around line 14 or gateway-config/recipesdefault.rb 16:40
pauldale which recipe was it? 16:41
thom pauldale: ok, so look at line 14 of gateway-config 16:41
pauldale ah 16:41
ok 16:41
thanks! 16:41
failed search 16:42
sivy it could be a lot clearer: "hey we found nothin, boss" 16:43
pauldale our fault, bad design 16:46
index reference on a search without verifying that something can back 16:46
ivy_ip = "#{ivy_nodes[0][:ipaddress]}" 16:46
Andorbal Is it even possible to immediately execute a script using a Powershell resource? Or a Bash resource, if no one here uses Powershell... 16:50
JasonBox Define immediately? 16:59
rgsteele Hm... is referencing a variable from your recipe in a definition as simple as: node[:varname]? Or is that reserved only for Ohai variables? 17:01
(Assuming you didn't pass the variable in as data to the definition) 17:01
Ah, nevermind, figured it out. 17:01
Andorbal I mean basically mirroring the behavior of popen or shell_out 17:02
mmangino I have another noob question to follow up on my one from yesterday 17:02
now that I have the basics working, I'm trying to figure out how to customize the isntallation of tomcat 17:03
Andorbal And I'd just use shell_out, but there are some niceties that the Powershell resource provides 17:03
mmangino what is the recommended way for installing it with a provided tomcat-users.xml 17:03
Is that something I would do in my own recipe? and just make mine depend on the default tomcat? 17:03
or do people fork and modify the existing tomcat cookbook? 17:03
jbz mmangino: There are various philosophies. :-) I think if you can get away with leaving a community cookbook untouched, you're better off, but that's not always possible. 17:05
ssd7 It also very much depends which part of your stack we are talking about. If it is a service that is core to your application, you should probably scrutinize the recipe and make sure it is configuring the service in a manner that fits your infrastructure. If it's installing some minor utility that you find useful to have on your servers for debugging, you can probably get away with relying a bit more on the community cookbook. 17:08
Andorbal I guess I can duplicate the pieces of the Powershell resource that provide the conveniences and then just do a shell_out... 17:15
dyer Anyone available to help me w/ a ohai plugin ? 17:24
pauldale ec2-107-22-44-250.compute-1.amazonaws.com /usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/mixin/command/unix.rb:168: [BUG] Segmentation fault 17:28
weeee 17:28
btm pauldale: http://tickets.opscode.com/browse/CHEF-2916 ? 17:42
pauldale @btm, thanks 17:49
similar 17:49
btm pauldale: poke around for segfault bugs. if there isn't a ticket with a workaround for yours, we should try to make one. 17:53
pauldale so, we were actually encountering the bug on ubuntu 11.04 17:53
they just updated this week, and now we're getting the bug 17:54
updating to 11.10 seems to have fixed the problem 17:54
Does anyone have a reference describing how you would run the chef/knife from master? 17:55
http://tickets.opscode.com/browse/CHEF-2916 says there was a fix in master 17:55
how would we actually use that? 17:55
Urocyon I'm looking at adding a bunch of tunable settings to the postgresql cookbook, similar to what the mysql cookbook has. 17:57
Have people here found the mysql tunable settings useful? Or do you do something different for mysql configuration? 17:57
miah tunable settings = useful 17:59
Urocyon anything about the mysql design you wish were different? 18:06
With regards to configuration file settings and such. 18:06
marty fujin: do you have your collectd plugins cookbook public anywhere? 19:01
ops Is there a bind/named recipe out there somewhere? I can't seem to locate a good chef repo. 19:05
indiefan still trying to grok the typical flow of chef. I installed my own chef server, using a separate machine as a client. I created a simple cookbook, uploaded that to my server, then i bootstrapped a new node (vm), then i added a recipe to that node's run_list (via knife). I have two questions: a) when will that recipe get run, i read somewhere in the docs that it's a pull not a push, so i'm assuming there is some cron or somethign? and b) will 19:09
dyer ops 19:09
I have one 19:09
Its based on the public one, but does master slave 19:09
http://dl.dropbox.com/u/177285/bind.tgz 19:11
indiefan how to i tell a node to run its run_list? or if i don't have to, where can i find a log of it trying? 19:14
hoover_damm dyer, why not on github? :) hint 19:15
dyer hoover_damm, because its not documented yet 19:15
all my changes 19:15
I plan to do a proper fork of the authors repo and then document my changes 19:15
I guess I could put it on there now w/ a caviot that all my additions are not documneted 19:16
.... 19:16
Been slammed w/ a heavy deployment, writing the cookbooks as we deploy I think they call this "hotdogging" it ;) 19:16
hoover_damm yeah i've been working with a client and fixing up recipes as I go 19:18
a lot different work flow for me, but quite interesting 19:19
dyer +1 19:20
:) 19:20
hoover_damm 22 days without chef 0.6 19:20
and counting 19:20
dyer yea, need to sort out this stupid ohai issue I am having then I will be "rainbows and unicorns" again 19:21
asg indiefan: bootstrapped chef-clients are generally run as a daemon every 30 minutes by default. The logs should be in /var/log/chef 19:21
hoover_damm yeah i've been working on the unicorn recipe, I think my next step is to fork the bluepill one and make that what I want 19:23
then convert unicorn to lwrp 19:23
(the unicorn one) 19:23
indiefan thx asg 19:25
renchap indiefan: run chef-client manually once (to register the node), then use knife or the webui to update the runlist 19:27
indiefan k 19:28
so there's no way to do it purely remotely then? 19:28
via knife? 19:28
asg indiefan: knife ssh name:foo 'whatever you need to restart the daemon'. 19:30
JasonBox hrm, does this seem like the way to obtain the hwaddr? node[:network][:interfaces][:eth0][:addresses].each {|v| v.each {|z| puts v.first if z[:family] == 'lladdr'}} 19:31
So resisting the urge to run `cat /sys/class/net/eth0/address` in my recipe 19:32
Maybe I should just give in! 19:32
Is there a more Chef way to run a shell command outside of a resource, where it'll be used in a template's variables? 19:33
geekbri Does anybody know if there is a way with the chef-client recipe to temporarily disable chef-client. Perhaps some sort of override attribute so that chef-client can be disabled? 19:34
bdha Re: Re: Re: Re: Re: Re: Re: Re 19:41
atomic-penguin New laptop 19:43
yay 19:43
Sandy bridge i7, 8Gb RAM, 512 Gb SSD 19:44
Gearbox Nice. 19:44
i5/4gb/spinning hdd for me. 19:45
atomic-penguin Last laptops we got from Dell, had some major cooling issues 19:46
mattray1 JasonBox: 1 sec 19:48
mattray stupid office wireless 19:54
JasonBox: https://github.com/opscode/cookbooks/blob/master/firewall/providers/ufw.rb Chef::Mixin::ShellOut 19:55
rbarrero Hi all 19:56
I've got a question regarding the knife ec2 plugin 19:56
wondering if I can specify a number of instances to start up 19:56
tolland im getting loads of deprecated warnings, i presume thats normal 19:57
rbarrero I can bring up a single node with the command, but I need to create many nodes and I would like to initiate that concurrently 19:57
liao HI all, has anyone seen where the cookbook file that is served is not found on the chef-server? 20:01
sivy i don't suppose infochimps is around 20:01
liao Just doing a download of a cookbook and i get this: 20:03
ERROR: Server returned error for https://chef/cookbooks/ldap/0.5.0/files/7bf484760fb07838e02625e097c481a0, retrying 1/5 in 4s 20:04
This is the same error I get on the node when I run the chef-client 20:04
wilton Hello All - Quick question about Chef::Knife::Ec2ServerCreate 20:09
Knife users fog to create a server object. 20:09
server = connection.servers.create(create_server_def) 20:09
this object is local to the run method. Is there any way of getting access to this object without changing the knife code? I try to override the method but didn't work as expected. Maybe this is more of a ruby question the chef. :-( 20:11
mdxp have a strange problem 20:43
at bootstrap time i have an error like this: "NoMethodError: undefined method `-' for nil:NilClass" on a simple erb template 20:43
if i run it the second time on the node it works fine 20:44
just the first run fails like that 20:44
anyone has any idea how to troubleshoot that? 20:44
fujin one of objects in your template is nil 20:47
use the stack trace to locae the object in question 20:47
fix the bug that caused it to become nil 20:48
check that it is not nil before you call a method on it 20:48
and yeah.. profit 20:48
mdxp thanks fujin 20:51
the template is actually just a plain file as i removed any variables 20:51
it is a simple xml file 20:51
fujin show the full debug output including the stack trace above and below the failure and the full contents of the template and the resource invocation in the recipe 20:51
and/or the contents of any attributes bound to the template with the variables parameter 20:52
mdxp sec 20:52
fujin diagnostics? 20:52
diagnostics is please show the full debug output, including the stack trace (triggered with -l debug, log_level :debug) below the failure, the contents of recipe, template, library or other affected code mentioned in the error 20:53
diagnostics? 20:53
bawt diagnostics is please show the full debug output, including the stack trace (triggered with -l debug, log_level :debug) below the failure, the contents of recipe, template, library or other affected code mentioned in the error 20:53
fujin get sick of typing that same thing like 100 times every day <3 20:53
mdxp https://gist.github.com/1887181 20:54
fujin thx 20:55
unfortunately you did not show the recipe invocation in the recipe as requested, where the bug actually is 20:55
mdxp comming 20:56
added 20:56
we removed any variables 20:56
and it still fails 20:56
what i don't get it is that if you run it the second time 20:56
it will work 20:57
only first run (at bootstrap) will fail like that 20:57
fujin k reading sec 20:58
mdxp: can you run chef with -l debug instead of letting it run in info mode? 21:02
i have a hunch that the exceptions are handled slightly differently 21:02
most importantly you should see the stack trace in line, when the resource barks 21:02
bawks 21:02
bawlkrs 21:02
bawrks 21:02
mdxp ok, i try that; thanks 21:04
gondoi i'm trying to do a begin rescue on a deploy.. basically I want to git deploy, but if it fails, to fail back to a remote_file and grab a tarball 21:04
but the rescue doesn't happen 21:04
anyone tried something like this? 21:05
hoover_damm pardon this dumb question, a deploy resource is always deploying 21:11
how can I make it only deploy if there's actual changes in master? 21:11
or am I silly? 21:11
sivy hoover_damm: there's a revision argument 21:11
jbz hoover_damm: use deploy_revision 21:11
sivy what he said 21:12
hoover_damm using the revision argument 21:12
it's tied to a revision 21:12
it just deploys the same revision over 21:12
fujin yes. it does 21:12
if that revision points to a symbolic reference on the remote, it is resolved 21:13
e.g. you can use HEAD to point to the default branch of a remote, or a tag, or a tracking branch 21:13
hoover_damm currently that's current_revision || 'HEAD' 21:13
so using HEAD would make it stop? 21:13
fujin deploy_revision, revision "master", should *only* do deploys when master is updated 21:13
hoover_damm doi 21:13
that's what I thought too 21:13
fujin HEAD tracks the default tracking branch of a remote. 21:13
hoover_damm okay pattern that was used is silly 21:14
fujin if that is "banana" it will track bananna 21:14
hoover_damm thank you fujin 21:14
:) 21:14
c_t that's a terrible bug, fugin 21:14
er 21:14
fujin 21:14
hoover_damm yeah that's what I thought, I was going bonkers trying to short circuit this because the pattern in this recipe 21:14
sucks 21:14
c_t if I want it to track "banana", it's an error to track "bananna" 21:14
hoover_damm c_t, it should track bulldog? 21:14
c_t that, I'm sure, is right out 21:15
fujin o lol 21:15
that is a typoz 21:15
lusis bug bounty email sent to the list 21:28
GET TO VOTING 21:28
Urocyon trying to earn your shirt? 21:29
mortonpe Greetings All. I am using the knife WinRm Plugin to assist in deployments. One of the interesting issues I am having is that I would like to be able to collect exit codes of the processes and evaluate them for errors before moving to the next step. Can I do this easily, does the ssh plugin have this capability? 21:30
lusis heck yeah 21:30
cwj lusis: CHEF-2336, go! 21:36
lusis holy hell that's an old one 21:37
and shit, I think I got bit by that one too 21:37
gmcinnes so, it turns out I"m not on the list. Is the bounty published anywhere else? 21:39
lusis I can link to the email 21:39
gmcinnes yes pls. 21:39
lusis http://lists.opscode.com/sympa/arc/chef/2012-02/msg00342.html 21:40
cwj i think its more of a penance than a bounty 21:40
lusis hahaha 21:43
c_t what shirt is this now? 21:46
lusis http://a.yfrog.com/img739/8393/43kdrj.jpg 21:48
flagg0204 is there a way to do a conditional run list in a role? e.g. i have centos and debian servers. id like to use the yum and apt cookbooks but obviously i dont want to run apt on a centos box 21:49
can you do things like if node[platform] recipe[apt] 21:49
lusis yeah, you'll end up like 50 pounds overweight if you do 21:49
;) 21:49
flagg0204 damn 21:50
chip_ so this is fun. I accidentally my knife boostrap and now I have a host named "-N" 21:50
any idea how to make knife parse that name? Escaping, quotes, etc. aren't helping. 21:50
lusis flagg0204: case statements =/ 21:50
flagg0204: case node.platform 21:50
flagg0204 lusis - case statement within a role definitioon? 21:50
or within the recipe 21:50
lusis recipe 21:51
btm flagg0204: check out the default recipe in the apache cookbook for a few examples http://community.opscode.com/cookbooks/apache2/source 21:51
flagg0204 bah 21:51
lusis though roles can be ruby 21:51
c_t chip: try -- 21:51
lusis iirc 21:51
I've always done json 21:51
c_t like knife node edit -- -N or something 21:51
chip_ c_t: Nice! That worked. 21:51
c_t huzzah! 21:51
chip_ Also I got to use "I accidentally" today in a sentence. It's a good day. 21:52
rbarrero is it possible for a recipe to only run on first boot? 21:54
lusis rbarrero: yes if you remove it from the runlist in a recipe 21:55
jbz rbarrero: It's possible to have a recipe remove itself from the runlist when it's finished. 21:55
what lusis said :-) 21:55
lusis recipe[myapp::bootstrap] 21:56
plus this 21:56
one sec 21:56
https://gist.github.com/280c0fbc19364a1781e0' 21:57
rbarrero I see, what about an IF clause in an recipe 21:57
lusis er 21:57
rbarrero ? 21:57
lusis https://gist.github.com/280c0fbc19364a1781e0 21:57
grrr my paste was bad too 21:57
that should be a ruby_block obviously 21:57
FYI I can't recall now where I originally saw that trick 21:58
but someone else did it first ;) 21:58
rbarrero makes sense 22:00
last question... I need to bring up 10 nodes at once using knife-ec2 22:00
the command doesn't appear to have a parameter to do so 22:00
it's just a single node each time I run it 22:01
AntonZ hello, is anyone aware of a timezone cookbook for centos/redhat ? 22:01
rbarrero anybody know a work-around? Or if I'm missing something? 22:01
lusis for loop =/ 22:01
or 10 terminals ;) 22:01
cwj or call knife plugins from a ruby script? never tried that 22:02
lusis that or you could even do a knife script I suppose 22:03
thbishop rbarrero: gnu parallel? http://www.gnu.org/software/parallel/ 22:03
lusis that too 22:10
matti Nah ;p 22:11
Thread.new in loop ;p 22:11
lusis hahaha 22:11
matti :> 22:11
lusis overengineering ftw 22:11
matti ;p 22:12
No true ;p 22:12
I bet that parallel has more switches that you have to read about. 22:12
Typic small one-liner with Thread.new is simpler! 22:12
;p 22:12
Simples. 22:12
;d 22:12
[ me is just silly ] 22:13
fujin just use a bash for loop lol 22:14
matti Its not web scale! 22:14
;p 22:14
fujin use a node for loop then 22:14
10,000 nodes per second 22:14
rbarrero so 10 terminals won't do because I may need 30 servers created 22:16
I'm not opening 30 terminals :) 22:16
matti LOL 22:16
rbarrero: Abuse Terminator ;] 22:16
fujin tmux lol 22:16
matti rbarrero: You can abuse its bradcasting abilities ;p 22:16
broadcasting* 22:16
flagg0204 btm thanks will take a look 22:17
rbarrero another note, is that knife-ec2 only has a single name as an argument 22:17
there is no auto-incrementing node names 22:17
maybe for-loop it is 22:17
fujin lol 22:17
just don't set the node name 22:17
use instnace ids or some shit 22:17
rbarrero each node takes between 3-7m to come online 22:18
for 30 machines, that's a long time to scale up 22:18
fujin if you really need to do this stuff all the time, don't use knife-ec2 to do it 22:18
use metadata based bootstrap 22:18
or cook images with chef prebaked ready to deploy 22:18
[automatically] 22:18
rbarrero fujin: done that 22:18
but don't know about metadata based bootstrap 22:19
how's that done 22:19
fujin metadata based bootstrap is cool cause you can just go yo give me 1000 22:19
and they'll all run the user-data script 22:19
installing chef, register to the org, blha blha, run chef 22:19
rbarrero yeah, my images already have chef-client pre-baked 22:19
fujin so you just need the smart client.rb 22:19
that reads config out of user data 22:19
definitely the fastest way to bootstrap it hink 22:20
no ssh involved, no workstations 22:20
just machines ready to roll 22:20
Brad_K rbarrero: cluster-chef? 22:20
rbarrero is there some doc on this metadata based bootstrap, I need to understand it more 22:21
senthilr Brad_K: cluster-chef - is that from infochimps 22:21
Brad_K senthilr: indeed. 22:22
senthilr have you used it 22:22
I saw a demo of it 22:22
looks pretty cool 22:22
Brad_K it's AWS only, from what i can tell. i haven't used it myself, because we're a rackspace shop. 22:22
senthilr k 22:22
Brad_K but it does seem like exactly the kind of tool you'd want to use for bringing up a bunch of machines at once. 22:23
rbarrero I'll check it out 22:26
FYI: ClusterChef is now Ironfan 22:28
senthilr what 22:28
really ? 22:28
rbarrero but from the initial reading, it's exactly what I'm looking for... 22:28
https://github.com/infochimps/cluster_chef/tree/version_3 22:28
https://github.com/infochimps-labs/ironfan 22:28
gmcinnes International Registry of Fetal Anomolies 22:28
I'm scared to look. 22:28
fujin something in my mind was turning that into 'ironpan' when I was thinking about it yesterday 22:30
which made more Chef sense. 22:30
so yeah, go rename k thx 22:30
rbarrero: https://help.ubuntu.com/community/CloudInit 22:31
rbarrero: if you're using ubu, that is, cloudinit supports Chef 22:31
http://allanfeid.com/content/using-amazons-cloudformation-cloud-init-chef-and-fog-automate-infrastructure 22:31
jdeamattson Opscode folks - what is your order of platform support (i.e. what is likely to be best supported through what is the most likely to be poorly supported). Would like to know this as we consider future platform support. 22:34
fujin i dont' work for opscode but ubuntu has always been the primary focus 22:35
i think that is probably closely followed by Windows these days 22:36
rbarrero we use centos 22:39
xuru Could someone help me with a definition? http://pastebin.com/vrrrtXz4 When ever I invoke it, "t" is always nil 22:46
j-v-e hello gentlemen 22:48
I have a nested attributes question 22:48
how do I do this in a template ? : <% node[:ossec].each do |ip|-%> 22:48
the whole structure goes node[:ossec][:ipaddress][:id] etc... 22:49
fujin what do you mean how do you do it? 22:49
j-v-e I want to iterate throught the many ip addresses, but this returns and empty array 22:49
fujin you posted the exact code to do it. 22:49
j-v-e: what does 'knife node show <foo> -a ossec' show ? 22:50
j-v-e http://pastebin.com/RCL1aq5Q <= that's the chef log 22:50
http://pastebin.com/hkfmf7iR <== that's the ossec attributes 22:51
ha 22:52
I'm iterating throught values that shouldn't be there probably ! 22:52
fujin oh 22:54
each yields the object that you specify bro 22:54
node[:ossec].each { |ossec| ossec[:ipaddress][:id] } 22:54
Urocyon I wanted to squash some postgres cookbook bugs, but so far haven't been able to duplicate the ubuntu related ones. :-( 22:58
j-v-e fujin: that's not going to work 23:03
fujin whatchu talkin bout thats not going to work 23:03
j-v-e ossec[:ipaddress] doesn't exist, it would be ossec[12.13.14.15] that contains my data 23:04
and ossec[13.14.15.16] etc... 23:04
fujin oh 23:04
misread your data structure 23:04
you want something like: 23:04
j-v-e so I have node[:ossec] that contains a list of random IP that I want to iterate through 23:04
fujin node[:ossec].each do { |ipaddress,options| .. } 23:04
yield the key and value to the block 23:05
then it will be options["id"] etc. 23:06
j-v-e: that make sense? 23:06
j-v-e fujin: it does, I'm trying that now 23:06
no luck :( It's not failing but the file ends up empty, as if the loop didn't return any data 23:10
http://pastebin.com/N5H0Gsjj 23:10
fujin you want <%= not <% 23:17
<% foo %> doesn't print anyting, just runs the code 23:17
<%= foo %> prints val of foo 23:17
templates? 23:18
bawt templates is http://wiki.opscode.com/display/chef/Templates 23:18
fujin just_enough_ruby? 23:18
maybe not 23:18
j-v-e oh crap. good catch ! I modified that template so many times that I missed that one ! thanks a lot ! 23:20
I have the just enough ruby in front of me, but unfortunately iterating through lists and map and each and stuff like that is a bit more of ruby dark magic to me 23:20
need to spend more time using ruby I guess :) 23:21
It works now, thanks for your help 23:21
fujin just_enough_ruby is http://wiki.opscode.com/display/chef/Just+Enough+Ruby+for+Chef 23:22
j-v-e: maybe give that a read 23:22
http://ruby-doc.org/core-1.9.3/Enumerable.html 23:22
annnd.. Erubis! http://www.kuwata-lab.com/erubis/ 23:22
erubis is http://www.kuwata-lab.com/erubis/ 23:22
erb is http://www.kuwata-lab.com/erubis/ 23:22
erb 23:22
erb? 23:22
bawt erb is http://www.kuwata-lab.com/erubis/ 23:22
fujin cool. 23:22
know bawt knows too =_= 23:23
now** 23:23
maek when doing knife node search if I want to get at the number for cores its [:cpu][:cores] is there a way I can ask -a for that ? 23:23
AntonZ what a good way to change time zone during instance boot up ? 23:23
j-v-e fujin: thanks, will read. I was in the ruby doc earlier but it's a bit dry for a beginner :/ 23:25
rbarrero quick question 23:27
I'm writing a recipe, but I need the IP address of the node 23:28
maek let me re phrase that. If I want to access just a nested attribute from knife node search using -a can I do that? 23:28
fujin makuk66: -a foo.bar.boz 23:28
maek fujin: im getting nothing on cpu.cores 23:28
fujin AntonZ: always use UTC, profit 23:28
rbarrero ip_address = attribute?('cloud') ? cloud['local_ipv4'] : ipaddress 23:28
is that valid in a recipe file? 23:28
fujin i have a lib for this rbarrero stand by 23:28
rbarrero I want to use it later like this #{ip_address} 23:28
fujin https://github.com/fujin/chef-discovery/blob/master/libraries/ipaddress.rb#L14 23:29
documented in the readme 23:29
rbarrero k 23:29
fujin but no, that is not a valid recipe file 23:29
you could say: 23:29
ip_address = node.attribute? "cloud" ? node['cloud']['local_ipv4'] : node['ipaddress'] 23:29
and that would be valid in a recipe 23:29
but the form you gave, w/ omitting 'node', is only valid for attribute files 23:29
not for recipe files 23:30
HTH 23:30
rbarrero ah 23:30
fujin maek: the attribute is not cpu.cores 23:31
maek fujin: just realzing that. thanks and sorry 23:31
fujin rbarrero: my lib uses a pref system to return the local ipv4 when the node and local node share cloud provider 23:32
e.g. if you have two nodes on rackspace and you want to get the ipaddress out of a target node, it'll auto grab the local ipv4 23:32
you can hardcode it to be public ipv4 of course 23:32
rbarrero cool, let me see if I can mke that work 23:34
fujin https://github.com/fujin/chef-discovery/blob/master/readme.md 23:35
j-v-e is there a fundamental difference between using node.ipaddress and node[:ipaddress] ? 23:39
maek fujin: since its cpu.NUMBER.cores is it possible to do something like cpu.*.cores ? cpu.*.cores doesnt work fwiw 23:39
fujin why not use cpu.real 23:39
or cpu.total 23:39
cpu.total includes all of the cores 23:39
rbarrero ip_address = Discovery.ipaddress(:remote_node => host, :node => node, :type => :local 23:40
maek fujin: guess im blind. didnt see those options. thank you 23:40
rbarrero your ipaddress.rb library will be included automatically? 23:40
maek last stupid question. can I ask for 2 attributes somehow? 23:40
rbarrero sorry for the stupid question, is there an include function I need in the recipe? 23:40
fujin rbarrero: oh, its automatic 23:45
rbarrero: if you have it as a dependency on a cookbook 23:45