#chef

Majost heh 00:01
I don't like typing two commands for something I do more than once 00:01
mxbtt I just installed chef with 'gem install chef' and upon running 'knife configure' it's saying that it can't find chef dependency "Could not find chef (>= 0)" 00:50
but I've verified that chef was indeed installed with gem. any clues as to what is going on? 00:50
http://pastebin.com/raw.php?i=BCmMzzkK 00:51
c_t looks like perhaps the gem in question was using some other ruby? 00:52
mxbtt gem env said it's using 1.9.3 as I thought 00:53
lawrenceseattle is it possible to use chef recipe language features in plugins, e.g. data_bag? 00:56
barefoot mxbtt: did you `sudo gem`? 01:01
mxbtt yes 01:02
barefoot so your rvm version wouldnt know how to find it right? 01:03
mxbtt gem env says gem path is to .rvm/gems/ruby-1.9.3-p194 which is my current ruby version 01:04
barefoot guessing, im actually curious as I dont use that or rbenv 01:04
hoover_damm fi you use rvm and you use sudo 01:04
that's your first failure 01:04
s/fi/if 01:04
so you should call fi here 01:04
and ehehe 01:04
use rvm-sudo 01:04
mxbtt tried that and same result 01:04
hoover_damm that's the whole point of the rvm-sudo wrapper 01:04
so you can sudo while keeping rvm up 01:05
mxbtt cleaned up some stuff in my $PATH and all of a sudden it works... 01:15
mhalligan is anyone else seeing problems with hosted-chef ands3? 01:57
I've been screwed for a day now 01:57
miah herp herp 01:58
yfeldblum mhalligan, if you're seeing a problem with hosted-chef, you'll probably want to email support@opscode.com, or go to help.opscode.com, since those are the places intended for support for hosted- and private-chef 01:59
mhalligan yeah they've been pretty useless so far, I was just wondering if anyone else is seeing issues 02:00
but thanks 02:01
hoover_damm not really what i would classify opscode support (being useless) 02:09
i find them to be fast on responses and very detail oriented 02:09
jtimberman mhalligan: not aware of any issues in particular myself, but someone in the support department might have more information, please email support@opscode.com and someone can check. 03:20
flaccid_ wondering if there is a nice/de facto way for deploying a mediawiki with local mysql server? 03:29
i'm assuming this would be it http://www.opscode.com/blog/2011/05/27/chef-whips-up-a-mediawiki-lamp-stack-for-you/ 03:30
http://help.opscode.com/kb/otherhelp/build-a-lamp-stack redirects to the support page :( 03:32
hmm thats ha/lb though 03:32
i think it needs link updated to http://wiki.opscode.com/display/chef/Build+a+LAMP+Stack 03:35
yfeldblum jtimberman, was one of the ops crews trying to figure out the locker problem (http://www.math.msu.edu/~nathsinc/java/Lockers/)? 03:45
jtimberman, in the data centers, using power buttons and/or ethernet cabling instead of locker doors? 03:46
jtimberman yfeldblum: hm? 03:48
flaccid_ has anyone used the application cookbook with chef-solo? 03:49
yfeldblum jtimberman, it would explain mhalligan's symptoms 03:49
flaccid_ jtimberman: do you think application cookbook with chef-solo w/ databags would work? 03:50
hi btw 03:50
yfeldblum flaccid_, the latest application cookbook no longer requires search, roles, or data bags 03:54
flaccid_ yfeldblum: oh cool, readme and wiki doc needs and update or something? 03:54
or just basically undocumented atm 03:54
yfeldblum flaccid_, readme on github looks fairly up-to-date 03:56
jtimberman flaccid_: i don't know. 03:57
flaccid_ ah yeah thanks yfeldblum its the php quick start that would be nice for an update but the readme is good 03:58
nmistry im experiencing a problem where immediately after bootstrapping a new node there are no attributes 04:09
the node is registered, client is there, but there is nothing there (runlist, attributes, etc). 04:10
is that what happens when a bootstrap fails? 04:11
yfeldblum nmistry, no new attributes in what? the node instance that you get by calling `node`? or the node instance that you get from searching the chef-server for the node? 04:16
nmistry knife node show 04:19
yfeldblum nmistry, did the bootstrap fail? 04:20
nmistry nagios recipe is bombing 04:20
shef has node.default 04:21
so there are attributes there 04:21
q[mrw] I'm using chef to manage around 200 hosts, knife status is ridiculously slow, anyone have some tips for speeding up searches? 04:24
yfeldblum nmistry, chef-client will only save the final node data to the chef-server after a successful chef-client run (which involves nothing bombing out) 04:24
nmistry ok 04:24
yea im running chef-cleint -j first-run.json 04:24
yfeldblum nmistry, if the first chef-client run, triggered during a bootstrap, fails, then yes that's what you'll see 04:24
nmistry thanks yfeldblum 04:25
yfeldblum, how can i debug this situation? 04:26
its saying that im getting back a nill object, but it should be there 04:27
can i run the recipe in shef? 04:27
yfeldblum nmistry, sort of, but i rarely use shef; maybe jtimberman has a pointer or two? 04:28
Bonkers say I have a recipe that adds a new nginx server in sites-enabled, how do I tell chef to restart nginx, or does it know somehow? 04:55
nmistry yfeldblum, found a bug that causes it to bomb http://tickets.opscode.com/browse/COOK-769 05:00
added [nagios][email] to all my users and it now works fine 05:00
BryanWB_ ohai chefs! 05:21
erikh jtimberman: you around? I'm seein gsomething awful weird with the nginx cookbook 05:48
BryanWB_ reset: around? 05:50
lysander So - I'd like it that if I have a cluster of servers, I can pick a random server in the cluster to receive a change. If the picked server disappears from the cluster, another server gets picked instead.. any ideas ? there are some cronjobs I don't want run on all cluster members. 09:23
does the chef provide an easy interface for something like that ? 09:24
vaq Hello, I just installed chef client and chef server in ubuntu 10.04, however it doesn't seem to install the knife command, what I am missing? 09:36
masterkorp vaq: how did you install the chef ? 09:38
with the chef gem ? 09:38
vaq apt-get ubuntu lucid repo 09:40
masterkorp Sorry i know nothing about ubuntu repos 09:40
<-- archlinux user 09:41
Mithrandir vaq: odd. Try running rehash or hash -r to see if that helps first, and if not, what does dpkg -L chef | grep bin/knife tell you? 09:43
vaq updatedb; locate knife didn't provide any results, I'll try install through gem 09:43
cnf do what Mithrandir said first 09:44
vaq I added the chef lucid repo and it worked. 09:58
agentgonzo Hi all - I could do with some help for getting the runtime of knife down. It uses 100% CPU for about 5-15s on loadup, then runs fine 10:18
Is there any way to stop it hammering the CPU at the start (I have no idea what it is doing) 10:18
Is it that it scans and loads plugins at this time? 10:18
'knife node list' takes about 5 seconds. 10:19
'knife cluster show <cluster>' (ironfan plugin) takes about 15 seconds 10:20
Zyclops hi 10:29
i've just started reading about chef.. i'm kinda getting the idea.. if you are only going to run 3 or 4 servers 10:29
is it still worth using chef? 10:29
also i've looked through some recipies and they seem to be much older versions (i.e. postgres 8.4 isntead of postgres 9.1 10:30
agentgonzo If you're going to launch them and leave them I'd say it's not worth doing. If you need repeatabality or do it regularly then I'd say use chef. 10:34
Adz also, if you think you might need more servers in the future. It's quite hard to capture complex hand-built systems into configuration management later 10:34
lysander so any ideas of allowing for "special" servers in a cluster, via chef ? I want one server in the cluster to have a slightly different config file for instance.. 10:35
agentgonzo The bit that differs between the 'special' one and the others needs splitting up. 10:36
Separate the two things into different roles so you have foo_master and foo_cluster 10:36
lysander but I don't want to care which server is the master - I just want chef to pick one. if that makes sense ? 10:36
if the picked server dies, chef picks another at the next run 10:37
agentgonzo There is a chef 'announce' protocol to handle things like this - but I've never used it as it seemed a bit flakeys 10:37
lysander can't seem to find anything about that agentgonzo 10:41
agentgonzo Ah - it's not in chef itself, but in the 'silverware' cookbook 10:44
Adz lysander, I have some recipes that do a search for nodes with a particular role, then do something if the name of the first host in the search matches the node name 10:44
lysander mm, that is about halfway what I'm looking for :) 10:45
I don't think this is a unique problem however. 10:48
hence my asking. 10:48
I'd like the "job" distributed and the set server stored somewhere, maybe in a bag, and if the node no longer exists, another gets elected. 10:48
agentgonzo I would have thought that failover scenario would be handled by the individual programmes rather than at the chef level 10:48
lysander random election would be good enough. 10:48
agentgonzo we use zookeeper for leader election 10:49
but may be overkill if you only need a simple case 10:49
lysander yeah, my cases are all simple. 10:49
just change the config slightly and reload the service if you get elected. 10:49
herp to the derp 10:50
zts lysander: you're right that it's not a unique problem, but neither is it one that Chef is designed to solve - it's possible to cobble something together, but nothing exists out of the box 10:57
lysander: one issue you'll need to deal with is that a node will still be returned in a Chef search even if it's down, so you'll need to write some code to validate whether the returned nodes are actually available 10:58
zoubi I've put some log in a recipe, and I can't see it when I run chef-client on my machine. What do you think could be the reason? 11:38
it's in the java cookbook, the oracle recipe 11:38
I've this http://pastebin.com/Aea5WAGJ 11:38
I have this log : http://pastebin.com/BNvBP1j8 11:39
and of course I've set -l debug parameter of chef-client 11:39
BryanWB_ zoubi: can't see ur paste, pastebin thinks it is spam 11:40
zoubi even when filling the captcha? 11:41
BryanWB_ ugh, dunno, too much work 11:43
zoubi is there anything special to do to see logs? 11:44
ashb zoubi: that's not the right log. 11:46
Chef::Log.info("foo") 11:46
zoubi ashb, what about that http://wiki.opscode.com/display/chef/Resources#Resources-Log ? 11:46
ashb huh new to me 11:47
BryanWB_ lysander: i would use the bag_config for what u r talking about 11:51
c the bag_config cookbook 11:51
zoubi ashb, using Chef::Log.info works just fine 11:55
thanks 11:55
lysander thanks BryanWB_ 12:01
BryanWB_ wish agentconzo still around, would love to ask how he is using zookeeper 12:02
geekbri Is it in poor taste to access node.chef_environment from inside of a cookbooks attributes? My gut says yes. 12:42
atomic-penguin geekbri, no, why would it be? 12:45
geekbri atomic-penguin: I don't know, just doesn't seem natural. 12:46
atomic-penguin: But I'm doing it, so I guess I wasn't that bothered by it ;) 12:47
atomic-penguin geekbri, Definitely nothing wrong about setting default attributes, based on ohai attributes. Its kind of made for that. 13:04
julien_ We use the latest version of knife, but it looks like we can't get the bootstrap script to copy the encrypted_data_bag_secret. Is there any trick for that? We obviously added it to knife.rb 13:27
:/ 13:27
julien_ Anyone? 13:34
z are there any known problems with chef-client installed via Omnibus taking a frickin' age to do anything? 13:39
dumfries julien_ what does your bootstrap script look like? 13:39
julien_ dumfries: we created one for our debian6 arch 13:40
z I see it doing literally thousands of these: 13:40
lstat("/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.12.0", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 13:40
julien_ should it be in there? 13:40
z https://gist.github.com/3090426 13:40
^ example of it taking 15 seconds just to run `chef-client -v` 13:40
dumfries julien_ if that is how you have chosen to distribute your key (on bootstrap). 13:40
julien_ dumfries: ooooh, ok, let me try to add that to our bootstrap script 13:41
dumfries: that was exactly that! Thanks a bunch mate! 13:46
z http://paste.ubuntu.com/1086184/ < seemingly why it takes 15+ seconds to do anything including display version. Any ideas how to make it behave?! 13:46
dumfries julien_ no worries, least I can do while waiting at a airport ;) 13:46
julien_ :D 13:47
julien_ Also, another question: as a matter of facts, we are starting to use chef on an existing infrastructure which brings a couple questions. For example, we use collectd. Our collected server is up and running, when setting new nodes that use collected:client, chef fails because it can't find any node that runs the server. Now, is it a problem/dangerous to try to use chef to run on an existing configuration? Would this solve our problem? 13:54
should we setup a new collected server and get rid of the old one (but then it means we have to transfer all the data). 13:54
dumfries julien_ could you not just bring your current configuration into Chef? 13:55
julien_ dumfries: I guess I could if I knew how to do so :) 13:55
dumfries well if you understand your current setup it should be straight forward no? 13:56
julien_ dumfries: what do you mean? 13:57
dumfries: here's what I'd (tell me if it's crazy): "bootstrap" chef on the existing machine, apply it the collectd-serve recipe 13:58
dumfries I mean if you understand how your current collectd server is setup what is stopping you from descibing that setup in a cookbook? 13:58
julien_ dumfries: ha, you mean creating my own cookbook. Well, I guess that would work too 13:58
indeed 13:58
dumfries If you are looking to align your current setup to what the collectd server recipe does you may have some issues, I don't know your exact setup so I am guessing here ;) 13:59
julien_ dumfries: default (apt) setup 14:00
dumfries julien_ which cookbook are you using for collectd? 14:00
julien_ but you'e right, I'll write our own cookbook, mimicking the community one, hopefully, there shouldn't be too many differences 14:00
community one 14:00
http://community.opscode.com/cookbooks/collectd 14:00
dumfries sure, one sec. 14:01
All that cookbook is doing is pulling in packages from the platform package provider (apt in your case) and setting up directories. 14:03
setting up some conf files as well. 14:03
client determines the server by looking for nodes with collectd::server in its run_list 14:04
vaq Hello, I am trying to knife bootstrap a CentOS 6.2 client from a chef server located on a Debian squeeze machine. When I run the knife bootstrap command it automatically tries to bootstrap the client through apt-get. Isn't the bootstrap command supposed to detect OS? 14:07
yfeldblum z, can you find out how much time is spent in Kernel#require? 14:09
mattray vaq: what version of Chef are you using? 14:09
vaq mattray: Chef Server (API) Version: 0.9.18 - i am using http://apt.opscode.com/ squeeze as repo. 14:10
mattray the default template for before 10.12 was the apt one, 10.12 uses the chef-full by default 14:10
yikes 14:10
vaq: if you're just getting started, switch to 10.12 asap 14:10
vaq mattray: will do, but how is it it installed an old version through your repo? 14:11
mattray vaq: the repos changed with the 0.10 release 14:11
1 sec 14:11
vaq thank you 14:11
mattray http://apt.opscode.com/dists/squeeze-0.10/ 14:11
vaq so that's the latest version? 14:11
mattray yes 14:11
vaq thanks. 14:11
z yfeldblum: Er possibly 14:16
yfeldblum z, which version of ruby? 14:16
z yfeldblum: 10.12 was installed via OMnibus 14:16
yfeldblum: so whatever Opscode shipped 14:16
'full stack' ftw 14:17
hence why all the strace output is lstat() in /opt/opscode 14:17
yfeldblum z, that does seem odd 14:27
zoubi anyone would know why my attributes keep desperatly their default values, despite I override them in the role? http://pastebin.com/Ezyy2JsS 14:58
knuckolls is the role correctly uploaded to the server? 15:04
zoubi yes 15:06
knuckolls does knife node show -l | less show that the attributes are applied to the node as you'd expect? 15:09
zoubi uh! I've typed knife role from file roles/socorro_complete.rb 15:09
and then typed: knife node show socorro_complete 15:09
but the attributes are not visible 15:09
knuckolls re run the chef-client on the node if it's not a daemon 15:10
i'm not certain that will matter 15:10
zoubi it does not, I've tried 15:10
knuckolls hm 15:11
could be buggin' 15:11
yfeldblum zoubi, in the recipe, you might try showing the merged attributes: Chef::Log.info("\n#{JSON.pretty_generate(node["socorro"].to_hash)}") 15:12
zoubi I am buggin' 15:12
knife ROLE from file, and not knife node from file 15:12
:'( 15:12
arpit I have been trying to use application cookbook for rails deployment on ec2 but getting stuck in lot of errors. If I solve one, another occurs. Readme of this cookbook contains some information about deprecated cookbooks and I guess examples are not yet changed. Is there any tutorial which I can follow for new application cookbook? 15:14
CharlieSu Hi. I'm running Chef on EC2. This specific instance is a m1.small. I'm using the latest version of Chef w/ the Omnibus installer. I'm finding that the simplest chef-client command like 'chef-client -h' is taking a long time to respond. Any thoughts? https://gist.github.com/c2e93ab7c4409dc94c5c 15:16
Is is even taking 15 seconds on a m1.large. Is it just taking a long time to load Ruby? 15:19
yfeldblum CharlieSu, ruby has made significant improvements to the performance of Kernel#require since 1.9.2 15:21
CharlieSu yfeldblum: ok? Are you saying I don't have those? 15:22
/opt/chef/embedded/bin/ruby -v 15:23
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux] 15:23
yfeldblum CharlieSu, the chef full-stack installer, i believe, installs ruby-1.9.2, but IIRC Kernel#require was improved in ruby-1.9.3 15:23
CharlieSu yfeldblum: ok i see. Guess i'll be waiting for that 15:24
hoover_damm yep 15:25
also 1.9.3 is development 1.9.2 is stable no? 15:26
it's been awhile since I cared enough so I can be wrong 15:26
knuckolls http://www.ruby-lang.org/en/news/2012/04/20/ruby-1-9-3-p194-is-released/ 15:26
hoover_damm that really doesn't answer the question 15:27
knuckolls yeah i was overzealous posting that link 15:27
i'm pretty sure it's stable 15:27
hoover_damm CharlieSu, fwiw you can update omnibus-software to use 1.9.3 15:27
CharlieSu Another question. Can chef-solo be used with a chef server? I don't want to have to package up my cookbooks. I'd like to have my server run the normal chef-client every 30 minutes for my base recipe, but I've got another recipe I want to run very often that I want to run under chef-solo so that I can havef it run frequently without affecting the runlist of the server.. 15:27
hoover_damm you'll need to add libyaml 15:27
it should work 15:27
i use full-stack with 1.9.3 15:27
but my fork is old 15:27
CharlieSu hoover_damm: i'll wait until it is official 15:27
yfeldblum hoover_damm, i do not believe that ruby uses that type of odd-unstable/even-stable system 15:30
CharlieSu hoover_damm: Understand.. :) 15:30
jperry2 anyone know of any good plugins to vim for chef? 15:30
looking for code snippets when I'm in chef 15:30
hoover_damm yfeldblum, perhaps this question is better suited for -hacking 15:30
jperry2 for example if I type cookbook_file it should give me a snippet 15:31
knuckolls hoover_damm: http://www.ruby-lang.org/en/downloads/ 15:31
The current stable version is 1.9.3. 15:31
jtimberman jperry2: ruby.vim? :) 15:33
jperry2: i'm not aware of any snippet stuff specifically for chef. 15:33
hoover_damm https://github.com/cookbooks/hw-chef-emacs-starter-kit 15:35
not really tailored for chef 15:36
but has ruby-mode 15:36
so it's a win 15:36
vaq knife bootstrap IP -i /root/.ssh/id_rsa returns: ERROR: ArgumentError: invalid option(s): keys_only 15:36
am I missing something? 15:37
arpit How can the default recipe be deprecated in application cookbook(https://github.com/opscode-cookbooks/application)? Doesn't the default recipe run before any other if I include recipe[application]? 15:38
knuckolls vaq: is that the entire bootstrap command you're running? 15:38
vaq knuckolls: knife bootstrap xxxxxxx -u root -i /root/.ssh/id_rsa -c /etc/chef/client.rb -N xxxxx 15:38
jtimberman arpit: with the new LWRPs, you don't use the recipe at all. 15:39
arpit: you write "application resources" in your own recipes for standing up your app stack 15:39
knuckolls vaq: i think you mean to use -x instead of -u 15:40
could be wrong 15:40
vaq same error. 15:40
knuckolls permissions are correct on id_rsa? 15:40
vaq Indeed it is. 15:40
jperry2 yeah I have ruby vim 15:41
arpit jtimberman I have been trying to figure it out from docs since last couple of days and tried few tutorials also but all points to some deprecated recipes. Any tutorial which uses LWRPs and deploys rails stack? 15:41
lflux jtimberman: where's more info on these new LWRPs 15:41
jperry2 I'm looking more for chef snippets in chef but I haven't found anything 15:41
mattray vaq: try "knife bootstrap xxxxxxx -VV -i /root/.ssh/id_rsa -N xxxxx" 15:41
jperry2 I amy create something for this 15:41
when it is ready I'll let folks konw 15:41
jtimberman arpit: i don't think there's any tutorials yet. 15:41
jperry2 know 15:41
jtimberman lflux: in the readmes of the respective cookbooks (application, application_ruby, etc) 15:41
mattray vaq: the root user is default, as is /etc/chef/client.rb 15:41
vaq: and -VV will add debugging 15:42
vaq mattray: /usr/lib/ruby/1.8/net/ssh.rb:155:in `start': invalid option(s): keys_only (ArgumentError) 15:42
mattray vaq: that's it? 15:42
vaq: what version of chef? 15:42
vaq 10.12.0 15:42
arpit jtimberman: Will try to follow again from README then and will let you know. Thanks. 15:42
vaq mattray: i'll pastebin, once sec. 15:42
mattray with the -VV please 15:42
vaq mattray: http://pastebin.ca/2169716 15:43
that's pastebin from -VV 15:43
lflux jtimberman: ah, thanks 15:43
vaq hmm 15:43
mattray vaq: knife -v 15:43
vaq mattray: without -i it runs without any issues 15:44
even uses the key 15:44
mattray well, that is the default key 15:44
I think -i wasn't the key for 0.9, that's why I'm wondering about the version 15:45
zoubi is it possible to use cookbook_file (or any other chef resource) to copy a set of folders (and files) to a location on the machine recursively? 15:45
jtimberman zoubi: no 15:45
zoubi: cookbook_file comes from the cookbook as the source 15:46
the only resource that "does a copy" is file with content 15:46
zoubi I don't think you did understand me 15:46
jtimberman file("/target/file") { content IO.read("/source/file") } 15:46
but you could use a symlink 15:47
with the link resource 15:47
rather than copying, which will take longer :) 15:47
zoubi in my cookbook files directory, I have a set of files I'd like to copy, say, in /tmp 15:47
instead of adding one cookbook_file entry in my recipe for each of the files which need to be copied, I'd like to tell cookbook_file to take all the files in the files folder of the cookbook, and copy them in /tmp 15:48
vaq mattray: works, thank you. 15:48
Is the right method for keeping a configuration file in sync between a client and a server a cookbook template? 15:48
jtimberman zoubi: you can use the remote_directory resource to copy files out of a directory in the cookbook. 15:49
gotta run 15:49
zoubi jtimberman, oh thanks, I didn't see this resource before 15:50
vaq I just tried to run a simple ntp cookbook on a node.. it seems to fail with a stacktrace: http://pastebin.ca/2169719 15:58
lflux I seem to have run into a situation where a service is notified in this order: restart, reload immediately. The service is only reloaded instead of restarted. 16:00
jeffg what's the prevailing phone-home interval for chef clients? 16:00
lflux shouldn't it restart instead? 16:00
mattray jeffg: 30 minutes is the default in the chef-client cookbook 16:00
lflux or does chef equate reload with restart? 16:00
jeffg mattray, thanks 16:01
jameson jtimberman: do you know if remote_file can tell if the remote file is different from the local copy (and so it should be downloaded) 16:05
lflux: I believe the reload command depends on the service itself 16:06
vaq I just tried to run a simple ntp cookbook on a node.. it seems to fail with a stacktrace: http://pastebin.ca/2169719 - FATAL: TypeError: can't convert Symbol into Integer 16:06
jameson some services equate reload to a restart, some have internal interfaces to update configurations without restarting the entire process 16:06
lflux jameson: no, as in no restart is fired 16:07
reload and restart are different for postgres. 16:07
knuckolls vaq: i ran into this yesterday and it was a problem with the name i used for my attribute. it was conflicting with an existing attribute. what is your attribute name? 16:08
vaq knuckolls: role[ntp] 16:08
lflux one file notifies a restart, another notifies a reload immediately. 16:08
knuckolls vaq: default.rb:19 what's on that line? does it use an attribute? 16:09
lflux only reload is fired. However, if I switch restart to immediately it fires as well. 16:09
vaq knuckolls: action[:enable,:start] 16:09
knuckolls hm 16:09
vaq knuckolls: http://pastebin.ca/2169722 16:10
knuckolls vaq: nothing pops out at me 16:12
vaq: it's likely something to do with the variable and the template 16:12
jameson lflux: does the logs show that a restart was queued? 16:13
vaq knuckolls: I thought that, but when I eliminate the variable, I get the same error. 16:13
knuckolls pastebin the template? 16:14
lflux jameson: if I was smart I wouldn't have cleared the terminal window with that run... 16:14
jameson :3 16:14
vaq: which ntp cookbook are you using? 16:15
vaq knuckolls: http://pastebin.ca/2169724 16:15
jameson: I created my own using an example. 16:16
knuckolls vaq: sorry i'm stumped. perhaps someone else has a good idea 16:16
jameson vaq: are you on vagrant? ec2? 16:17
and the recipe itself? 16:17
because it different from ntp, can't know what you are doing before/during line 19 that is making it fail 16:17
vaq jameson: no, client is centos 6.2, server is debian 6 16:17
I'll show you the recipe 16:18
jameson: http://pastebin.ca/2169727 16:18
lflux jameson: nope, shows no notification. 16:19
vaq jameson: am I doing something wrong? 16:22
dmerrick is it possible to use the identity_attr (aka the resource "name") inside a resource block? 16:45
like if i have 16:46
cookbook_file "/tmp/testfile" doend 16:46
can i access "/tmp/testfile" inside the block via a variable? 16:46
yfeldblum dmerrick, yes, https://github.com/opscode/chef/blob/master/chef/lib/chef/resource.rb#L319-324 16:49
dmerrick, cookbook_file("/tmp/testfile") { Chef::Log.info(name) } 16:49
jameson vaq: is there a 17:06
vaq: /etc/init.d/ntpd ? 17:06
vaq jameson: I downloaded the ntp cookbook from opscode 17:08
anyway I have one more question 17:08
if a template file is updated at the chef server, will it automatically get pushed to the client later? 17:08
jameson if there is a client daemon running 17:10
it will notice the change and update it 17:10
vaq jameson: will a knife bootstrap initialize a daemon setup? 17:10
dmerrick @yfeldblum thanks! 17:13
vaq I started chef_client with -d running as a daemon now 17:14
is it normal that it has a high cpu load? 772610 root 20 0 199m 30m 3020 S 71.5 0.1 1:27.50 chef-client 17:14
71% 17:14
doesn't seem to stabilize 17:15
jameson vaq: it should 17:18
vaq: that seems awfully high.. 17:19
so service ntpd is failing, probably because the service doesn't exist 17:19
vaq indeed it does, /etc/init.d/ntpd is there 17:20
I started the client with: chef-client -i 3600 -s 600 -d 17:20
still loading high 17:20
will try to start it with a log file append 17:21
jameson the chef-client daemon just goes to sleep after it runs 17:21
so it will have a high load initially, but it wont stay like that (shouldn't) 17:21
lflux: so there is never a message about "queuing a service :restart" message in the logs? 17:23
vaq jameson: 68%, doesn't go below that 17:23
ohh it just crashed 17:24
jameson :| 17:24
vaq jameson: http://pastebin.ca/2169746 17:24
I guess today is not my lucky day 17:24
jameson so it doesn't seem like the right way 17:26
btw, instead of writing your own, try using the ntp cookbook provided by opscode 17:26
vaq jameson: I did that 17:26
jameson and that's what it just spat out? 17:27
vaq jameson: Nope everything worked just fine, until I daemonized 17:27
I was able to bootstrap ntp without any issues 17:27
jameson vaq: use the chef-client recipe 17:28
to daemonize 17:28
vaq hmm ok 17:30
but 17:33
how would that impact the cpu load, I mean why shouldn't I be able to run the daemon that way 17:33
lflux jameson: http://tickets.opscode.com/browse/COOK-1437 17:39
nothing about queueing in the logs, but the problem was I had services further down the run that depended on the configuration change that failed, thus the whole run failed. 17:40
therefore, https://github.com/opscode-cookbooks/postgresql/pull/6/files 17:40
vaq jameson: I bootstraped my server using the client from http://community.opscode.com/cookbooks/chef-client 17:41
jameson: running as daemon now, through init. Still 70% cpu load 17:41
yfeldblum lflux, don't see how that would change anything 17:44
vaq root 813996 67.8 0.0 201612 29028 ? Sl 18:45 0:11 /opt/chef/embedded/bin/ruby /usr/bin/chef-client -d -c /etc/chef/client.rb -L /var/log/chef/client.log -P /var/run/chef/client.pid -i 1800 -s 20 17:45
lflux yfeldblum: it does. 17:45
vaq what could cause a high cpu load on a chef client? 17:46
lflux that patch fixes a very real problem for me: stock postgresql.conf in 8.4.4-PGDG rpm doesn't listen on external ip, and I have services in my run list that fail if they can't talk to pg's external IP. Templated postgresql.conf isn't picked up until postgres restarts, which doesn't happen since the services that need Pg fail the whole run. 17:47
yfeldblum: therefore, enable service, template out postgresql.conf, start postgres. 17:48
that should possibly be a restart :immediately now that I think of it. 17:48
yfeldblum lflux, why not move the entire service resource to after the template resource? 17:50
lflux yfeldblum: the service needs to be defined before the template so the template can restart it. 17:50
yfeldblum lflux, that just seems like it should reopen the first service resource and change its action attribute 17:50
lflux, `notifies :restart, "service[postgresql]"` should do the trick with the service resource declared after the template resource 17:51
Bonkers I did: knife ec2 server create ...; knife ec2 server delete ...; Now the node and client still exist, how do I recreate the server? if I do the same knife server create again, I get a 'client already exists' error 17:51
yfeldblum lflux, that's the resource query language 17:51
lflux yfeldblum: hmm, lemme try that instead. 17:52
mhalligan I'm provisioning nodes in virtualbox by bringing up clones of an image then having a script which rms /etc/chef/client and /var/cache/chef/cookbooks/* so that it registers cleanly as a new node in chef. I realize this is stupid as it makes provisioning take many minutes. Any suggestions for a better way of doing this? my image is already "caught up" before I provision it so I feel like there must be an easy way to make this 17:53
10-second process rather than having chef re-downlaod every object on the initial run 17:53
Bonkers should I not be reusing clients? 18:00
knuckolls Bonkers: i think the newest knife-ec2 knife plugin has a --purge option 18:07
to clean up the node and client objects 18:07
without it, i've always had to delete the instance, the generated client, and the node 18:08
before re-building the instance with the same node name 18:08
Bonkers I did see purge 18:09
there's no way to reuse the node data? 18:09
is that fundamentally wrong because it tracks the provisioned state? 18:09
lflux yfeldblum: technically that works, but only if the service is started. I reverted to just restarting immediately anyway. 18:10
(instead of the fancy stuff I was doing) 18:10
yfeldblum lflux, that will restart postgresql on every run 18:11
miah moin 18:11
lflux only if the template changes 18:12
er, the contents of the templated file change 18:12
yfeldblum lflux, it will restart postgresql on every run on redhat 18:13
lflux only diff was adding :immediately so it's just changing when in the run postgres is restarted 18:13
er, really? 18:13
yfeldblum lflux, ya 18:14
lflux oh yeah now I see it 18:14
ugh 18:14
yfeldblum lflux, the general pattern is: package -> template -> service, in that order 18:15
lflux there, fixed tha typo. 18:16
now it won't restart every run :) 18:16
yfeldblum lflux, unless you've got a timestamp or something in the template :P 18:16
lflux I don't :) 18:17
yfeldblum: you're probably right about that, however I'm not going to muck around with that right now as I'm patching Other People's Code. 18:17
gondoi does anyone know how I can do something like if node[:chef][:version] < "0.10.10" in a recipe? 18:23
spox if(Gem::Version.new(Chef::VERSION) < Gem::Version.new('0.10.10')) 18:23
jhulten gondoi: You can't compare the string, but you can split the string into major, minor, patch and compare those after converting to integers. 18:30
gondoi i just found version constraint can I do something like a = Chef::VersionConstraint.new(node[:chef][:version]) b = "0.10.10" if a > b 18:31
jhulten Ah. Nice. I didn't know about that. 18:33
gondoi hmm well not sure it works like I expect.... 18:35
but i hope I can use it 18:35
jtimberman: do you know if I can do something like that? 18:36
reset jtimberman: I heard you were looking for me to rebase pull#1 on MySQL's cookbook. Any news on this? https://github.com/opscode-cookbooks/mysql/pull/1 18:37
gondoi this looks interesting 18:38
>> Chef::Version.new("0.10.10") > Chef::Version.new("10.12.0") 18:38
=> false 18:38
>> Chef::Version.new("0.10.10") < Chef::Version.new("10.12.0") 18:38
=> true 18:38
cooper hello chefs. 18:55
ca 18:55
oops. 18:55
ca 18:55
can someone tell me how to use a role inside a recipe? 18:56
so like, if role == webserver then install this package or use this template? 18:56
qhartman I have templates that I need to feed a different set of instance variables depending on the circumstances of the run. I have the variables being put into a hash, and then I'm giving the hash to the template provider on the "variables" line, but it's not working. Any suggestions as how to approach this? 18:57
I'm just doing "variables my_hash" in the template block. Do I need to wrap the hash somehow? 18:58
Oh I might have just answered my own question.... 18:58
cooper never mindfound it, once again, in the wiki...Recipes#Recipes-Search 18:59
qhartman hm, nope, still getting "NoMethodError: undefined method `my_hash' for Chef::Resource::Template". Is this a scope issue? 19:00
c_t try variables :my_hash => my_hash 19:01
jhulten cooper: Why wouldn't you make that something in the runlist? Or an attribute in the role? You can do what you are asking, I am just wondering. 19:01
qhartman c_t, thanks, I'll try that 19:02
jhulten cooper: You can node.role?("my_role") 19:02
cooper jhulten: dunnoi was trying to create a cookbook that does things for one rolethen decided to make that cookbook do all the things for all the rolesjust have logic in the recipe looking for which role this node is in. make sense? 19:03
jhulten cooper: what is this for and how many different paths are there? 19:03
cooper jhulten: which is more appraisewhat you posted or 'search(:node, "attribute:value")' 19:04
what do you mean by paths? 19:04
jhulten cooper: search will go back to the server. node uses the local object. 19:04
how many roles do you need to cover in one cookbooks? 19:04
qhartman c_t, looks promising, chef-client run isn't immediately bailing anymore 19:05
cooper jhulten: helpful! :) 3 or 4 roles 19:05
c_t qhartman: it compiles, ship it! 19:05
linTest trying to install a windows package on a windows node; getting a fatal NameError: Cannot find a resource for windows_package 19:06
I've uploads the windows cookbook and the chef_handler cookbook to the chef-server 19:07
jhulten cooper: you might consider a foo::common recipe that is called by foo::role1 or foo::role2. keeps the decision logic in the run list where it is visible in three months when you have forgotten what you did... 19:08
cooper jhulten: ah. makes sense. i forgot more as time goes by :( 19:09
jperry2 If I want to store an internal rpm version number in an attribute what would be a sensible default? 19:10
if its not set it will just be nil and will pull down latest right? 19:10
jhulten I tend towards the highest visibility I can in my cookbooks because I have had to disect them late at night. 19:11
cooper jhulten: i can learn from your pain. ;) thanks. :) 19:12
linTest trying to install a windows package on a windows node; getting a fatal NameError: Cannot find a resource for windows_package 19:15
danclien linTest: did you update your cookbook's metadata.rb file with a: depends "windows"? 19:15
linTest danclien: no, I didn't know I needed to do that, thx! 19:16
danclien linTest: more info available here: http://wiki.opscode.com/display/chef/Metadata#Metadata-depends 19:17
Bonkers I put default_attributes("nginx" => {"version" => "1.2.2"}) in a role and added the role to the run_list for a node, but the nginx::source recipe still doesn't see the attribute, why? 19:32
is this generally the right strategy? 19:35
danclien Bonkers: looks right. did you verify the attributes on the role using knife? 19:40
jhulten Bonkers: Do you have more than one default_attributes statement in the role? 19:41
Bonkers danclien, yes, tried default and override, they show with knife role show and on the opscode website 19:41
nope, only one statement 19:41
jhulten Bonkers: how are you accessing the attrib in the recipie? 19:42
Bonkers and the role is getting picked up, because nginx::source is only in the run_list for this role and it's definitely trying to run, but erroring 19:42
it's not my recipe, but node[:nginx][:version] 19:42
actually, node['nginx']['version'] 19:43
it doesn't show up on the node on the opscode site, but I assume that's because the run never finished and it updates that after the run 19:44
hmm, something very strange is going on 19:45
the attribute is getting there 19:45
danclien Bonkers: what's the run_list for your node? 19:46
Bonkers ok, I figured out step #1 of the problem 19:46
well this is a bit of an obnoxious recipe 19:47
is there a way to dump all attributes as they would be generated in the next run? 19:48
amishgeek_ i seem to be locked out of my admin account in chef webui, how do i reset the admin password? 19:49
Bonkers is there debug or pretend run for chef-client? 19:49
jtimberman Bonkers: the beta for 10.14 includes "why-run" mode which is a dry-run implementation we're going to ship in the next release. 19:49
jperry2 so I have an override attribute set on a role and it's not being used 19:50
when I use that role 19:50
Bonkers jtimberman, that seems useful, should I just continue with puts debugging for now? 19:51
jperry2 nm 19:51
cg amishgeek_: try this https://github.com/mvam75/chef_ui_passwd_change/blob/master/chef_webui_password.rb 20:05
amishgeek_ thanks, that worked the set_password.rb file i had found/made wasn't working 20:08
this one looks different (the one i found was from 2010) 20:08
cg amishgeek_: np, glad it worked 20:21
barefoot is "search(:node, 'recipe:something*') valid? the search examples show wildcards but not with the recipe keyword 20:21
masterkorp http://farm4.staticflickr.com/3654/3689411471_1996f03a2a_b.jpg 20:28
ooops 20:28
hoover_damm masterkorp, you do that every day and you say oops every day 20:34
is it truly oops? 20:34
masterkorp why would i paste that in here then ? 20:34
my connection is lagging 20:34
cg its a nice looking bike though 20:35
hoover_damm masterkorp, okay reviewing my irclogs it's really only the 4th picture you pasted and 2nd oops 20:37
sorry :/ 20:37
masterkorp hoover_damm: no sorry me 20:37
but just in case 20:37
that is my bike 20:37
nice commuter 20:37
hoover_damm masterkorp, yes it's a nice bike :) 20:48
jelder quick question about using tags 21:18
miah ask questions, not permission to ask them. 21:19
yfeldblum jelder, seems to be taking quite a while to type that question; u sure it's quick? 21:20
jelder i added "mongo_backup_runner" to the tags list on one of my nodes, and i don't see how to search for it 21:20
i added "mongo_backup_runner" to the tags list 21:20
knife search node "tags:mongo_backup_runner" 21:20
returns nothing 21:20
yfeldblum jelder, that's right; u sure it's added? - try `knife node show NODE -a tags` 21:21
Guest97663 hi, we're not getting any results when searching for windows nodes by name. we don't have any issues with any linux nodes we register with the chef server. the odd thing is we see the windows nodes when running knife node list. Anyone seen this before? 21:21
jelder yfeldblum: yes 21:23
yfeldblum: my tags are visible from "knife node show NODE -a tags" but not from "tags:" 21:25
hmm, looks like it juts took opscode a while to catch up 21:26
it's visible now with the same command 21:26
miah iirc, its 'tag' not 'tags' 21:27
'knife search node 'tag:foo' 21:27
jelder tags: is now working 21:27
dunno 21:27
yfeldblum jelder, it's definitely "tags" - i use tags all the time, including searching 21:27
^ to miah as well 21:28
miah http://wiki.opscode.com/display/chef/Recipes#Recipes-Tags 21:28
yfeldblum jelder, indexing can indeed take some time; searches are always conducted against the index, never against the primary data store 21:28
jelder just have to be more patient 21:28
miah =) or speed up your indexer 21:29
jelder miah: i'm a paying customer, all i can do for now :) 21:29
miah ah i see 21:30
yfeldblum jelder, the best way to speed up the indexer is to keep sending more updates at it as fast as you can - just like you're supposed to keep refreshing the page when the site's down due to ddos 21:31
jelder great advice 21:32
i'm sure opscode's solr instances are tuned for search, not latency 21:33
jtimberman yfeldblum: :P 21:34
jelder: yeah, so, there can be a delay, up to a couple minutes, i think. i don't know the exact time frame we say is "reasonable" for indexes on OHC to get updated, though. 21:35
flaccid_ anyone ran into Application light-weight resource already initialized -- overriding! with the application cookbook? i'm trying to work out why its occuring 21:36
yfeldblum flaccid_, because you probably declared to application resources with the same name 21:37
jelder, the solr instances are one thing; the indexer is a separate process, and runs off a message queue, so it may take some time for the indexer to get the message and add the data to the solr index 21:38
jelder ah 21:38
flaccid_ yfeldblum: only 1 recipe is run which is only declaring 1 applcation resource 21:39
flaccid_ yfeldblum: or did i pebkac something? https://github.com/flaccid/cookbooks/blob/master/cookbooks/mediawiki_application/recipes/application.rb#L18 21:48
jtimberman hey chefs, just wanted to let folks know that the libraries/ruby_19_patches.rb monkeypatch is removed from the windows cookbook in v1.3.2, so this should stop wrecking non-Windows systems that pick up the cookbook as a dependency, though you'll need to download the latest windows cookbook or delete the file yourself locally. 21:59
Majost what is the difference between an attibutes file, and attributes defined in metadata.rb? 22:30
yfeldblum Majost, metadata.rb "attributes" are documentation only 22:30
Majost ah 22:30
rava greetings, has anyone a work around for using chef 10's knife bootstrap using the -i flag? 22:47
i keep getting ERROR: ArgumentError: invalid option(s): keys_only 22:47
jessicab rava: what are you trying to do with -i? for knife bootstrap its just expecting the location of your key to be sent with that 22:54
rava the identity file for ssh. i'm wrapping bootstrap process for an app that launches and controls ec2 resources 22:56
the app has it's own user it runs as specifically for this, and the knife bootsrap command entire works if i don't use -i 22:57
except for it doesn't seem to actually want to use sudo for running the template script when passed --sudo 22:58
Majost is there a document of recommended structures for databags? eg: how should one structure encrypted data bags for database passwords 23:00
stuff like that 23:00
rava Majost: it's just a k,v store with nested k,v. any structure that works for that works for your dbags. the only thing i think i would say is to structure it by environments such that you can do a search by the environment and segragate your dev test auth from dev prod 23:03
Majost ah 23:03
rava like i have mine structured so in my recipe's i do: search('auth', 'environment:#{new_reousrce.environment}') 23:09
except spelled properly 23:09
er, make that: mysql_creds = Chef::EncryptedDataBagItem.load("auth", environment, secret) . I knew that statement seemed wrong :) 23:11
rava isn't bootstrap supposed to push the encrypted data bag file when you provide the option and path in the config file knife uses for bootstrap? 23:21
i can't get that working either :/ 23:21
jessicab rava: if you dont use -i it just uses the ssh keys in your ssh agent 23:22
rava right 23:27
but the -i flag is there..and should work, but it's broken. any work arounds? 23:28
rava this ticket says it was fixed: http://tickets.opscode.com/browse/CHEF-2971 in 10.8, i'm running 10.12 23:33
JasonF rava: last comment on your link 23:34
is showing exactly your issue 23:34
rava JasonF: right, still broken. none of my hosts use password auth 23:35
JasonF :( 23:35
rava its just saying that it's broken, nothing helpful there 23:36
bootstrap doesn't seem to use sudo either when you pass the --sudo flag 23:36
the user running the bootstrap has the needed sudo access, and when i run a rendered version of the bootstrap script as that user manually using sudo, the commands work. gets permissions denied for the template execution when done through bootstrap 23:38
screw it, i'll write my own version using fabric. rest easy all. 23:40
cakehero can I install a local package file with the package resource? 23:44
I am looking at the docs right now but I feel like I'm not understanding it properly 23:44
just use "source" attribute? 23:45