atomic-penguin / cookbook-gitlab-deprecated

Gitlab cookbook
128 stars 84 forks source link

Not workin with redisio > 1.7.1 #83

Closed 8la closed 9 years ago

8la commented 9 years ago

Whe i try to test with kitchen ubuntu 12.04 it doesnt works with redisio > 1.7.1

================================================================================       
Recipe Compile Error in /tmp/kitchen/cookbooks/gitlab/recipes/default.rb       
================================================================================       

NoMethodError       
-------------       
undefined method `each' for nil:NilClass       

Cookbook Trace:       
---------------       
  /tmp/kitchen/cookbooks/redisio/recipes/enable.rb:23:in `from_file'       
  /tmp/kitchen/cookbooks/gitlab/recipes/default.rb:40:in `block in from_file'       
  /tmp/kitchen/cookbooks/gitlab/recipes/default.rb:39:in `each'       
  /tmp/kitchen/cookbooks/gitlab/recipes/default.rb:39:in `from_file'       

Relevant File Content:       
----------------------       
/tmp/kitchen/cookbooks/redisio/recipes/enable.rb:       

 16:  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.       
 17:  # See the License for the specific language governing permissions and       
 18:  # limitations under the License.       
        19:  #
        20:  
        21:  redis = node['redisio']
        22:  
        23>> redis['servers'].each do |current_server|
        24:    server_name = current_server["name"] || current_server["port"]
        25:    resource = resources("service[redis#{server_name}]")
        26:    resource.action Array(resource.action)
        27:    resource.action << :start
        28:    resource.action << :enable
        29:  end
        30:  

       [2014-11-11T13:18:54+00:00] ERROR: Running exception handlers

[2014-11-11T13:18:54+00:00] ERROR: Exception handlers complete       
       [2014-11-11T13:18:54+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out

Chef Client failed. 0 resources updated       
[2014-11-11T13:18:54+00:00] ERROR: undefined method `each' for nil:NilClass       
[2014-11-11T13:18:54+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Like a charm with redisio 1.7.1

8la commented 9 years ago

Think we have to set redis.servers attribute explicitly on gitlab cookbook.

https://github.com/brianbianco/redisio/blob/b1707226879de5560de650c2ddce780297fe35d7/README.md#install-redis-give-the-instance-a-name-and-use-a-unix-socket

8la commented 9 years ago

Easy fix: include redisio::default instead of redisio::install will do a pr.