Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix redis-yml instructions #261

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hibariya
Copy link

I noticed node['utility_instances'] doesn't have hostname. This is a fix for that.

`node['utility_instances']` doesn't have `hostname`.
@radamanthus radamanthus self-assigned this Apr 19, 2016
@radamanthus
Copy link
Contributor

I tried it out and I encountered the error:

NameError
---------
no member 'hostname' in struct

Cookbook Trace:
---------------
  /etc/chef-custom/recipes/cookbooks/redis-yml/recipes/default.rb:20:in `[]'
  /etc/chef-custom/recipes/cookbooks/redis-yml/recipes/default.rb:20:in `block (2 levels) in from_file'
  /etc/chef-custom/recipes/cookbooks/redis-yml/recipes/default.rb:12:in `block in from_file'
  /etc/chef-custom/recipes/cookbooks/redis-yml/recipes/default.rb:11:in `from_file'
  /etc/chef-custom/recipes/cookbooks/main/recipes/default.rb:1:in `from_file'

Relevant File Content:
----------------------
/etc/chef-custom/recipes/cookbooks/redis-yml/recipes/default.rb:

 13:          source 'redis.yml.erb'
 14:          owner node[:owner_name]
 15:          group node[:owner_name]
 16:          mode 0655
 17:          backup 0
 18:          variables({
 19:            :environment => node[:environment][:framework_env],
 20>>           :hostname => redis_instance[:hostname]
 21:          })
 22:        end
 23:      end
 24:    end
 25:  end
 26:

I had to change line 5 from:

redis_instance = node.engineyard.environment.instances.find { |instance| instance[:role] == 'util' }

to:

redis_instance = node[:engineyard][:environment][:instances].find { |instance| instance[:role] == 'util' }

and

line 20 to

hostname => redis_instance[:public_hostname]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants