Puppet Class: opensips::manage

Inherits:
opensips
Defined in:
manifests/manage.pp

Overview

Class: opensips::manage inherits opensips::params



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'manifests/manage.pp', line 3

class opensips::manage inherits opensips {
  require opensips::config
  if $opensips::mediaproxy_type == 'rtpproxy' {
    service { 'rtpproxy':
      ensure     => running,
      enable     => true,
      hasrestart => true,
      hasstatus  => true,
      before     => Service['opensips'],
      subscribe  => File['/usr/lib/systemd/system/rtpproxy.service']
    }
  }
  if $opensips::db_mode == 'db' {
    service { 'opensips':
      ensure     => running,
      enable     => true,
      hasrestart => true,
      hasstatus  => true,
      require    => Service['mariadb'],
    }
    exec { 'adicionar dominio':
      command => "opensipsctl domain add ${opensips::proxy_ip};opensipsctl domain reload",
      unless  =>  "opensipsctl domain show | egrep ${opensips::proxy_ip}",
      path    => '/usr/bin:/usr/sbin:/bin:/usr/local/bin',
      require => Service['mariadb'],
    }
  } else {
    service { 'opensips':
      ensure     => running,
      enable     => true,
      hasrestart => true,
      hasstatus  => true,
    }
  }
  exec { 'reload_rsyslog':
    command     => 'systemctl restart rsyslog',
    path        => '/usr/bin:/usr/sbin:/bin:/usr/local/bin',
    refreshonly => true,
  }
}