Ask Your Question
2

How to cause my class to send sighup instead of doing service named stop / service named start?

asked 2013-04-08 23:35:43 -0500

Red Cricket gravatar image

updated 2013-04-09 00:19:17 -0500

ramindk gravatar image

I have a very simple class that keeps the named.conf update to date on my DNS server.

class mydns {
  package { 'mydns':
    ensure => present,
  }

  file { '/opt/DNS/conf/named.conf.puppet':
    ensure  => present,
    owner   => 'root',
    group   => 'root',
    mode    => '0440',
    require => Package['mydns']
    backup  => false,
    content => template('mydns/named.conf.erb'),
  }

  file { '/opt/DNS/conf/named.conf':
    owner   => 'root',
    group   => 'root',
    mode    => '0440',
    require => Exec['deploy_named_conf'],
  }

  file { '/opt/DNS/named/mydns.example.com.db':
    owner   => 'root',
    group   => 'root',
    mode    => '0440',
    require => File['/opt/DNS/conf/named.conf'],
    content => template('mydns/mydns.example.com.db.erb'),
  }

  service { 'named':
    ensure => 'running',
  }

  exec { 'deploy_named_conf ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2013-04-09 00:59:47 -0500

ramindk gravatar image

You want the restart Service parameter. http://docs.puppetlabs.com/references/stable/type.html#service

Code should look like this

service { 'named':
  ensure  => running,
  restart => 'service named reload', # or whatever you'd like
}
edit flag offensive delete link more

Comments

1

I decided to remove the notify => Service['named'], line and change the command line to this command => '/bin/cp /opt/DNS/conf/named.conf.puppet /opt/DNS/conf/named.conf ...(more)

Red Cricket gravatar imageRed Cricket ( 2013-04-09 17:34:20 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-04-08 23:35:43 -0500

Seen: 995 times

Last updated: Apr 09 '13