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

Add HWRPs for installing and managing consul. #126

Merged
merged 22 commits into from
Jul 25, 2015
Merged

Add HWRPs for installing and managing consul. #126

merged 22 commits into from
Jul 25, 2015

Conversation

johnbellone
Copy link
Contributor

I am channeling @someara and @reset here.

After taking a look at the new httpd library cookbook as well
as the Mysql library cookbook I think this is an excellent example
of using HWRP for defining the building blocks of a quality cookbook.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.86%) to 97.14% when pulling 41eee88 on develop into 57b4105 on master.

@reset
Copy link
Contributor

reset commented Feb 8, 2015

@johnbellone excellent work man! I really like having the ability to swap service providers for the service resource. That'll let people implement and test whatever service startup tool they use (runit, systemd, etc). Comment here again when it's finished and I'll take another look ;)

action :create do
include_recipe 'golang::default'

directory File.join(node['go']['gopath'], 'src/github.com/hashicorp') do

This comment was marked as outdated.

@someara
Copy link

someara commented Feb 8, 2015

This is great. I'm so happy to see people copying this pattern.

+100.

On Sun, Feb 8, 2015 at 4:39 PM, Jamie Winsor notifications@github.com
wrote:

@johnbellone https://github.com/johnbellone excellent work man! I
really like having the ability to swap service providers for the service
resource. That'll let people implement and test whatever service startup
tool they use (runit, systemd, etc). Comment here again when it's finished
and I'll take another look ;)


Reply to this email directly or view it on GitHub
#126 (comment)
.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.86%) to 97.14% when pulling ad41f68 on develop into 57b4105 on master.

@johnbellone johnbellone self-assigned this Feb 9, 2015
@johnbellone johnbellone added this to the Road to 1.0.0 milestone Feb 9, 2015
@coveralls
Copy link

Coverage Status

Coverage decreased (-2.86%) to 97.14% when pulling 14c3bc7 on develop into 57b4105 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.86%) to 97.14% when pulling 31ed5ac on develop into 57b4105 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.86%) to 97.14% when pulling 31ed5ac on develop into 57b4105 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.86%) to 97.14% when pulling d8ba236 on develop into 57b4105 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.86%) to 97.14% when pulling 6387c6d on develop into 57b4105 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.86%) to 97.14% when pulling 6387c6d on develop into 57b4105 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.86%) to 97.14% when pulling 6387c6d on develop into 57b4105 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.86%) to 97.14% when pulling 11adc9c on develop into 57b4105 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 5b8b84c on develop into 57b4105 on master.

@fujin
Copy link

fujin commented Mar 9, 2015

hey there, tried to give this a test, but getting:

* consul_client[/opt/consul/0.4.1] action create (up to date)


           ================================================================================
           Error executing action `create` on resource 'consul_config[/etc/consul.d/default.json]'
           ================================================================================

           NoMethodError
           -------------
           undefined method `parsed_run_user' for Chef::Resource::Directory

           Cookbook Trace:
           ---------------
           /tmp/kitchen/cache/cookbooks/consul/libraries/provider_consul_config.rb:20:in `block (2 levels) in <class:ConsulConfig>'
           /tmp/kitchen/cache/cookbooks/consul/libraries/provider_consul_config.rb:19:in `block in <class:ConsulConfig>'

           Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cache/cookbooks/consul/recipes/default.rb

            18: config = consul_config File.join(node['consul']['config_dir'], 'default.json') do
            19:   run_user client.run_user
            20:   run_group client.run_group
            21: end
            22: 

           Compiled Resource:
           ------------------
           # Declared in /tmp/kitchen/cache/cookbooks/consul/recipes/default.rb:18:in `from_file'

           consul_config("/etc/consul.d/default.json") do
             action :create
             retries 0
             retry_delay 2
             default_guard_interpreter :default
             declared_type :consul_config
             cookbook_name "consul"
             recipe_name "default"
             run_user "consul"
             run_group "consul"
             path "/etc/consul.d/default.json"
           end

       [2015-03-09T20:46:36+00:00] ERROR: Converge failed with error message consul_config[/etc/consul.d/default.json] (consul::default line 18) had an error: NoMethodError: undefined method `parsed_run_user' for Chef::Resource::Directory

I looked into it and it would appear that the directory resource being used in consul_config is trying to use a class method from ConsulCookbook::Helpers, parsed_run_user. I see in some previous commits there was a change from run_user to service_user, and I wonder if this has just not been updated yet.

directory: https://github.com/johnbellone/consul-cookbook/blob/develop/libraries/provider_consul_config.rb#L20-L21
helper methods: https://github.com/johnbellone/consul-cookbook/blob/develop/libraries/helpers.rb#L13-L21

thanks in advance for any thoughts, let me know if I can help in anyway.

@johnbellone
Copy link
Contributor Author

@fujin I have a whole bunch of commits I need to push. Apologies. They'll be coming in a few minutes.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 09ad7ad on develop into 5208d86 on master.

@johnbellone
Copy link
Contributor Author

I need to tear into this now that I am back from vacation. I'll see if I get some time to hack on it this evening.

@johnbellone
Copy link
Contributor Author

This has become a beastly set of changes, but I am nearing completion. I need to open source a cookbook from work prior to release and thorough testing.

@johnbellone johnbellone force-pushed the develop branch 2 times, most recently from 7a79ab5 to 2ec492a Compare June 13, 2015 16:48
@johnbellone johnbellone changed the title WIP: Add HWRPs for installing and managing consul. Add HWRPs for installing and managing consul. Jun 13, 2015
@johnbellone
Copy link
Contributor Author

/cc @reset @someara

This is ready for review and merging.

John Bellone and others added 21 commits July 24, 2015 23:39
@coderanger pointed out a few things that I could spruce up.
It seems that some people really dig runit. I don't get all the
hype. But here it is courtesy of @coderanger.
The way that this cookbook is intended to work is for it to be included
in a [base cookbook][0] or an [environment cookbook][1] so that the
whole infrastructure built with poise-service uses runit.

[0]: http://blog.vialstudios.com/the-environment-cookbook-pattern/#thebasecookbook
[1]: http://blog.vialstudios.com/the-environment-cookbook-pattern/#theenvironmentcookbook
In all of RedHat's infinite wisdom it seems that upstart is available on
EL6.6. The poise-service library cookbook we use defaults to that so we
need to conver that test case in our integration tests.
This ensures that we can check for idempotence by simply using the
normal Chef means. Its actually a hell of a lot better than querying
Consul and doing some insane magic in the background.
johnbellone added a commit that referenced this pull request Jul 25, 2015
Add HWRPs for installing and managing consul.
@johnbellone johnbellone merged commit da91b27 into master Jul 25, 2015
@johnbellone johnbellone deleted the develop branch July 25, 2015 03:42
@johnbellone johnbellone restored the develop branch July 25, 2015 03:42
@johnbellone johnbellone deleted the develop branch July 25, 2015 03:42
@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants