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

Allow the service to be manually managed #281

Merged
merged 4 commits into from Jul 17, 2015

Conversation

Projects
None yet
2 participants
@joshgarnett
Copy link

commented Jul 6, 2015

There are cases where you may want to install rabbitmq, but not start the service immediately. For instance, when preparing an AMI for AWS, you may want to install all of the software and then when launching the instance only do the configuration. It is also useful when you want to use systemd instead of the default initd scripts.

@jjasghar

This comment has been minimized.

Copy link
Collaborator

commented Jul 7, 2015

Can you update the chefspec to check for this also? It would be nice to have one check for it on, and one check for it off.

I'm planning on releasing another version of the rabbitmq cookbook this by end of week and i'd like this in it.

@joshgarnett

This comment has been minimized.

Copy link
Author

commented Jul 10, 2015

Sorry for the delay, I'm looking into this now.

@joshgarnett

This comment has been minimized.

Copy link
Author

commented Jul 10, 2015

@jjasghar I've just added some tests, this is my first time messing around with kitchen/spec, but I've confirmed it works locally. Let me know if any other changes are required or if what I did was not idiomatic. Thanks!

@jjasghar

This comment has been minimized.

Copy link
Collaborator

commented Jul 10, 2015

Awesome, thanks!

expect(chef_run).to start_service('rabbitmq-server')
end

it 'does not enable a rabbitmq service when manage_service is false' do
node.set['rabbitmq']['manage_service'] = true

This comment has been minimized.

Copy link
@jjasghar

jjasghar Jul 10, 2015

Collaborator

shouldnt this be false?

end

it 'does not start a rabbitmq service when manage_service is false' do
node.set['rabbitmq']['manage_service'] = true

This comment has been minimized.

Copy link
@jjasghar

jjasghar Jul 10, 2015

Collaborator

shouldnt this be false?

This comment has been minimized.

Copy link
@joshgarnett

joshgarnett Jul 10, 2015

Author

Yeah, I just noticed that after commenting, fix is pushed

@jjasghar jjasghar removed the needs tests label Jul 10, 2015

Joshua Garnett
@joshgarnett

This comment has been minimized.

Copy link
Author

commented Jul 10, 2015

I suspect I've done something wrong with the tests, when I just have the following test, which should error out, it still passes:

  it 'does not enable a rabbitmq service when manage_service is false' do
    node.set['rabbitmq']['manage_service'] = true
    expect(chef_run).not_to enable_service('rabbitmq-server')
  end

Output

$ kitchen test default-ubuntu-1404

...

       Finished in 0.69908 seconds
       15 examples, 0 failures
       Finished verifying <default-ubuntu-1404> (0m59.66s).
@jjasghar

This comment has been minimized.

Copy link
Collaborator

commented Jul 10, 2015

Ah, tk, runs the integration tests, you need to run chefspec which is easiest ran by: rake spec in the main directory.

@joshgarnett

This comment has been minimized.

Copy link
Author

commented Jul 10, 2015

@jjasghar Thanks for the help. I had read the CONTRIBUTING.md file and completely missed the TESTING.md file. Everything should be working now. I'm going to have to read up on chefspec.

@jjasghar jjasghar merged commit 3ead3cf into rabbitmq:master Jul 17, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.