0

I'm trying to create a simple module which sets settings based on hiera data.

I have the file modules/settings/manifests/init.pp I've tried:

class settings {
  ini_setting { 'set check-in frequency':
    ensure  => present,
    path    => '/etc/puppetlabs/puppet/puppet.conf',
    section => 'agent',
    setting => 'runinterval',
    value   => '4h',
  }
}

I also tried putting that code into a config.pp and then calling in init.pp:

class settings {
  contain ntp::config
  Class['::ntp::config']
}

How can I have the puppet manifest in my module run on each check-in for nodes with it installed?

Philip Kirkbride
  • 279
  • 2
  • 10
  • 30
  • what does your hieradata for this host look like? where do you include you ``::settings`` module? – Phillip -Zyan K Lee- Stockmann Jan 12 '18 at 16:56
  • @Phillip-ZyanKLee-Stockmann I have R10K with a bunch of branches but I can install modules globally. I'm wondering if there is a way to run a manifest just by the module being installed, without having to reference the class from any of the manifests in each R10K repo. – Philip Kirkbride Jan 12 '18 at 17:08
  • You COULD execute puppet manually on a node like this: ``puppet apply ``: https://puppet.com/docs/puppet/5.3/man/apply.html – Phillip -Zyan K Lee- Stockmann Jan 12 '18 at 17:13
  • @Phillip-ZyanKLee-Stockmann I'll try to add it to the manifests. I added `include settings` should that be enough to have the settings take effect? – Philip Kirkbride Jan 12 '18 at 17:39
  • it should be, if this is included in ``site.pp`` or another module/profile that has been in turn included for this node. another place would be to include it in your hieradata declaration of that node. puppet is fairly flexible with that. – Phillip -Zyan K Lee- Stockmann Jan 12 '18 at 17:44

0 Answers0