I'm trying to get the rvm_passeneger recipe to work, I seem to having problems with the order of execution and variable/attribute scope.
The ruby block on line 35 executes after the apache_module LWRP request on line 73.
As I understand it when you have multiple recipes, all of the 'similar tasks' in this case 'apache_module' are converged from all of the run_list recipes at 'compilation time'. In my case I only have one recipe, rvm_passenger, but it includes 'apache2' and 'rvm'.
Looking at the debug logs the standard apache modules are installed at the same time as the additional passenger module. However, in my case, the ruby block defined on line 35 of the above recipe needs to run first because the configuration for the module is dependent on the value of an attribute defined inside the block.
I've tested this by hard-coding the value I need in to line 74; this works great but isn't a long term solution.
Can anyone help me out with this, I see it as two problems:
1) I need to get this recipe working as intended 2) I need to understand why this behaviour occurs, I'm new to Ruby and Chef and the recipes order of execution is extremely confusing to me, surely I must be able chain events in order to get around this problem?