327523ddd8
The new resource ordering algorithm in puppet 4 may cause the asterisk service to be refreshed before the module directories are in place, which then causes the module reload exec to fail. This patch adds an explicit ordering to the customdir defined type to ensure that the module directory exists before the asterisk service is refreshed. Change-Id: Ic892983476c7da60e4801779dfecc50587a2404d
45 lines
886 B
Puppet
45 lines
886 B
Puppet
# == Define: asterisk::function::customdir
|
|
#
|
|
# This class manages the asterisk server
|
|
#
|
|
# === Examples
|
|
#
|
|
# asterisk::function::customdir { 'cdr.conf': }
|
|
#
|
|
# === Authors
|
|
#
|
|
# Paul Belanger <paul.belanger@polybeacon.com>
|
|
#
|
|
# === Copyright
|
|
#
|
|
# Copyright (C) 2012, PolyBeacon, Inc.
|
|
#
|
|
# This program is free software, distributed under the terms
|
|
# of the Apache License, Version 2.0. See the LICENSE file at
|
|
# the top of the source tree.
|
|
#
|
|
define asterisk::function::customdir(
|
|
) {
|
|
|
|
File {
|
|
group => 'asterisk',
|
|
mode => '0640',
|
|
owner => 'asterisk',
|
|
}
|
|
|
|
$basedir = '/etc/asterisk'
|
|
$base = "${basedir}/${name}.d"
|
|
|
|
file { $base:
|
|
ensure => directory,
|
|
force => true,
|
|
notify => Exec["asterisk-module-reload-${name}"],
|
|
purge => true,
|
|
recurse => true,
|
|
require => File[$basedir],
|
|
before => Service['asterisk'],
|
|
}
|
|
}
|
|
|
|
# vim:sw=2:ts=2:expandtab
|