fewbytes-cookbooks / redis2

Chef cookbook to install/configure redis instances
Apache License 2.0
2 stars 5 forks source link

Whyrun mode seems to be very broken #9

Open zwant opened 9 years ago

zwant commented 9 years ago

Doing a whyrun on a fresh machine with the redis2 cookbook fails in a couple of ways. First of all, node["redis2"]["version"] is set based on the output of a shell-command

shell_out("#{node["redis2"]["daemon"]} -v").stdout[/(version |v=)([0-9.]+)/,2]

that shell-command can obviously not run in whyrun mode, especially if redis hasn't been installed before. That renders an obscure error in redis.conf.erb:

<% redis_2_4 = (node["redis2"]["version"].split(".").map(&:to_i) <=> [2, 4]) < 0 %>

This will fail on the split in whyrun mode (since the string is nil).

Moreso, I tried manually setting node["redis2"]["version"] directly on the node to see what happens. That just makes it fail in a later stage when initializing the instance in runit_service[redis_master]:

Could not locate main runit sv_bin at "/sbin/sv". Did you remember to install runit before declaring a "runit_service" resource?

That could maybe be a bug in runit not properly supporting whyrun mode.

nukemberg commented 9 years ago

yes, whyrun is broken, both in redis2 and runit. i'll look into resolving the redis version attribute issue but the runit issue will have to be resolved in the runit cookbook project.