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

Change the rabbitmq config file path via cookbook will not take effect #157

Closed
gekun0216 opened this issue Nov 4, 2014 · 8 comments
Closed

Comments

@gekun0216
Copy link

We have a requirement to change the rabbitmq config file to a non-default path, but seems there is a potential problem in the current cookbook which prevents us from doing this.

We know there is an attribute in the cookbook:
"rabbitmq.config" which could be used to specify a non-default path of the rabbitmq config file from our perspective. Refer to the following code:
https://github.com/kennonkwok/rabbitmq/blob/master/attributes/default.rb#L19

But the config file path generated by the template resource in recipes/default.rb and the one specified in the templates/default/rabbitmq-env.conf.erb are not consistent, which results in that the config file won't take effect when rabbitmq-server starts.
Refer to the following code:
https://github.com/kennonkwok/rabbitmq/blob/master/recipes/default.rb#L157
https://github.com/kennonkwok/rabbitmq/blob/master/templates/default/rabbitmq-env.conf.erb#L18

Let's take an example to make this clearer: We cannot override attribute of "rabbitmq.config_root", which is "/etc/rabbitmq" in RHEL 6.5 in our case, since the path of file rabbitmq-env.conf cannot be changed per Operating System distribution. We can only change the rabbitmq.config to another path, say "/etc/rabbitmq/alternative/rabbitmq".

Here comes the problem: Since the file generated by the template resource in recipes/default.rb locates at "/etc/rabbitmq/rabbitmq.confg", but the one specified in "/etc/rabbitmq/rabbitmq-env.conf" will be "/etc/rabbitmq/alternative/rabbitmq". So the rabbitmq-server cannot find the config file at "/etc/rabbitmq/alternative/rabbitmq.config" when it starts, hence all the configuration will be missed.

BTW: A quick solution could be to change the following line:
https://github.com/kennonkwok/rabbitmq/blob/master/recipes/default.rb#L157
to be:
template "#{node['rabbitmq']['config']}.config" do

Please help to evaluate this potential problem, Hope it can be fixed early once it is confirmed to be a real issue.

@gekun0216 gekun0216 changed the title Cannot change the rabbitmq config file path via cookbook Change the rabbitmq config file path via cookbook will not take effect Nov 4, 2014
@gekun0216
Copy link
Author

Michael Klishin, could you please drop a message for this issue? Thanks.

@michaelklishin
Copy link
Member

@gekun0216 what do you expect me to do? I'm not a collaborator on this repo. If you have a solution in mind, your chances are greatly increased by submitting a pull request.

@gekun0216
Copy link
Author

@michaelklishin, thanks for reminding, I will try to submit a pull request.

@jjasghar
Copy link
Contributor

Was this PR ever submitted?

wenchma pushed a commit to wenchma/rabbitmq that referenced this issue Dec 15, 2014
wenchma pushed a commit to wenchma/rabbitmq that referenced this issue Dec 15, 2014
@wenchma
Copy link
Contributor

wenchma commented Dec 15, 2014

I have summitted this PR, #184
Any comment is welcomed!

wenchma pushed a commit to wenchma/rabbitmq that referenced this issue Dec 17, 2014
wenchma pushed a commit to wenchma/rabbitmq that referenced this issue Dec 17, 2014
wenchma pushed a commit to wenchma/rabbitmq that referenced this issue Dec 18, 2014
@stevecstian
Copy link

@jjasghar @wenchma I thought github will close this automatically when #184 got merged...

@jjasghar
Copy link
Contributor

Nope 😢 I'll do it now.

@stevecstian
Copy link

Ahhh, the magic keywords should be something like This fixed #157 ...

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

5 participants