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

nil value being passed to apache_module #18

Open
chaoranxie opened this issue Dec 9, 2012 · 1 comment
Open

nil value being passed to apache_module #18

chaoranxie opened this issue Dec 9, 2012 · 1 comment

Comments

@chaoranxie
Copy link

in rvm_passenger:: apache2 (https://github.com/fnichol/chef-rvm_passenger/blob/master/recipes/apache2.rb#L74)

you can see that we are using apache_module definition and passing it node['rvm_passenger']['module_path'] value which is calculated in a ruby block before.

It turns out that node attribute is nill, when the apache_module resource is constructed, which indirectly is throw a error when i try to use this recipe on centos6.

I dont know exactly how each resource is elevated and how one resource might be able to use that node attribute computed by another resource. ( if there is a blog post somewhere let me know).

I did a quick test to show the idea, ideally, in the end of the code run i should see the /tmp/test file contain the content "This is a secret" but it turns out the file contains nothing. it seems that this has to do with the order of things being run.

ruby_block "Calculate secret" do
  block do
    node.set['secret_message'] = "This is a secret"
  end
end

file "/tmp/test" do
  content "#{node['secret_message']}"
  mode 0644
end

@chaoranxie
Copy link
Author

currently i had to hack out the apache2 recipe to use following line, this is definitely not idea and i am sure it is breaking a bunch of other things.

apache_module "passenger" do
        module_path "/usr/local/rvm/gems/ruby-1.9.3-p194@passenger/gems/passenger-3.0.18/ext/apache2/mod_passenger.so"
end

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

No branches or pull requests

1 participant