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

work on debian based systems #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ Features
--------

Features let you configure call parking and special numbers that trigger
special functionality. The `asterisk::feature` defined type helps you
special functionality. The `asterisk::cfg::feature` defined type helps you
configuring such features. The `options` parameter is mandatory.

Define features that are contained within feature group "myfeaturegroup":
Expand All @@ -417,18 +417,18 @@ $ft_options = {
'pausemonitor' => '#1,self/callee,Pausemonitor',
'unpauseMonitor' => '#3,self/callee,UnPauseMonitor',
}
asterisk::feature { 'myfeaturegroup':
asterisk::cfg::feature { 'myfeaturegroup':
options => $ft_options,
}
```

A special section in the features configuration file, namely
`[applicationmaps]` lets you define global features. The
`asterisk::feature::applicationmap` defined type helps you configure such a
`asterisk::cfg::feature::applicationmap` defined type helps you configure such a
global feature. The `feature` and `value` parameters are mandatory:

```puppet
asterisk::feature::applicationmap { 'pausemonitor':
asterisk::cfg::feature::applicationmap { 'pausemonitor':
feature => 'pausemonitor',
value => '#1,self/callee,Pausemonitor',
}
Expand Down Expand Up @@ -456,11 +456,11 @@ in this context.

Another special context, `applicationmap`, lets you configure dynamic features.
To set entries in this context, you should use the
`asterisk::feature::applicationmap` defined type. Note also that for dynamic
`asterisk::cfg::feature::applicationmap` defined type. Note also that for dynamic
features to work the DYNAMIC_FEATURES channel variable must be set by listing
features enabled in the channel, separated by '#'.

To configure additional feature contexts, you can use the `asterisk::feature`
To configure additional feature contexts, you can use the `asterisk::cfg::feature`
defined type.

Queues
Expand Down
14 changes: 13 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,19 @@
# mess everything up. You can read about this at:
# http://docs.puppetlabs.com/puppet/2.7/reference/lang_containment.html#known-issues
anchor { 'asterisk::begin': }
-> class { '::asterisk::repos': }
->
case $::operatingsystem {
'CentOS', 'Fedora', 'Scientific', 'RedHat', 'Amazon', 'OracleLinux': {
# rhel-based
class { '::asterisk::repos::rhel': }
}
'Debian', 'Ubuntu': {
class { '::asterisk::repos::debian': }
}
default: {
fail("\"${module_name}\" provides no packages for \"${::operatingsystem}\"")
}
}
-> class { '::asterisk::install': }
-> class { '::asterisk::config': }
~> class { '::asterisk::service': }
Expand Down
47 changes: 20 additions & 27 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,29 @@

# TODO: make packages dependend on loaded modules
if $asterisk::real_manage_package['manage_package'] {
ensure_packages([
$asterisk::real_manage_package['package_name'],
"${asterisk::real_manage_package['package_name']}-dahdi",
"${asterisk::real_manage_package['package_name']}-devel",
"${asterisk::real_manage_package['package_name']}-sounds-core-en-alaw.noarch",
"${asterisk::real_manage_package['package_name']}-mysql",
"${asterisk::real_manage_package['package_name']}-iax2",
"${asterisk::real_manage_package['package_name']}-sip",
"${asterisk::real_manage_package['package_name']}-snmp"],
{
'provider' => 'yum',
'ensure' => 'present',
'require' => [
Yumrepo['asterisk-common'],
Yumrepo['asterisk-13']
]
$rhel_packages = ['dahdi', 'devel', 'sounds-core-en-alaw.noarch', 'asterisk-sounds-core-en', 'asterisk-sounds-core-en-gsm', 'mysql', 'iax2', 'sip', 'snmp']
$debian_packages = ['dahdi', 'dev', 'core-sounds-en', 'mysql']
case $::operatingsystem {
'CentOS', 'Fedora', 'Scientific', 'RedHat', 'Amazon', 'OracleLinux': {
$rhel_packages.each |String $package| {
package { "${asterisk::real_manage_package['package_name']}-${package}":
ensure => 'present',
require => [
Yumrepo['asterisk-common'],
Yumrepo['asterisk-13']
]
}
}
}
'Debian', 'Ubuntu': {
$debian_packages.each |String $package| {
package { "${asterisk::real_manage_package['package_name']}-${package}":
ensure => 'present',
}
}
}
)

ensure_packages([
$asterisk::real_manage_package['package_name'],
'asterisk-sounds-core-en',
'asterisk-sounds-core-en-gsm',
],
{
ensure => installed
}
)
}

if $asterisk::real_manage_package['manage_directories'] {
if has_key($asterisk::real_asterisk_options['directories'], 'astetcdir') and $asterisk::real_asterisk_options['directories']['astetcdir'] != $asterisk::confdir {
notify { "The defined 'astetcdir' is different from where this module will generate the configruation in. Please adjust.":
Expand Down
6 changes: 6 additions & 0 deletions manifests/repos/debian.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Installs the repos needed to install asterisk and it's components
#
class asterisk::repos::debian {

# nothing right now
}
4 changes: 2 additions & 2 deletions manifests/repos.pp → manifests/repos/rhel.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Installs the repos needed to install asterisk and it's components
#
class asterisk::repos {
class asterisk::repos::rhel {


if $asterisk::real_manage_package['manage_repos'] == 'all' or $asterisk::real_manage_package['manage_repos'] == 'only-asterisk'
Expand Down Expand Up @@ -54,4 +54,4 @@
}
}

}
}
7 changes: 6 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
"6",
"7"
]
},
{ "operatingsystem": "Debian",
"operatingsystemrelease": [
"8",
"9"
]
}
],
"tags": [
Expand All @@ -33,4 +39,3 @@
}
]
}