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 to configure consul_service behavior through attributes #316

Closed

Conversation

kamaradclimber
Copy link
Contributor

@kamaradclimber kamaradclimber commented May 20, 2016

Fix #314

@johnbellone
Copy link
Contributor

I want to rope in @coderanger to this discussion (as well as #314).

We have a lot of cookbooks that follow the pattern of implementing PoiseService::ServiceMixin as a custom resource, what's the best way to override service options like @kamaradclimber given that we set some defaults in #service_options?

@johnbellone
Copy link
Contributor

Just for my thoughts:

I've been actually leaning a way from having a separate resource for service instances and instead using poise_service directly where possible. The only caveat here is Windows, and I think that we can create a poise-service provider for nssm to be done with it once and for all.

@johnbellone
Copy link
Contributor

johnbellone commented May 24, 2016

After reading the documentation it seems that we should be able to do this from a wrapper cookbook/policy:

default['poise-service']['consul']['options']['systemd']['template'] = 'consul-wrapper:systemd.erb'

But we should wait for the man to speak (@coderanger).

@kamaradclimber
Copy link
Contributor Author

@johnbellone any news regarding this MR ? Should I rebase and fix the conflicts or do you have another solution ?

@johnbellone
Copy link
Contributor

Were you able to test the above? I can do so today at some point.

@kamaradclimber
Copy link
Contributor Author

thanks for your answer.
we've used this branch of the cookbook for some time in production, it works as expected.

@johnbellone
Copy link
Contributor

Would you be able to rebase?

@kamaradclimber kamaradclimber force-pushed the configure_all_the_things branch from c4f0708 to a3c8689 Compare June 20, 2016 14:05
@kamaradclimber
Copy link
Contributor Author

done

@codecov-io
Copy link

codecov-io commented Jun 20, 2016

Current coverage is 59.84%

No coverage report found for master at 2876c5e.

Powered by Codecov. Last updated by 2876c5e...e4e4949

# @!attribute restart_on_update
# Whether to restart the service on updates
# @return [Boolean]
attribute(:restart_on_update, kind_of: [TrueClass, FalseClass], default: lazy { node['consul']['service']['restart_on_update'] })

This comment was marked as outdated.

This comment was marked as outdated.

We keep the current behavior:
- do not restart on linux
- restart on windows
@kamaradclimber kamaradclimber force-pushed the configure_all_the_things branch from a3c8689 to e4e4949 Compare June 20, 2016 14:15
@kamaradclimber
Copy link
Contributor Author

@johnbellone would you have feedback regarding this PR?

@Ginja
Copy link
Contributor

Ginja commented Jul 8, 2016

We have custom init/systemd scripts for all our Hashicorp related cookbooks, & this is how we override them:

# our_wrapper_cookbook/recipes/default.rb
node.override['poise-service']['consul']['template'] = 'our_wrapper_cookbook:file.erb'

@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.

Question: How can a wrapper cookbook specify additional systemd options
4 participants