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

Added custom init style "custom" #233

Merged
merged 3 commits into from
Feb 29, 2016
Merged

Conversation

sy-be
Copy link
Contributor

@sy-be sy-be commented Feb 26, 2016

This is useful for scenarios when you want to start consul from another program manager, e.g supervisor (supervisord.org).

Full example:
class { 'consul':
package_ensure => $package_ensure,
config_hash => $config_hash,
init_style => 'custom',
}

supervisor::program { 'consul':
command => '/usr/local/bin/consul agent -config-dir /usr/local/consul/conf',
user => 'consul',
group => 'consul',
}

This change will prevent puppet-consul from creating an init script and managing the process, so the supervisor could do this instead.

This is useful for scenarios when you want to start consul from another program manager, e.g supervisor (supervisord.org).

Full example:
  class { 'consul':
    package_ensure => $package_ensure,
    config_hash    => $config_hash,
    init_style     => 'custom',
  }

  supervisor::program { 'consul':
    command         => '/usr/local/bin/consul agent -config-dir /usr/local/consul/conf',
    user            => 'consul',
    group           => 'consul',
  }
@@ -78,6 +78,9 @@
content => template('consul/consul.launchd.erb')
}
}
'custom' : {
notice("I'm not creating an init script for you as you are going to create one yourself")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No notice please. This causes puppet to never converge.

@solarkennedy
Copy link
Contributor

Can't people already do this if they say initstyle => false and manage_service => false ?

This is useful for scenarios when you want to start consul from another program manager, e.g supervisor (supervisord.org) and don't want consul::config generated init file but still require a reload mechanism.
@sy-be
Copy link
Contributor Author

sy-be commented Feb 29, 2016

  • If manage_service => false then reload_service won't work, i.e. I still want consul to reload itself whenever there's a config change.
  • init_style => false is actually works, and there's no need for "custom". I reduced the diff and now th is what we need. At first it seemed that when you configure init_style as false - it may delete your custom init script at /etc/init.d/consul

solarkennedy added a commit that referenced this pull request Feb 29, 2016
Added custom init style "custom"
@solarkennedy solarkennedy merged commit fa335bd into voxpupuli:master Feb 29, 2016
@solarkennedy
Copy link
Contributor

Gotcha.

@sy-be
Copy link
Contributor Author

sy-be commented Feb 29, 2016

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants