MT#64514 Remove instances support

Change-Id: Ie6b57d9c87e3e3ae0138cb298f1ffa851713ddab
mr26.0
Guillem Jover 6 months ago
parent 7c608b68b0
commit db226dbbae

@ -12,14 +12,12 @@ PERL_SCRIPTS = \
helper/sync-db \
helper/tt2-process \
helper/validate-yml helper/fileformat_version \
sbin/ngcp-instances-validator \
sbin/ngcp-network \
sbin/ngcp-network-validator \
sbin/ngcp-sync-db-creds \
sbin/ngcp-sync-db-grants \
# EOL
YAML_SCHEMAS = \
schemas/instances.yml \
schemas/sites.yml \
# EOL
RESULTS ?= results

@ -7,8 +7,6 @@ helper/cat-yml usr/share/ngcp-ngcpcfg/helper/
helper/check-for-mysql usr/share/ngcp-ngcpcfg/helper/
helper/del-value usr/share/ngcp-ngcpcfg/helper/
helper/fileformat_version usr/share/ngcp-ngcpcfg/helper/
helper/instance-info usr/share/ngcp-ngcpcfg/helper/
helper/instances-info usr/share/ngcp-ngcpcfg/helper/
helper/restore-permissions usr/share/ngcp-ngcpcfg/helper/
helper/set-value usr/share/ngcp-ngcpcfg/helper/
helper/sort-yml usr/share/ngcp-ngcpcfg/helper/
@ -18,13 +16,11 @@ helper/validate-yml usr/share/ngcp-ngcpcfg/helper/
hooks/ usr/share/ngcp-ngcpcfg/
lib/get_* usr/lib/ngcp-ngcpcfg/
lib/set_* usr/lib/ngcp-ngcpcfg/
sbin/ngcp-instances-validator usr/sbin/
sbin/ngcp-network usr/sbin/
sbin/ngcp-network-validator usr/sbin/
sbin/ngcp-sync-db-creds usr/sbin/
sbin/ngcp-sync-db-grants usr/sbin/
sbin/ngcpcfg usr/sbin/
schemas/instances.yml usr/share/ngcp-ngcpcfg/schemas/
schemas/sites.yml usr/share/ngcp-ngcpcfg/schemas/
scripts/apply usr/share/ngcp-ngcpcfg/scripts/
scripts/build usr/share/ngcp-ngcpcfg/scripts/

1
debian/rules vendored

@ -5,7 +5,6 @@
#export DH_VERBOSE = 1
SCRIPTS = \
$(CURDIR)/usr/sbin/ngcp-instances-validator \
$(CURDIR)/usr/sbin/ngcp-network \
$(CURDIR)/usr/sbin/ngcp-network-validator \
# EOL

@ -114,9 +114,6 @@ precedence to higher precedence):
file, used by template-handler for generating /etc/foobar/baz. Configuration
file is usually provided by a Debian package.
* _/etc/ngcp-config/templates/etc/foobar/baz.tt2.inst-$INSTANCE_NAME_: ngcp_instance specific
template file. $INSTANCE_NAME in lowercase specified at instances part on network.yml.
* _/etc/ngcp-config/templates/etc/foobar/baz.tt2.$NGCP_NODENAME_: node specific
template file. $NGCP_NODENAME is determined using the __ngcp-nodename__ program
(being _spce_ for CE systems, and _spN_ where N is the index of the node in the
@ -145,12 +142,6 @@ Note: This feature is available in High Availability setups only.
template file, but configuration usually isn't provided by a Debian package and
can be modified independently from any Debian package mechanism.
* _/etc/ngcp-config/templates/etc/foobar/baz.customtt.tt2.inst-$INSTANCE_NAME_:
configuration file similar to
_/etc/ngcp-config/templates/etc/foobar/baz.tt2.inst-$INSTANCE_NAME_ but it's guaranteed
that the file won't be part of any Debian package mechanism. $INSTANCE_NAME in
lowercase specified at instances part on network.yml.
* _/etc/ngcp-config/templates/etc/foobar/baz.customtt.tt2.$NGCP_NODENAME_: node
specific template file.
Regarding $NGCP_NODENAME the same as for _baz.tt2.$NGCP_NODE_NAME_
@ -173,12 +164,10 @@ available in High Availability setups only.
[IMPORTANT]
Configuration file precedence (highest to lowest):
*.customtt.tt2.inst-$INSTANCE_NAME
*.customtt.tt2.$NGCP_HOSTNAME
*.customtt.tt2.$NGCP_PAIRNAME
*.customtt.tt2.$NGCP_NODENAME
*.customtt.tt2
*.tt2.inst-$INSTANCE_NAME
*.tt2.$NGCP_HOSTNAME
*.tt2.$NGCP_PAIRNAME
*.tt2.$NGCP_NODENAME
@ -255,17 +244,6 @@ be executed under "bash $FILE", so you can use commands e.g. like
"ngcp-service foobar restart" and any further shell scripting syntax inside
the services files
NGCP instances
~~~~~~~~~~~~~~
ngcp-templates package provides the *TEMPLATE_INSTANCES* file defining what are
the supported templates for instances. Meaning that ngcpcfg will generate
one additional output per instance following the specifications provide by the
file.
ngcpcfg will generate that output with the template variable **instance_name** defined
and the environment variable **INSTANCE_NAME** set for ngcpcfg.service scripts
Global Options
--------------

@ -34,9 +34,6 @@ SERVICES_POOL_BASE="${NGCPCTL_MAIN}/templates"
SITES_DIR="${NGCPCTL_MAIN}/sites"
SITES_CONFIG="${NGCPCTL_MAIN}/sites.yml"
# location of instances info for templates
TEMPLATE_INSTANCES="${NGCPCTL_MAIN}/instances.yml"
# timestamp format for console output
TIME_FORMAT="+%F %T"

@ -1,67 +0,0 @@
#!/usr/bin/perl -CSD
# Purpose: generate yaml output with instance_info for bash script
################################################################################
use strict;
use warnings;
use YAML::XS;
use Time::Piece;
use Getopt::Long qw(:config posix_default bundling_values no_ignorecase);
my $DEBUG = $ENV{DEBUG} || 0;
my $HNAME = $ENV{HNAME} // '';
my $TIME_FORMAT = $ENV{TIME_FORMAT} // '%F %T';
$TIME_FORMAT =~ s/^\+//;
my $NETWORK_CONFIG = $ENV{NETWORK_CONFIG};
sub usage {
print <<HELP;
Usage: $0 [<option>...] instance_name
Options:
-h, --help This help message.
HELP
}
if (@ARGV != 1) {
error("wrong number of arguments");
usage();
exit 1;
}
my %options = ( help => sub { usage(); exit 0; }, );
error("NETWORK_CONFIG is not defined") unless $NETWORK_CONFIG;
GetOptions( \%options, 'help|?', );
my $yaml = YAML::XS::LoadFile($NETWORK_CONFIG);
sub output_prefix {
my $t = Time::Piece->new;
my $timestamp = $t->strftime($TIME_FORMAT);
return "$timestamp $HNAME";
}
sub error {
my $prefix = output_prefix();
die "$prefix: Error: @_\n";
}
exit 1 unless defined $yaml->{instances};
my $instance_name = $ARGV[0];
# YAML::XS::Dump returns raw UTF-8 strings.
binmode \*STDOUT, ':raw';
foreach my $instance ( sort @{ $yaml->{instances} } ) {
if ($instance->{name} eq $instance_name) {
my $out = {
instance_info => $instance,
};
print Dump($out);
exit 0;
}
}
exit 1;

@ -1,195 +0,0 @@
#!/usr/bin/perl -CSD
# Purpose: format yaml instances file for bash script
################################################################################
use strict;
use warnings;
use YAML::XS;
use Getopt::Long qw(:config posix_default bundling_values no_ignorecase);
use Time::Piece;
use Data::Dumper;
use File::Spec;
use Storable qw(dclone);
my $DEBUG = $ENV{DEBUG} || 0;
my $HNAME = $ENV{HNAME} // '';
my $TIME_FORMAT = $ENV{TIME_FORMAT} // '%F %T';
$TIME_FORMAT =~ s/^\+//;
my $NETWORK_CONFIG = $ENV{NETWORK_CONFIG};
my $TEMPLATE_INSTANCES = $ENV{TEMPLATE_INSTANCES};
sub usage {
print <<HELP;
Usage: $0 [<option>...] <input>...
Options:
-h, --help This help message.
HELP
}
my %options = ( help => sub { usage(); exit 0; }, );
error("NETWORK_CONFIG is not defined") unless $NETWORK_CONFIG;
GetOptions( \%options, 'help|?', );
my $yaml = YAML::XS::LoadFile($NETWORK_CONFIG);
my $templ = YAML::XS::LoadFile($TEMPLATE_INSTANCES);
sub output_prefix {
my $t = Time::Piece->new;
my $timestamp = $t->strftime($TIME_FORMAT);
return "$timestamp $HNAME";
}
sub error {
my $prefix = output_prefix();
die "$prefix: Error: @_\n";
}
sub debug {
return unless $DEBUG;
my $prefix = output_prefix();
warn "$prefix: DEBUG @_\n";
}
my $instances = {};
my $dirs = {};
sub prefix_root {
my $path = shift;
return $path =~ s/^([^\/].*)/\/$1/r;
}
sub split_path {
my $input = shift;
my $val = ();
foreach(split /\//, $input){
error("relative paths are not supported, ${input}") if ($_ =~ '^\.\.?$');
if( defined $_ && !($_ =~ /^$/ )) {
push @{$val}, $_;
}
}
return $val;
}
sub show_match {
my $path;
my ($bpath, $spath, $suffix) = @_;
if(defined $spath) {
$path = $spath;
} else {
$path = $bpath;
}
foreach my $info (sort { $a->{name} cmp $b->{name} } @{$dirs->{$path}}) {
my $dest;
if(defined $spath && defined $suffix) {
$dest = $info->{dest}."/${suffix}";
} else {
$dest = $info->{dest};
}
print "$bpath:$dest:".$info->{name}."\n";
}
}
sub prepare_info {
return 0 unless defined $yaml->{instances};
foreach my $instance (sort { $a->{name} cmp $b->{name} } @{$yaml->{instances}}) {
$instances->{ $instance->{label} } //= ();
push @{ $instances->{ $instance->{label} } }, $instance->{name};
}
foreach my $def (sort { $a->{orig} cmp $b->{orig} } @{$templ->{sources}}) {
my $inst = $instances->{ $def->{label} };
next unless $inst;
my $orig = prefix_root $def->{orig};
$dirs->{$orig} = ();
foreach ( sort @{$inst} ) {
my $dest = $def->{dest} =~ s/^(.*)\$\{INSTANCE_NAME\}(.*)$/$1$_$2/rg;
push @{ $dirs->{$orig} }, { name => $_, dest => prefix_root $dest};
}
}
#debug("info:".Dumper({instances => $instances, dirs => $dirs}));
return 1;
}
sub match_source {
my ($build_path, $matched) = @_;
my $abs_path = File::Spec->rel2abs($build_path);
my $sbuild = split_path $abs_path;
my $size_build = $#{$sbuild};
my $search = keys %{$dirs};
debug("search ${build_path}");
foreach my $index (0 .. $size_build) {
my $b_part = @{$sbuild}[$index];
debug("index:${index} b_part:${b_part} b:".join '/', @{$sbuild}[0..$index]);
foreach my $source_path (sort keys %{$dirs}) {
next if defined $matched->{$source_path};
my $sorig = split_path $source_path;
my $size_orig = $#{$sorig};
my $i_part = defined(@{$sorig}[$index]) ? @{$sorig}[$index] : '';
my $equal = defined($i_part) ? $b_part eq $i_part : 0;
if (not $equal) {
$search--;
$matched->{$source_path} = 0;
debug("!! fail to match ${search} ${source_path}");
} elsif ($index eq $size_build) {
$search--;
$matched->{$source_path} = {build => $source_path, suffix=> undef};
debug(" match ${search} ${source_path}");
} elsif ($index eq $size_orig) {
$search--;
my $temp = join '/', @{$sbuild}[$index+1..$size_build];
$matched->{$source_path} = {
build => "${source_path}/$temp",
suffix => $temp,
};
debug(" match ${search} ${source_path}");
} else {
debug(" index:$index size_build:${size_build} size_orig:${size_orig} ${source_path}");
}
}
debug("***");
# nothing else to match
last unless $search;
}
# clean the non-matches for next round
foreach (sort keys %{$matched}) {
if ($matched->{$_}) {
show_match $matched->{$_}->{build}, $_, $matched->{$_}->{suffix};
} else {
delete($matched->{$_});
}
}
}
exit unless prepare_info;
if (@ARGV == 0) {
foreach (sort keys %{$dirs}) {
show_match $_;
}
} else {
my $matched;
foreach my $build (sort @ARGV) {
match_source $build, $matched;
}
}
exit;

@ -256,10 +256,6 @@ sub generate_iofiles {
# Support for PRO/CARRIER systems.
my @tt2_hosts;
# Support for instances, name in lowercase!!
if (length $ENV{INSTANCE_NAME}) {
push @tt2_hosts, ".inst-".lc $ENV{INSTANCE_NAME};
}
foreach my $name (qw(HOST_FILE PAIR_FILE NODE_FILE)) {
push @tt2_hosts, $ENV{$name} if defined $ENV{$name};
}

@ -264,34 +264,6 @@ sub get_hosts
return @res;
}
sub get_instances
{
my ($self, $hostname) = @_;
my $res = [];
if (not exists $self->{config}{hosts}{$hostname}) {
return $res;
}
if (not exists $self->{config}{instances}) {
return $res;
}
my $peername = $self->{config}{hosts}{$hostname}{peer};
foreach my $instance (@{$self->{config}{instances}}) {
if ($instance->{host} eq $hostname or $instance->{host} eq $peername) {
# data coming from $hostname
foreach my $iface (@{$instance->{interfaces}}) {
my $ifname = $iface->{name};
$iface->{netmask} = $self->{config}{hosts}{$hostname}{$ifname}{netmask};
if( exists $self->{config}{hosts}{$hostname}{$ifname}{cluster_set}) {
$iface->{cluster_set} = $self->{config}{hosts}{$hostname}{$ifname}{cluster_set};
}
}
push @{$res}, $instance;
}
}
return $res;
}
sub get_ssh_pub_key
{
my ($self, $key_type) = @_;

@ -1,40 +0,0 @@
[%
# vi: ft=tt2
# Return an advertised IP from the interface of a given LB instance
# @param argv.instance instance object
#
# @param argv.type The interface type of LB to extract the advertised IP
# from, one of:
# sip_int, sip_ext
# @param argv.status node status [ online, offline, inactive ]
# default value: ['online', 'inactive']
# @return out The array of IPs.
IF !argv.status.size;
argv.status = ['online', 'inactive'];
END;
status = {
online = 0
offline = 0
inactive = 0
};
FOREACH val IN argv.status;
status.$val = 1;
END;
out = [];
RETURN UNLESS status.item(argv.instance.status);
FOREACH iface IN argv.instance.interfaces;
NEXT UNLESS iface.type.grep('^' _ argv.type _ '$').size();
FOREACH adv IN iface.advertised_ip;
NEXT UNLESS adv;
out.push(adv);
END;
END;
out = out.sort.unique;
-%]

@ -46,18 +46,6 @@ FOREACH set IN cluster_sets.sets;
END;
END;
FOREACH instance IN instances;
NEXT UNLESS status.item(instance.status);
NEXT UNLESS argv.role == instance.label;
host = instance.host;
FOREACH iface IN instance.interfaces;
ifname = iface.name;
NEXT UNLESS hosts.$host.$ifname.cluster_sets.grep('^' _ set.name _ '$').size();
NEXT UNLESS iface.type.grep('^' _ argv.type _ '$').size();
theset.ips.push(iface.ip) UNLESS theset.ips.defined(iface.ip);
END;
END;
IF theset.ips.size();
out.push(theset);
END;

@ -1,38 +0,0 @@
[%
# vi: ft=tt2
# Return an array of IPs from the interface of a given type
# for an instance.
# @param argv.instance instance
# @param argv.type The interface type of a node to extract the IP
# from, one of:
# web_int, web_ext, sip_int, sip_ext, ...
# @param argv.status node status [ online, offline, inactive ]
# default value: ['online', 'inactive']
# @return out The array of IPs.
IF !argv.status.size;
argv.status = ['online', 'inactive'];
END;
status = {
online = 0
offline = 0
inactive = 0
};
FOREACH val IN argv.status;
status.$val = 1;
END;
out = [];
RETURN UNLESS status.item(argv.instance.status);
FOREACH iface IN argv.instance.interfaces;
NEXT UNLESS iface.type.grep('^' _ argv.type _ '$').size();
NEXT UNLESS iface.ip;
out.push(iface.ip);
END;
out = out.sort.unique;
-%]

@ -1,66 +0,0 @@
[%
# vi: ft=tt2
# Returns an array of IPs getting from the connection list passed as argument
# after getting the one with name argv.name
# The ips are retrieved from the definition of other instances or hosts
#
# @param argv.connection the connection list of the instance
#
# @param argv.name the name of the connection list to use
#
# @param argv.type get IPs for only specific iface type,
# not all of the types present in conn config
#
# @param argv.ngcpcfgdir
#
# @return out the array of IPs.
# @return out_algorithm the algorithm to use.
out = [];
out_algorithm = '';
IF !argv.ngcpcfgdir.length;
argv.ngcpcfgdir = '/usr/lib/ngcp-ngcpcfg';
END;
FOR conn IN argv.connection;
NEXT UNLESS conn.name == argv.name;
out_algorithm = conn.algorithm;
FOR link IN conn.links;
# Filtering to get the interface with the correct type
FOR link_interface IN link.interfaces;
NEXT UNLESS link_interface.type.grep('^' _ argv.type _ '$').size();
# If type equal instance, then look into the instances definition
IF link.type == "instance";
FOR conn_instance IN instances;
NEXT UNLESS conn_instance.name == link.name;
FOR iface IN conn_instance.interfaces;
NEXT UNLESS iface.name == link_interface.name;
NEXT UNLESS iface.type.grep('^' _ link_interface.type _ '$').size();
NEXT UNLESS iface.ip;
out.push(iface.ip);
END;
END;
# If type equal host, then look into the node interfaces definition
ELSE;
IF hosts.exists(link.name);
argv.host = link.name;
argv.type = link_interface.type;
PROCESS "${argv.ngcpcfgdir}/get_all_shared_ips_for_host";
IF !out.size;
PROCESS "${argv.ngcpcfgdir}/get_all_ips_for_host";
END;
END;
END;
END;
# It is assumed to have in the connections only one interface defined with a particular type
LAST;
END;
END;
out = out.unique;
-%]

@ -1,118 +0,0 @@
[%
# vi: ft=tt2
# Returns a list of RTP-enabled interfaces for rtpengine.
#
# @param argv.instance instance
# @param argv.format The format of the returned list, one of:
# "list" for plain list of interfaces,
# "address" for plain list of addresses,
# blank or "rtpengine" for full CLI options.
# @param argv.status node status [ online, offline, inactive ]
# default value: ['online', 'inactive']
# @return out The array of interfaces.
X_format = argv.format;
IF ! X_format.defined || X_format == '';
X_format = 'rtpengine';
END;
IF !argv.status.size;
argv.status = ['online', 'inactive'];
END;
status = {
online = 0
offline = 0
inactive = 0
};
FOREACH val IN argv.status;
status.$val = 1;
END;
out = [];
RETURN UNLESS status.item(argv.instance.status);
FOREACH X_ifc IN argv.instance.interfaces;
X_types = X_ifc.type.grep('^rtp_.');
FOREACH X_type IN X_types;
X_type = X_type.remove('^rtp_');
IF X_format == 'list';
out.push(X_type);
NEXT;
END;
X_ips = X_ifc.shared_ip.list;
IF !X_ips.size() || !X_ips.0.defined;
X_ips = X_ifc.ip.list;
END;
X_adv_ips = X_ifc.advertised_ip.list;
X_suffix = 0;
IF X_ips.size() > 1;
X_suffix = 1;
END;
FOREACH X_ip IN X_ips;
X_adv_ip = X_adv_ips.shift();
IF X_format == 'address';
out.push(X_ip);
ELSE;
X_name = X_type;
IF X_suffix;
X_name = X_name _ ':' _ X_suffix;
X_suffix = X_suffix + 1;
END;
IF X_format == 'objects';
X_obj = {
name = X_name
address = X_ip
adv_addr = X_adv_ip
port_min = X_ifc.rtp_port_min || 0
port_max = X_ifc.rtp_port_max || 0
};
out.push(X_obj);
ELSE;
out.push(X_name _ '/' _ X_ip _ (X_adv_ip ? ('!' _ X_adv_ip) : ''));
END;
END;
END;
X_ips = X_ifc.shared_v6ip.list;
IF !X_ips.size() || !X_ips.0.defined;
X_ips = X_ifc.v6ip.list;
END;
X_suffix = 0;
IF X_ips.size() > 1;
X_suffix = 1;
END;
FOREACH X_ip IN X_ips;
IF X_format == 'address';
out.push(X_ip);
ELSE;
X_name = X_type;
IF X_suffix;
X_name = X_name _ ':' _ X_suffix;
X_suffix = X_suffix + 1;
END;
IF X_format == 'objects';
X_obj = {
name = X_name
address = X_ip
port_min = X_ifc.rtp_port_min || 0
port_max = X_ifc.rtp_port_max || 0
};
out.push(X_obj);
ELSE;
out.push(X_name _ '/' _ X_ip);
END;
END;
END;
END;
END;
-%]

@ -1,44 +0,0 @@
[%
# vi: ft=tt2
# Return an array of IPv6s from the interface of a given type
# for an instance.
# @param argv.instance instance
# @param argv.type The interface type of a node to extract the IP
# from, one of:
# web_int, web_ext, sip_int, sip_ext, ...
# @param argv.format Optional reformatting of IPv6 addresses.
# @param argv.status node status [ online, offline, inactive ]
# default value: ['online', 'inactive']
# @return out The array of IPs.
IF !argv.status.size;
argv.status = ['online', 'inactive'];
END;
status = {
online = 0
offline = 0
inactive = 0
};
FOREACH val IN argv.status;
status.$val = 1;
END;
out = [];
RETURN UNLESS status.item(argv.instance.status);
FOREACH iface IN argv.instance.interfaces;
NEXT UNLESS iface.type.grep('^' _ argv.type _ '$').size();
NEXT UNLESS iface.v6ip;
IF argv.format == 'expand';
ip = ngcp.net_ip_expand(iface.v6ip);
ELSE;
ip = iface.v6ip;
END;
out.push(ip);
END;
out = out.sort.unique;
-%]

@ -1,71 +0,0 @@
[%
# vi: ft=tt2
# Only for usage with instances setup, and only to be used on Proxy / LB hosts.
#
# Returns a list of prepared records for /etc/hosts file.
# It differentiates PRO and Carrier setups automatically and fills
# the records accordingly to the setup type.
# If the NGCP setup has no instances, script will return an empty list.
out = [];
proxy_role = 'proxy';
lb_role = 'lb';
sql_role = 'db';
nosql_role = 'db';
iface_marker = 'ha_int';
hostname = ngcp.get_hostname();
is_lb = ngcp.has_role(hostname, lb_role);
is_proxy = ngcp.has_role(hostname, proxy_role);
# if this host where the script is running, is not a Proxy/LB node, skip further execution
IF instances.defined && instances.size > 0 && (is_proxy || is_lb);
hostnames_records_sql = [];
hostnames_records_nosql = [];
# get my ha ip (not a shared ip)
argv.host = hostname;
argv.type = iface_marker;
PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host';
my_ha_ip = out.0;
FOREACH host IN hosts.keys.sort;
this_host_has_sql_role = ngcp.has_role(host, sql_role);
this_host_has_nosql_role = ngcp.has_role(host, nosql_role);
this_host_has_proxy_role = ngcp.has_role(host, proxy_role);
this_host_has_lb_role = ngcp.has_role(host, lb_role);
IF is_proxy && (this_host_has_sql_role || this_host_has_nosql_role);
argv.host = host;
argv.type = iface_marker;
PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_shared_ips_for_host';
IF this_host_has_sql_role && out.0;
hostnames_records_sql.push(out.0 _ ' db.central.' _ host);
END;
IF this_host_has_nosql_role && out.0;
hostnames_records_nosql.push(out.0 _ ' nosql.central.' _ host);
END;
END;
IF is_proxy && this_host_has_proxy_role;
hostnames_records_sql.push(my_ha_ip _ ' db.replicatedpair.' _ host);
hostnames_records_sql.push(my_ha_ip _ ' db.replicatedcentral.' _ host);
END;
IF (is_proxy && this_host_has_proxy_role) || (is_lb && this_host_has_lb_role);
hostnames_records_nosql.push(my_ha_ip _ ' nosql.replicatedpair.' _ host);
END;
END;
out = hostnames_records_nosql.merge(hostnames_records_sql);
END;
out = out.unique.sort;
-%]

@ -1,31 +0,0 @@
[%
# vi: ft=tt2
# Returns a list of instances for a service.
#
# @param argv.service instance service name.
# @param argv.status instance status [ online, offline ],
# default value: [ 'online' ].
# @return out Hash of instance lists per service.
IF !argv.status.size;
argv.status = [ 'online' ];
END;
status = {
online = 0
offline = 0
};
FOREACH val IN argv.status;
status.$val = 1;
END;
out = [];
FOREACH instance IN instances;
NEXT UNLESS status.item(instance.status);
NEXT UNLESS instance.service.replace('-', '_') == argv.service;
out.push(instance);
END;
-%]

@ -1,206 +0,0 @@
#!/usr/bin/perl
use strict;
use warnings;
use open qw(:std :encoding(UTF-8));
use Storable qw(dclone);
use List::Util qw(any none first);
use Getopt::Long qw(:config posix_default no_ignorecase auto_help auto_version);
use Pod::Usage;
use YAML::XS qw();
use Kwalify;
our $VERSION = 'UNRELEASED';
my $network_file = '/etc/ngcp-config/network.yml';
GetOptions(
'n|network-file=s' => \$network_file,
) or pod2usage(1);
my $yaml = YAML::XS::LoadFile($network_file)
or die "cannot parse file $network_file";
sub dup_check
{
my ($dupe, $text) = @_;
my $errors = 0;
foreach my $id (sort keys %{$dupe}) {
next if scalar @{$dupe->{$id}} <= 1;
warn " - $text $id (@{$dupe->{$id}})\n";
$errors++;
}
return $errors;
}
# Only run these checks, if we have any of instances defined.
if (exists $yaml->{instances}) {
my $errors = 0;
my %dupe_instance_name;
my %dupe_conn;
my @instance_names = map { $_->{name} } @{$yaml->{instances}};
my @host_names = sort keys %{$yaml->{hosts}};
my $i = 0;
# Cycle through all existing instances definitions to find mistakes in
# connections.
foreach my $instance (@{$yaml->{instances}}) {
my $instance_host = $instance->{host};
my $j = 0;
# Just in case, catch name duplicates used for general instances names.
push @{$dupe_instance_name{$instance->{name}}}, "instance number: $i";
# Iterate through the list of connections.
foreach my $conn (@{$instance->{connections}}) {
# Catch connections names duplicates of each given instance.
my $conn_id = '#' . $i . ' : ' . $instance->{name} . ': ' . $conn->{name};
push @{$dupe_conn{$conn_id}}, "con #$j: $conn->{name} ;";
# Iterate through the list of connection links.
foreach my $conn_link (@{$conn->{links}}) {
my $conn_link_name = $conn_link->{name};
my $remote;
# Check that each connection of type instance/host indeed
# exists.
if ($conn_link->{type} eq 'instance') {
if (none { $_ eq $conn_link_name } @instance_names) {
warn " - [instances/$instance->{name}/$conn->{name}/$conn_link_name] Missing required instance for connection link\n";
$errors ++;
}
$remote = first { $_->{name} eq $conn_link_name } @{$yaml->{instances}};
} elsif ($conn_link->{type} eq 'host') {
if (none { $_ eq $conn_link_name } @host_names) {
warn " - [instances/$instance->{name}/$conn->{name}/$conn_link_name] Missing required host for connection link\n";
$errors ++;
}
$remote = $yaml->{hosts}->{$conn_link_name};
}
# Iterate through the list of link interfaces.
foreach my $link_iface (@{$conn_link->{interfaces}}) {
my $link_iface_name = $link_iface->{name};
my $link_iface_type = $link_iface->{type};
# Requested link must indeed have requested interface,
# otherwise not possible to interconnect.
if ($conn_link->{type} eq 'instance' ?
none { $_->{name} eq $link_iface_name } @{$remote->{interfaces}} :
none { $_ eq $link_iface_name } @{$remote->{interfaces}})
{
warn " - [instances/$instance->{name}/$conn->{name}/$conn_link_name/$link_iface_name] Missing required link interface\n";
$errors ++;
}
# Check type interface
my $iface;
if ($conn_link->{type} eq 'instance') {
$iface = first { $_->{name} eq $link_iface_name } @{$remote->{interfaces}};
} else {
$iface = $remote->{$link_iface_name};
}
if (none { $_ eq $link_iface_type } @{$iface->{type}}) {
warn " - [instances/$instance->{name}/$conn->{name}/$conn_link_name/$link_iface_name] Missing type $link_iface_type on link interface\n";
$errors ++;
}
}
}
$j++;
}
# Just in case, check also that a host, on which we must run this
# instance, exists.
if (none { $_ eq $instance_host } @host_names) {
warn " - [instances/$instance->{name}] Missing required host $instance_host\n";
$errors ++;
}
$i++;
}
# Check duplicates and raise an error if found.
$errors += dup_check(\%dupe_instance_name, '[/instances/<name>] Duplicate instance name with an existing instance');
$errors += dup_check(\%dupe_conn, '[/instances/<name>] Duplicate connetion name');
exit 1 if $errors;
}
1;
# vim: ts=4 sw=4 et
__END__
=encoding utf-8
=head1 NAME
ngcp-instances-validator - dynamically validates the instances connections, if instances are defined.
=head1 SYNOPSIS
B<ngcp-instances-validator> [I<option>...]
=head1 DESCRIPTION
B<This program> iterates through currently existing instances
defined in the network.yml with an intention of checking their
connections to other instances/hosts.
=head1 OPTIONS
=over 8
=item B<-n>, B<--network-file> I<yaml-file>
The B<network.yml> file to validate.
=item B<--help>
Print a help message.
=back
=head1 EXIT STATUS
=over 8
=item B<0>
The connections are getting validated correctly.
=item B<1>
The connections are getting validated incorrectly.
=back
=head1 AUTHOR
Donat Zenichev <dzenichev@sipwise.com>
=head1 LICENSE
Copyright © 2022 Sipwise GmbH, Austria
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

@ -1,17 +0,0 @@
name: instances.yml
desc: Kwalify schema for NGCP instances.yml
type: map
mapping:
"sources":
type: seq
required: yes
sequence:
- type: map
required: yes
mapping:
"orig": { type: str, required: yes,
desc: "Specify the original service pathname." }
"dest": { type: str, required: yes,
desc: "Specify the destination service pathname." }
"label": { type: str, required: yes,
desc: "Specify service label." }

@ -47,44 +47,6 @@ for f in ${NGCPCTL_CONFIG:-} ${NODE_CONFIG:-} ${PAIR_CONFIG:-} ${HOST_CONFIG:-}
ARGS+=("-c" "$f")
done
build_config_files_instances() {
local info
local source
local target
local instance
local inst_cfg
local rc=0
if [ -z "${TEMPLATE_INSTANCES:-}" ] || [ ! -f "${TEMPLATE_INSTANCES}" ] ; then
log_debug "no template info for instances, skip step"
return
fi
log_debug "${RUNNER} ${HELPER}/instances-info $*"
inst_cfg=$(mktemp -t ngcpcfg-build.XXXXXXXXXX )
while IFS=":" read -r -a info; do
source=${info[0]}
target=${info[1]}
instance=${info[2]}
log_debug "source:${source} target:${target} instance:${instance}"
log_debug "${RUNNER} ${HELPER}/instance-info ${instance} > ${inst_cfg}"
${RUNNER} "${HELPER}/instance-info" "${instance}" > "${inst_cfg}" || rc=$?
if [ "${rc}" != "0" ]; then
log_error "Failed to build instance info! Aborting."
exit $rc
fi
log_debug "INSTANCE_NAME=${instance} ${RUNNER} ${HELPER}/tt2-process ${ARGS[*]} -c ${inst_cfg} -r ${source}:${target} ${source}"
INSTANCE_NAME="${instance}" ${RUNNER} "${HELPER}/tt2-process" "${ARGS[@]}" -c "${inst_cfg}" -r "${source}:${target}" "${source}" || rc=$?
if [ "${rc}" != "0" ]; then
log_error "Instances build errors detected (see the output above)! Aborting."
exit $rc
fi
done< <(${RUNNER} "${HELPER}/instances-info" "$@")
rm -f "${inst_cfg}"
}
build_config_files() {
RUNNER="nice -n 19 ionice -c 3"
local rc=0
@ -97,8 +59,6 @@ build_config_files() {
exit $rc
fi
build_config_files_instances "$@"
record_commit_id
}

@ -168,15 +168,11 @@ validate_config() {
log_error "Invalid schema detected for ${f}"
rc=1
fi
if ! ngcp-instances-validator --network-file="$f"; then
log_error "Invalid schema detected for instances connections"
rc=1
fi
else
local schema
case "${name}" in
sites.yml|instances.yml)
sites.yml)
if ! [ -e "${f}" ]; then
continue
fi
@ -279,8 +275,7 @@ check_shared_storage() {
if [ "$*" = "" ] ; then
SITES_FILE="${SITES_FILE:-${NGCPCTL_MAIN}/sites.yml}"
INSTANCES_FILE="${INSTANCES_FILE:-${NGCPCTL_MAIN}/instances.yml}"
config_files="${NGCPCTL_CONFIG:-} ${NODE_CONFIG:-} ${PAIR_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${MAINTENANCE_CONFIG:-} ${NETWORK_CONFIG:-} ${EXTRA_CONFIG_FILES[*]} ${CONSTANTS_CONFIG:-} ${SITES_FILE:-} ${INSTANCES_FILE:-}"
config_files="${NGCPCTL_CONFIG:-} ${NODE_CONFIG:-} ${PAIR_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${MAINTENANCE_CONFIG:-} ${NETWORK_CONFIG:-} ${EXTRA_CONFIG_FILES[*]} ${CONSTANTS_CONFIG:-} ${SITES_FILE:-}"
else
config_files="$*"
fi

@ -13,7 +13,6 @@ FUNCTIONS="${FUNCTIONS:-/usr/share/ngcp-ngcpcfg/functions/}"
OUTPUT_DIRECTORY="${OUTPUT_DIRECTORY:-}"
CLEANUP_FILES=()
INSTANCES=()
# load modules
@ -27,28 +26,9 @@ fi
# functions
instances_info() {
local target
local dest
local instance
local RUNNER="nice -n 19 ionice -c 3"
log_debug "${RUNNER} ${HELPER}/instances-info"
while IFS=":" read -r -a info; do
target=${info[0]}
dest=${info[1]}
instance=${info[2]}
INSTANCES+=("${target}:${instance}:${dest}")
done< <(${RUNNER} "${HELPER}/instances-info")
}
exec_wrapper() {
local service_file=$1
local instance_name="${2:-}"
local msg=""
if [ -n "${instance_name}" ]; then
msg="[${instance_name}]"
fi
if ${DRYRUN} ; then
log_info "TEST MODE: Would execute action for ${service_file}${msg}"
@ -57,13 +37,13 @@ exec_wrapper() {
log_info "Executing action for ${service_file}${msg}"
if [[ -x "${service_file}" ]]; then
log_debug "${service_file}${msg}"
if ! INSTANCE_NAME="${instance_name}" "${service_file}" ; then
log_warn "INSTANCE_NAME=${instance_name} ${service_file} returned with error code, continuing anyway."
if ! "${service_file}" ; then
log_warn "${service_file} returned with error code, continuing anyway."
fi
elif [[ -r "${service_file}" ]]; then
log_debug "INSTANCE_NAME=${instance_name} bash ${service_file}"
if ! INSTANCE_NAME="${instance_name}" bash "${service_file}" ; then
log_warn "INSTANCE_NAME=${instance_name} ${service_file} returned with error code, continuing anyway."
log_debug "bash ${service_file}"
if ! bash "${service_file}" ; then
log_warn "${service_file} returned with error code, continuing anyway."
fi
else
log_error "Error: ${service_file} could not be read."
@ -201,26 +181,6 @@ generate_list_to_process() {
fi
}
find_instance() {
local service_file
local info
local target
# get rid of "./" and "//"
# shellcheck disable=SC2001
service_file=$(echo "$1" | sed -e 's_\./_/_g ; s_//_/_g')
for instance in "${INSTANCES[@]}"; do
IFS=":" read -ra info <<< "${instance}"
# get rid of "./" and "//"
target=$(echo "${TEMPLATE_POOL_BASE}${info[0]}" | sed -e 's_\./_/_g ; s_//_/_g')
if [[ "${service_file}" =~ ^${target} ]] ; then
log_debug "[${info[1]}] Storing ${file} in '${TMPFILE}'"
echo "${file}:${info[1]}" >> "${TMPFILE}"
fi
done
}
find_all_services() {
local dir="$1"
@ -230,41 +190,9 @@ find_all_services() {
fi
log_debug "Storing ${file} in '${TMPFILE}'"
echo "${file}" >> "${TMPFILE}"
find_instance "${file}"
done < <(find "${SERVICES_POOL_BASE}/${dir}" -name '*.services' | sort -u)
}
find_changed_instance_services() {
local file
local dir
local info
local dest
local target
local target_file
# get rid of "./" and "//"
# shellcheck disable=SC2001
file=$(echo "$1"| sed -e 's_\./_/_g ; s_//_/_g')
# shellcheck disable=SC2001
dir=$(echo "$2"| sed -e 's_\./_/_g ; s_//_/_g')
for instance in "${INSTANCES[@]}"; do
IFS=":" read -ra info <<< "${instance}"
target=${info[0]#${dir}/}
dest=${info[2]#${dir}/}
if [[ "${file}" =~ ^${dest} ]] ; then
target_file=${file/${dest}/${target}}
if [[ -r "${SERVICES_POOL_BASE}/${dir}/${target_file}".services ]]; then
log_debug "[${info[1]}] Storing ${SERVICES_POOL_BASE}/${dir}/${target_file}.services in '${TMPFILE}'"
echo "${SERVICES_POOL_BASE}/${dir}/${target_file}.services:${info[1]}"
elif [[ -r "${SERVICES_POOL_BASE}/${dir}/$(dirname "${target_file}")"/ngcpcfg.services ]]; then
log_debug "[${info[1]}] Storing ${SERVICES_POOL_BASE}/${dir}/$(dirname "${target_file}")/ngcpcfg.services in '${TMPFILE}'"
echo "${SERVICES_POOL_BASE}/${dir}/$(dirname "${target_file}")/ngcpcfg.services:${info[1]}"
fi
fi
done
}
find_all_changed_services() {
local dir="$1"
@ -300,8 +228,6 @@ find_all_changed_services() {
elif [[ -r "${SERVICES_POOL_BASE}/${dir}/$(dirname "${file}")"/ngcpcfg.services ]]; then
log_debug "Storing ${SERVICES_POOL_BASE}/${dir}/$(dirname "$file")/ngcpcfg.services in '${TMPFILE}'"
echo "${SERVICES_POOL_BASE}/${dir}/$(dirname "$file")/ngcpcfg.services"
else
find_changed_instance_services "${file}" "${dir}"
fi
done | sort -u >> "${TMPFILE}"
@ -349,10 +275,6 @@ log_debug "OUTPUT_DIRECTORY=${OUTPUT_DIRECTORY}"
CLEANUP_FILES+=("${TMPFILE}")
if [ -n "${TEMPLATE_INSTANCES:-}" ] && [ -f "${TEMPLATE_INSTANCES}" ] ; then
instances_info
fi
for dir in ${CONFIG_POOL} ; do
is_absolute_path "${OUTPUT_DIRECTORY}${dir}" || continue
if ! ${DRYRUN}; then

@ -1,65 +0,0 @@
#!KAMAILIO
[%
###################################################
# Get the hostname of the node
###################################################
# hostname
hostname = ngcp.get_hostname();
IF ! hosts.$hostname.size;
hostname = "self";
ELSE;
pairname = ngcp.get_pairname(hostname);
END;
- %]
# [% hostname %]
[% IF instance_info -%]
#!define INSTANCE [% instance_info.name %]
[% END -%]
#!ifndef INSTANCE
# external interfaces
[% FOREACH iface IN hosts.$hostname.interfaces.sort -%]
[% FOREACH type IN hosts.$hostname.$iface.type.sort -%]
[% IF type == "sip_ext" -%]
[%
IF hosts.$hostname.$iface.shared_ip.0.size;
ip_address=hosts.$hostname.$iface.shared_ip.0;
ELSE;
ip_address=hosts.$hostname.$iface.ip;
END;
-%]
listen=udp:[% ip_address %]:[% kamailio.lb.port %][% IF hosts.$hostname.$iface.advertised_ip.0.size %] advertise [% hosts.$hostname.$iface.advertised_ip.0 %]:[% kamailio.lb.port %][% END %]
listen=tcp:[% ip_address %]:[% kamailio.lb.port %][% IF hosts.$hostname.$iface.advertised_ip.0.size %] advertise [% hosts.$hostname.$iface.advertised_ip.0 %]:[% kamailio.lb.port %][% END %]
[% IF ENABLE_TLS -%]
listen=tls:[% ip_address %]:[% kamailio.lb.tls.port %][% IF hosts.$hostname.$iface.advertised_ip.0.size %] advertise [% hosts.$hostname.$iface.advertised_ip.0 %]:[% kamailio.lb.tls.port %][% END %]
[% END -%]
[% END -%]
[% END -%]
[% END -%]
#!else
[%
argv.instance = instance_info;
argv.type = 'sip_ext';
PROCESS '../lib/get_all_ips_for_instance';
sip_ext_ips = out;
argv.type = 'sip_int';
PROCESS '../lib/get_all_ips_for_instance';
sip_int_ips = out;
-%]
# external interfaces
[% FOREACH ip IN sip_ext_ips -%]
listen=udp:[% ip %]:[% kamailio.lb.port %]
listen=tcp:[% ip %]:[% kamailio.lb.port %]
[% IF ENABLE_TLS -%]
listen=tls:[% ip %]:[% kamailio.lb.tls.port %]
[% END -%]
[% END -%]
# internal interfaces
[% FOREACH ip IN sip_int_ips -%]
listen=udp:[% ip %]:[% kamailio.lb.port %]
listen=tcp:[% ip %]:[% kamailio.lb.port %]
[% END -%]
[% IF instance_info.name == 'B' -%]
## This is a change only for B instance
[% END -%]
#!endif

@ -1,3 +0,0 @@
#!/bin/sh
echo "INSTANCE_NAME:${INSTANCE_NAME:-}" > \
"${OUTPUT_DIRECTORY:-/tmp}/ngcpcfg.service${INSTANCE_NAME:-}"

@ -1 +0,0 @@
# Autogenerated by ngcpcfg

@ -1,62 +0,0 @@
#!KAMAILIO
[%
###################################################
# Get the hostname of the node
###################################################
# hostname
hostname = ngcp.get_hostname();
IF ! hosts.$hostname.size;
hostname = "self";
ELSE;
pairname = ngcp.get_pairname(hostname);
END;
- %]
# [% hostname %]
[% IF instance_info -%]
#!define INSTANCE [% instance_info.name %]
[% END -%]
#!ifndef INSTANCE
# external interfaces
[% FOREACH iface IN hosts.$hostname.interfaces.sort -%]
[% FOREACH type IN hosts.$hostname.$iface.type.sort -%]
[% IF type == "sip_ext" -%]
[%
IF hosts.$hostname.$iface.shared_ip.0.size;
ip_address=hosts.$hostname.$iface.shared_ip.0;
ELSE;
ip_address=hosts.$hostname.$iface.ip;
END;
-%]
listen=udp:[% ip_address %]:[% kamailio.lb.port %][% IF hosts.$hostname.$iface.advertised_ip.0.size %] advertise [% hosts.$hostname.$iface.advertised_ip.0 %]:[% kamailio.lb.port %][% END %]
listen=tcp:[% ip_address %]:[% kamailio.lb.port %][% IF hosts.$hostname.$iface.advertised_ip.0.size %] advertise [% hosts.$hostname.$iface.advertised_ip.0 %]:[% kamailio.lb.port %][% END %]
[% IF ENABLE_TLS -%]
listen=tls:[% ip_address %]:[% kamailio.lb.tls.port %][% IF hosts.$hostname.$iface.advertised_ip.0.size %] advertise [% hosts.$hostname.$iface.advertised_ip.0 %]:[% kamailio.lb.tls.port %][% END %]
[% END -%]
[% END -%]
[% END -%]
[% END -%]
#!else
[%
argv.instance = instance_info;
argv.type = 'sip_ext';
PROCESS '../lib/get_all_ips_for_instance';
sip_ext_ips = out;
argv.type = 'sip_int';
PROCESS '../lib/get_all_ips_for_instance';
sip_int_ips = out;
-%]
# external interfaces
[% FOREACH ip IN sip_ext_ips -%]
listen=udp:[% ip %]:[% kamailio.lb.port %]
listen=tcp:[% ip %]:[% kamailio.lb.port %]
[% IF ENABLE_TLS -%]
listen=tls:[% ip %]:[% kamailio.lb.tls.port %]
[% END -%]
[% END -%]
# internal interfaces
[% FOREACH ip IN sip_int_ips -%]
listen=udp:[% ip %]:[% kamailio.lb.port %]
listen=tcp:[% ip %]:[% kamailio.lb.port %]
[% END -%]
#!endif

@ -1,3 +0,0 @@
#!/bin/sh
echo "INSTANCE_NAME:${INSTANCE_NAME:-}" > \
"${OUTPUT_DIRECTORY:-/tmp}/ngcpcfg.service${INSTANCE_NAME:-}"

@ -1,34 +0,0 @@
[%
###################################################
# Get the hostname of the node
###################################################
# hostname
hostname = ngcp.get_hostname();
IF ! hosts.$hostname.size;
hostname = "self";
ELSE;
pairname = ngcp.get_pairname(hostname);
END;
- %]
# [% hostname %]
[% IF instance_info -%]
# [% instance_info.name %]
[%
# Get connection information for LB
# sip_*_primary_ips: list of primary * instances to select
# If not specified set sip_proxy_primary_ips equal to sip_proxy_ips
argv.connection = instance_info.connections;
argv.name = 'proxy';
argv.type = 'sip_int';
argv.ngcpcfgdir = '../lib';
PROCESS '../lib/get_all_ips_of_connection_for_instance';
sip_proxy_primary_ips = out;
IF out_algorithm != '';
proxy_algorithm = algorithm.out_algorithm;
END;
FOR ip IN sip_proxy_primary_ips.sort;
-%]
ip=[% ip %]
[% END -%]
[% END -%]

@ -1,57 +0,0 @@
[%
hostname = ngcp.get_hostname();
peername = ngcp.get_peername(hostname);
argv.host = hostname;
argv.type = 'ha_int';
PROCESS '../lib/get_iface';
host_ha_iface = out;
argv.host = peername;
argv.type = 'ha_int';
PROCESS '../lib/get_iface';
peer_ha_iface = out;
IF !instance_info.defined;
argv.host = hostname;
argv.type = 'sip_int';
PROCESS '../lib/get_all_shared_ips_for_host';
sip_int_ips = out;
IF !sip_int_ips.size;
argv.host = hostname;
argv.type = 'sip_int';
PROCESS '../lib/get_all_ips_for_host';
sip_int_ips = out;
END;
argv.host = hostname;
PROCESS '../lib/get_all_rtp_for_host';
ELSE;
# instance
argv.instance = instance_info;
argv.type = 'sip_int';
PROCESS '../lib/get_all_ips_for_instance';
sip_int_ips = out;
argv.instance = instance_info;
PROCESS '../lib/get_all_rtp_for_instance';
END;
interfaces = [];
int_interfaces = [];
FOREACH interface IN out;
IF interface.match('^int\/');
int_interfaces.push(interface);
ELSE;
interfaces.push(interface);
END;
END;
-%]
[rtpengine[% instance_info.name %]]
host_ha_iface=[% host_ha_iface %]
peer_ha_iface=[% peer_ha_iface %]
[% FOR ip IN sip_int_ips.sort -%]
sip_int_ips=[% ip %]
[% END -%]
interface=[% interfaces.sort.join(';') %]

@ -1,243 +0,0 @@
---
hosts:
sp1:
dbnode: '1'
interfaces:
- lo
- neth0
- neth1
- neth2
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- web_ext
- web_int
- aux_ext
- ssh_ext
- api_int
- stor_int
v6ip: ::1
v6netmask: 128
neth0:
dhcp: yes
dns_nameservers:
- 10.15.20.30
gateway: 192.168.211.1
hwaddr: 08:00:27:9c:a3:22
ip: 10.0.2.15
netmask: 255.255.255.0
shared_ip:
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
neth1:
cluster_sets:
- default
hwaddr: da:52:ca:90:8f:63
ip: 192.168.255.251
netmask: 255.255.255.248
shared_ip:
- 192.168.255.250
shared_v6ip:
type:
- ssh_ext
- ha_int
- boot_int
- sip_int
- rtp_int
neth2:
hwaddr: 0a:00:27:45:bb:ce
ip: 192.168.2.173
netmask: 255.255.255.0
shared_ip:
- 192.168.2.151
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
- sip_ext
- rtp_ext
- mon_ext
peer: sp2
role:
- proxy
- lb
- mgmt
- rtp
- db
- storage
status: online
swraiddevices: []
sysdescr: ''
syslocation: ''
sysname: ''
sp2:
dbnode: '2'
interfaces:
- lo
- neth0
- neth1
- neth2
lo:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- api_int
- stor_int
- web_int
- web_ext
- aux_ext
v6ip: ::1
neth0:
dhcp: yes
dns_nameservers:
- 10.15.20.30
gateway: 192.168.211.1
hwaddr: 08:00:27:75:e6:93
ip: 10.0.3.15
netmask: 255.255.255.0
shared_ip:
shared_v6ip:
type:
- ssh_ext
- web_int
- web_ext
neth1:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 192.168.255.252
netmask: 255.255.255.248
shared_ip:
- 192.168.255.250
shared_v6ip:
type:
- ssh_ext
- ha_int
- boot_int
- sip_int
- rtp_int
neth2:
hwaddr: 0a:00:27:45:bb:66
ip: 192.168.2.177
netmask: 255.255.255.0
shared_ip:
- 192.168.2.151
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
- sip_ext
- rtp_ext
- mon_ext
peer: sp1
role:
- storage
- proxy
- lb
- mgmt
- rtp
- db
status: online
swraiddevices: []
sysdescr: ''
syslocation: ''
sysname: ''
instances:
- name: A
service: kamailio-lb
host: sp3
status: online
label: lb
interfaces:
- name: neth2
ip: 192.168.2.250
type:
- sip_ext
- name: neth1
ip: 192.168.255.253
type:
- sip_int
connections:
- name: proxy
algorithm: serial
links:
- type: instance
name: C
interfaces:
- name: neth1
type: sip_int
- name: B
service: kamailio-lb
host: sp1
label: lb
status: online
interfaces:
- name: neth2
ip: 192.168.2.251
type:
- sip_ext
- name: neth1
ip: 192.168.255.254
type:
- sip_int
connections:
- name: proxy
algorithm: serial
links:
- type: host
name: sp2
interfaces:
- name: neth1
type: sip_int
- name: C
service: kamailio-proxy
host: sp1
status: online
label: proxy
interfaces:
- name: neth1
ip: 192.168.255.249
type:
- sip_int
- name: D
service: sems-b2b
host: sp1
label: b2b
status: online
interfaces:
- name: neth1
ip: 192.168.255.205
type:
- sip_int
connections:
- name: proxy
links:
- type: instance
name: PROXD
interfaces:
- name: neth1
type: sip_int
- name: lb
links:
- type: instance
name: LBB
interfaces:
- name: neth1
type: sip_int
- name: neth2
type: sip_ext

@ -1,243 +0,0 @@
---
hosts:
sp1:
dbnode: '1'
interfaces:
- lo
- neth0
- neth1
- neth2
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- web_ext
- web_int
- aux_ext
- ssh_ext
- api_int
- stor_int
v6ip: ::1
v6netmask: 128
neth0:
dhcp: yes
dns_nameservers:
- 10.15.20.30
gateway: 192.168.211.1
hwaddr: 08:00:27:9c:a3:22
ip: 10.0.2.15
netmask: 255.255.255.0
shared_ip:
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
neth1:
cluster_sets:
- default
hwaddr: da:52:ca:90:8f:63
ip: 192.168.255.251
netmask: 255.255.255.248
shared_ip:
- 192.168.255.250
shared_v6ip:
type:
- ssh_ext
- ha_int
- boot_int
- sip_int
- rtp_int
neth2:
hwaddr: 0a:00:27:45:bb:ce
ip: 192.168.2.173
netmask: 255.255.255.0
shared_ip:
- 192.168.2.151
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
- sip_ext
- rtp_ext
- mon_ext
peer: sp2
role:
- proxy
- lb
- mgmt
- rtp
- db
- storage
status: online
swraiddevices: []
sysdescr: ''
syslocation: ''
sysname: ''
sp2:
dbnode: '2'
interfaces:
- lo
- neth0
- neth1
- neth2
lo:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- api_int
- stor_int
- web_int
- web_ext
- aux_ext
v6ip: ::1
neth0:
dhcp: yes
dns_nameservers:
- 10.15.20.30
gateway: 192.168.211.1
hwaddr: 08:00:27:75:e6:93
ip: 10.0.3.15
netmask: 255.255.255.0
shared_ip:
shared_v6ip:
type:
- ssh_ext
- web_int
- web_ext
neth1:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 192.168.255.252
netmask: 255.255.255.248
shared_ip:
- 192.168.255.250
shared_v6ip:
type:
- ssh_ext
- ha_int
- boot_int
- sip_int
- rtp_int
neth2:
hwaddr: 0a:00:27:45:bb:66
ip: 192.168.2.177
netmask: 255.255.255.0
shared_ip:
- 192.168.2.151
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
- sip_ext
- rtp_ext
- mon_ext
peer: sp1
role:
- storage
- proxy
- lb
- mgmt
- rtp
- db
status: online
swraiddevices: []
sysdescr: ''
syslocation: ''
sysname: ''
instances:
- name: A
service: kamailio-lb
host: sp2
status: online
label: lb
interfaces:
- name: neth2
ip: 192.168.2.250
type:
- sip_ext
- name: neth1
ip: 192.168.255.253
type:
- sip_int
connections:
- name: proxy
algorithm: serial
links:
- type: instance
name: C
interfaces:
- name: neth1
type: sip_int
- name: A
service: kamailio-lb
host: sp1
label: lb
status: online
interfaces:
- name: neth2
ip: 192.168.2.251
type:
- sip_ext
- name: neth1
ip: 192.168.255.254
type:
- sip_int
connections:
- name: proxy
algorithm: serial
links:
- type: host
name: sp2
interfaces:
- name: neth1
type: sip_int
- name: C
service: kamailio-proxy
host: sp1
status: online
label: proxy
interfaces:
- name: neth1
ip: 192.168.255.249
type:
- sip_int
- name: D
service: sems-b2b
host: sp1
label: b2b
status: online
interfaces:
- name: neth1
ip: 192.168.255.205
type:
- sip_int
connections:
- name: proxy
links:
- type: instance
name: C
interfaces:
- name: neth1
type: sip_int
- name: lb
links:
- type: instance
name: A
interfaces:
- name: neth1
type: sip_int
- name: neth2
type: sip_ext

@ -1,243 +0,0 @@
---
hosts:
sp1:
dbnode: '1'
interfaces:
- lo
- neth0
- neth1
- neth2
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- web_ext
- web_int
- aux_ext
- ssh_ext
- api_int
- stor_int
v6ip: ::1
v6netmask: 128
neth0:
dhcp: yes
dns_nameservers:
- 10.15.20.30
gateway: 192.168.211.1
hwaddr: 08:00:27:9c:a3:22
ip: 10.0.2.15
netmask: 255.255.255.0
shared_ip:
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
neth1:
cluster_sets:
- default
hwaddr: da:52:ca:90:8f:63
ip: 192.168.255.251
netmask: 255.255.255.248
shared_ip:
- 192.168.255.250
shared_v6ip:
type:
- ssh_ext
- ha_int
- boot_int
- sip_int
- rtp_int
neth2:
hwaddr: 0a:00:27:45:bb:ce
ip: 192.168.2.173
netmask: 255.255.255.0
shared_ip:
- 192.168.2.151
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
- sip_ext
- rtp_ext
- mon_ext
peer: sp2
role:
- proxy
- lb
- mgmt
- rtp
- db
- storage
status: online
swraiddevices: []
sysdescr: ''
syslocation: ''
sysname: ''
sp2:
dbnode: '2'
interfaces:
- lo
- neth0
- neth1
- neth2
lo:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- api_int
- stor_int
- web_int
- web_ext
- aux_ext
v6ip: ::1
neth0:
dhcp: yes
dns_nameservers:
- 10.15.20.30
gateway: 192.168.211.1
hwaddr: 08:00:27:75:e6:93
ip: 10.0.3.15
netmask: 255.255.255.0
shared_ip:
shared_v6ip:
type:
- ssh_ext
- web_int
- web_ext
neth1:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 192.168.255.252
netmask: 255.255.255.248
shared_ip:
- 192.168.255.250
shared_v6ip:
type:
- ssh_ext
- ha_int
- boot_int
- sip_int
- rtp_int
neth2:
hwaddr: 0a:00:27:45:bb:66
ip: 192.168.2.177
netmask: 255.255.255.0
shared_ip:
- 192.168.2.151
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
- sip_ext
- rtp_ext
- mon_ext
peer: sp1
role:
- storage
- proxy
- lb
- mgmt
- rtp
- db
status: online
swraiddevices: []
sysdescr: ''
syslocation: ''
sysname: ''
instances:
- name: A
service: kamailio-lb
host: sp2
status: online
label: lb
interfaces:
- name: neth2
ip: 192.168.2.250
type:
- sip_ext
- name: neth1
ip: 192.168.255.253
type:
- sip_int
connections:
- name: proxy
algorithm: serial
links:
- type: instance
name: C
interfaces:
- name: neth1
type: sip_int
- name: B
service: kamailio-lb
host: sp1
label: lb
status: online
interfaces:
- name: neth2
ip: 192.168.2.251
type:
- sip_ext
- name: neth1
ip: 192.168.255.254
type:
- sip_int
connections:
- name: proxy
algorithm: serial
links:
- type: host
name: sp2
interfaces:
- name: neth1
type: sip_int
- name: C
service: kamailio-proxy
host: sp1
status: online
label: proxy
interfaces:
- name: neth1
ip: 192.168.255.249
type:
- sip_int
- name: D
service: sems-b2b
host: sp1
label: b2b
status: online
interfaces:
- name: neth1
ip: 192.168.255.205
type:
- sip_int
connections:
- name: proxy
links:
- type: instance
name: C
interfaces:
- name: neth1
type: sip_int
- name: proxy
links:
- type: instance
name: A
interfaces:
- name: neth1
type: sip_int
- name: neth2
type: sip_ext

@ -1,216 +0,0 @@
---
hosts:
sp1:
dbnode: '1'
interfaces:
- lo
- neth0
- neth1
- neth2
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- web_ext
- web_int
- aux_ext
- ssh_ext
- api_int
- stor_int
v6ip: ::1
v6netmask: 128
neth0:
dhcp: yes
dns_nameservers:
- 10.15.20.30
gateway: 192.168.211.1
hwaddr: 08:00:27:9c:a3:22
ip: 10.0.2.15
netmask: 255.255.255.0
shared_ip:
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
neth1:
cluster_sets:
- default
hwaddr: da:52:ca:90:8f:63
ip: 192.168.255.251
netmask: 255.255.255.248
shared_ip:
- 192.168.255.250
shared_v6ip:
type:
- ssh_ext
- ha_int
- boot_int
- sip_int
- rtp_int
neth2:
hwaddr: 0a:00:27:45:bb:ce
ip: 192.168.2.173
netmask: 255.255.255.0
shared_ip:
- 192.168.2.151
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
- sip_ext
- rtp_ext
- mon_ext
peer: sp2
role:
- proxy
- lb
- mgmt
- rtp
- db
- storage
status: online
swraiddevices: []
sysdescr: ''
syslocation: ''
sysname: ''
sp2:
dbnode: '2'
interfaces:
- lo
- neth0
- neth1
- neth2
lo:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- api_int
- stor_int
- web_int
- web_ext
- aux_ext
v6ip: ::1
neth0:
dhcp: yes
dns_nameservers:
- 10.15.20.30
gateway: 192.168.211.1
hwaddr: 08:00:27:75:e6:93
ip: 10.0.3.15
netmask: 255.255.255.0
shared_ip:
shared_v6ip:
type:
- ssh_ext
- web_int
- web_ext
neth1:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 192.168.255.252
netmask: 255.255.255.248
shared_ip:
- 192.168.255.250
shared_v6ip:
type:
- ssh_ext
- ha_int
- boot_int
- sip_int
- rtp_int
neth2:
hwaddr: 0a:00:27:45:bb:66
ip: 192.168.2.177
netmask: 255.255.255.0
shared_ip:
- 192.168.2.151
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
- sip_ext
- rtp_ext
- mon_ext
peer: sp1
role:
- storage
- proxy
- lb
- mgmt
- rtp
- db
status: online
swraiddevices: []
sysdescr: ''
syslocation: ''
sysname: ''
instances:
- name: A
service: kamailio-lb
host: sp2
status: online
label: lb
interfaces:
- name: neth2
ip: 192.168.2.250
type:
- sip_ext
- name: neth1
ip: 192.168.255.253
type:
- sip_int
connections:
- name: proxy
algorithm: serial
links:
- type: instance
name: fake
interfaces:
- name: neth1
type: sip_int
- name: B
service: kamailio-lb
host: sp1
label: lb
status: online
interfaces:
- name: neth2
ip: 192.168.2.251
type:
- sip_ext
- name: neth1
ip: 192.168.255.254
type:
- sip_int
connections:
- name: proxy
algorithm: serial
links:
- type: host
name: sp3
interfaces:
- name: neth1
type: sip_int
- name: C
service: kamailio-proxy
host: sp1
status: online
label: proxy
interfaces:
- name: neth1
ip: 192.168.255.249
type:
- sip_int

@ -1,216 +0,0 @@
---
hosts:
sp1:
dbnode: '1'
interfaces:
- lo
- neth0
- neth1
- neth2
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- web_ext
- web_int
- aux_ext
- ssh_ext
- api_int
- stor_int
v6ip: ::1
v6netmask: 128
neth0:
dhcp: yes
dns_nameservers:
- 10.15.20.30
gateway: 192.168.211.1
hwaddr: 08:00:27:9c:a3:22
ip: 10.0.2.15
netmask: 255.255.255.0
shared_ip:
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
neth1:
cluster_sets:
- default
hwaddr: da:52:ca:90:8f:63
ip: 192.168.255.251
netmask: 255.255.255.248
shared_ip:
- 192.168.255.250
shared_v6ip:
type:
- ssh_ext
- ha_int
- boot_int
- sip_int
- rtp_int
neth2:
hwaddr: 0a:00:27:45:bb:ce
ip: 192.168.2.173
netmask: 255.255.255.0
shared_ip:
- 192.168.2.151
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
- sip_ext
- rtp_ext
- mon_ext
peer: sp2
role:
- proxy
- lb
- mgmt
- rtp
- db
- storage
status: online
swraiddevices: []
sysdescr: ''
syslocation: ''
sysname: ''
sp2:
dbnode: '2'
interfaces:
- lo
- neth0
- neth1
- neth2
lo:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- api_int
- stor_int
- web_int
- web_ext
- aux_ext
v6ip: ::1
neth0:
dhcp: yes
dns_nameservers:
- 10.15.20.30
gateway: 192.168.211.1
hwaddr: 08:00:27:75:e6:93
ip: 10.0.3.15
netmask: 255.255.255.0
shared_ip:
shared_v6ip:
type:
- ssh_ext
- web_int
- web_ext
neth1:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 192.168.255.252
netmask: 255.255.255.248
shared_ip:
- 192.168.255.250
shared_v6ip:
type:
- ssh_ext
- ha_int
- boot_int
- sip_int
- rtp_int
neth2:
hwaddr: 0a:00:27:45:bb:66
ip: 192.168.2.177
netmask: 255.255.255.0
shared_ip:
- 192.168.2.151
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
- sip_ext
- rtp_ext
- mon_ext
peer: sp1
role:
- storage
- proxy
- lb
- mgmt
- rtp
- db
status: online
swraiddevices: []
sysdescr: ''
syslocation: ''
sysname: ''
instances:
- name: A
service: kamailio-lb
host: sp2
status: online
label: lb
interfaces:
- name: neth2
ip: 192.168.2.250
type:
- sip_ext
- name: neth1
ip: 192.168.255.253
type:
- sip_int
connections:
- name: proxy
algorithm: serial
links:
- type: instance
name: C
interfaces:
- name: neth1
type: sip_X
- name: B
service: kamailio-lb
host: sp1
label: lb
status: online
interfaces:
- name: neth2
ip: 192.168.2.251
type:
- sip_ext
- name: neth1
ip: 192.168.255.254
type:
- sip_int
connections:
- name: proxy
algorithm: serial
links:
- type: host
name: sp2
interfaces:
- name: neth1
type: sip_X
- name: C
service: kamailio-proxy
host: sp1
status: online
label: proxy
interfaces:
- name: neth1
ip: 192.168.255.249
type:
- sip_int

@ -1,60 +0,0 @@
# directory name where ngcpcfg is managed through git
[ -n "${NGCPCTL_BASE:-}" ] || NGCPCTL_BASE="$(pwd)/"
[ -n "${NGCPCTL_MAIN:-}" ] || NGCPCTL_MAIN="${NGCPCTL_BASE}/fixtures/repos/"
[ -n "${NGCPCTL_CONFIG:-}" ] || NGCPCTL_CONFIG="${NGCPCTL_MAIN}/config.yml"
[ -n "${NODE_CONFIG:-}" ] || NODE_CONFIG="${NGCPCTL_MAIN}/config.node.yml"
[ -n "${PAIR_CONFIG:-}" ] || PAIR_CONFIG="${NGCPCTL_MAIN}/config.pair.yml"
[ -n "${HOST_CONFIG:-}" ] || HOST_CONFIG="${NGCPCTL_MAIN}/config.web01a.yml"
[ -n "${LOCAL_CONFIG:-}" ] || LOCAL_CONFIG="${NGCPCTL_MAIN}/constants_local_carrier.yml"
[ -n "${CONSTANTS_CONFIG:-}" ] || CONSTANTS_CONFIG="${NGCPCTL_MAIN}/constants.yml"
[ -n "${MAINTENANCE_CONFIG:-}" ] ||MAINTENANCE_CONFIG="${NGCPCTL_MAIN}/maintenance.yml"
[ -n "${NETWORK_CONFIG:-}" ] || NETWORK_CONFIG="${NGCPCTL_MAIN}/network_carrier_instances.yml"
[ -n "${RTP_INTERFACES_CONFIG:-}" ] || RTP_INTERFACES_CONFIG="/etc/ngcp-rtpengine-daemon/interfaces.yml"
[ -n "${EXTRA_CONFIG_DIR:-}" ] || EXTRA_CONFIG_DIR="${NGCPCTL_MAIN}/config.d/"
# configuration dirs that should be managed
[ -n "${CONFIG_POOL:-}" ] || CONFIG_POOL='/etc /var'
# location of templates
[ -n "${TEMPLATE_POOL_BASE:-}" ] || TEMPLATE_POOL_BASE="${NGCPCTL_MAIN}/templates"
# location of service definitions
[ -n "${SERVICES_POOL_BASE:-}" ] || SERVICES_POOL_BASE="${NGCPCTL_MAIN}/templates"
# location of sites info for templates
[ -n "${SITES_DIR:-}" ] || SITES_DIR="${NGCPCTL_MAIN}/sites"
[ -n "${SITES_CONFIG:-}" ] || SITES_CONFIG="${NGCPCTL_MAIN}/sites.yml"
# location of instances info for templates
[ -n "${TEMPLATE_INSTANCES:-}" ] || TEMPLATE_INSTANCES="${NGCPCTL_MAIN}/instances.yml"
# timestamp format for console output
[ -n "${TIME_FORMAT:-}" ] || TIME_FORMAT="+%F %T"
# Run-time state directory
[ -n "${RUN_DIR:-}" ] || RUN_DIR='/run'
# directory holding files for internal state of ngcpcfg
[ -n "${STATE_FILES_DIR:-}" ] || STATE_FILES_DIR='/var/lib/ngcpcfg/state/'
# validate configs using kwalify schema
[ -n "${VALIDATE_SCHEMA:-}" ] || VALIDATE_SCHEMA="false"
# file ownership and permissions for YML files
[ -n "${CONFIG_USER:-}" ] || CONFIG_USER="root"
[ -n "${CONFIG_GROUP:-}" ] || CONFIG_GROUP="_ngcp-admin"
[ -n "${CONFIG_CHMOD:-}" ] || CONFIG_CHMOD="0660"
[ -n "${CONSTANTS_CONFIG_USER:-}" ] || CONSTANTS_CONFIG_USER="root"
[ -n "${CONSTANTS_CONFIG_GROUP:-}" ] || CONSTANTS_CONFIG_GROUP="root"
[ -n "${CONSTANTS_CONFIG_CHMOD:-}" ] || CONSTANTS_CONFIG_CHMOD="0600"
[ -n "${MAINTENANCE_CONFIG_USER:-}" ] || MAINTENANCE_CONFIG_USER="root"
[ -n "${MAINTENANCE_CONFIG_GROUP:-}" ] || MAINTENANCE_CONFIG_GROUP="_ngcp-admin"
[ -n "${MAINTENANCE_CONFIG_CHMOD:-}" ] || MAINTENANCE_CONFIG_CHMOD="0660"
[ -n "${NETWORK_CONFIG_USER:-}" ] || NETWORK_CONFIG_USER="root"
[ -n "${NETWORK_CONFIG_GROUP:-}" ] || NETWORK_CONFIG_GROUP="_ngcp-admin"
[ -n "${NETWORK_CONFIG_CHMOD:-}" ] || NETWORK_CONFIG_CHMOD="0660"
[ -n "${HOST_FILE:-}" ] || HOST_FILE='.web01a'
[ -n "${PAIR_FILE:-}" ] || PAIR_FILE='.web01'
## END OF FILE #################################################################

@ -1,56 +0,0 @@
# directory name where ngcpcfg is managed through git
[ -n "${NGCPCTL_BASE:-}" ] || NGCPCTL_BASE="$(pwd)/"
[ -n "${NGCPCTL_MAIN:-}" ] || NGCPCTL_MAIN="${NGCPCTL_BASE}/fixtures/repos/"
[ -n "${NGCPCTL_CONFIG:-}" ] || NGCPCTL_CONFIG="${NGCPCTL_MAIN}/config.yml"
[ -n "${NODE_CONFIG:-}" ] || NODE_CONFIG="${NGCPCTL_MAIN}/config.node.yml"
[ -n "${PAIR_CONFIG:-}" ] || PAIR_CONFIG="${NGCPCTL_MAIN}/config.pair.yml"
[ -n "${HOST_CONFIG:-}" ] || HOST_CONFIG="${NGCPCTL_MAIN}/config.sp1.yml"
[ -n "${LOCAL_CONFIG:-}" ] || LOCAL_CONFIG="${NGCPCTL_MAIN}/constants_local_pro.yml"
[ -n "${CONSTANTS_CONFIG:-}" ] || CONSTANTS_CONFIG="${NGCPCTL_MAIN}/constants.yml"
[ -n "${MAINTENANCE_CONFIG:-}" ] || MAINTENANCE_CONFIG="${NGCPCTL_MAIN}/maintenance.yml"
[ -n "${NETWORK_CONFIG:-}" ] || NETWORK_CONFIG="${NGCPCTL_MAIN}/network_pro_instances.yml"
[ -n "${RTP_INTERFACES_CONFIG:-}" ] || RTP_INTERFACES_CONFIG="/etc/ngcp-rtpengine-daemon/interfaces.yml"
[ -n "${EXTRA_CONFIG_DIR:-}" ] || EXTRA_CONFIG_DIR="${NGCPCTL_MAIN}/config.d/"
# configuration dirs that should be managed
[ -n "${CONFIG_POOL:-}" ] || CONFIG_POOL='/etc /var'
# location of templates
[ -n "${TEMPLATE_POOL_BASE:-}" ] || TEMPLATE_POOL_BASE="${NGCPCTL_MAIN}/templates"
# location of service definitions
[ -n "${SERVICES_POOL_BASE:-}" ] || SERVICES_POOL_BASE="${NGCPCTL_MAIN}/templates"
# location of sites info for templates
[ -n "${SITES_DIR:-}" ] || SITES_DIR="${NGCPCTL_MAIN}/sites"
[ -n "${SITES_CONFIG:-}" ] || SITES_CONFIG="${NGCPCTL_MAIN}/sites.yml"
# timestamp format for console output
[ -n "${TIME_FORMAT:-}" ] || TIME_FORMAT="+%F %T"
# Run-time state directory
[ -n "${RUN_DIR:-}" ] || RUN_DIR='/run'
# directory holding files for internal state of ngcpcfg
[ -n "${STATE_FILES_DIR:-}" ] || STATE_FILES_DIR='/var/lib/ngcpcfg/state/'
# validate configs using kwalify schema
[ -n "${VALIDATE_SCHEMA:-}" ] || VALIDATE_SCHEMA="false"
# file ownership and permissions for YML files
[ -n "${CONFIG_USER:-}" ] || CONFIG_USER="root"
[ -n "${CONFIG_GROUP:-}" ] || CONFIG_GROUP="_ngcp-admin"
[ -n "${CONFIG_CHMOD:-}" ] || CONFIG_CHMOD="0660"
[ -n "${CONSTANTS_CONFIG_USER:-}" ] || CONSTANTS_CONFIG_USER="root"
[ -n "${CONSTANTS_CONFIG_GROUP:-}" ] || CONSTANTS_CONFIG_GROUP="root"
[ -n "${CONSTANTS_CONFIG_CHMOD:-}" ] || CONSTANTS_CONFIG_CHMOD="0600"
[ -n "${MAINTENANCE_CONFIG_USER:-}" ] || MAINTENANCE_CONFIG_USER="root"
[ -n "${MAINTENANCE_CONFIG_GROUP:-}" ] || MAINTENANCE_CONFIG_GROUP="_ngcp-admin"
[ -n "${MAINTENANCE_CONFIG_CHMOD:-}" ] || MAINTENANCE_CONFIG_CHMOD="0660"
[ -n "${NETWORK_CONFIG_USER:-}" ] || NETWORK_CONFIG_USER="root"
[ -n "${NETWORK_CONFIG_GROUP:-}" ] || NETWORK_CONFIG_GROUP="_ngcp-admin"
[ -n "${NETWORK_CONFIG_CHMOD:-}" ] || NETWORK_CONFIG_CHMOD="0660"
[ -n "${NODE_FILE:-}" ] || NODE_FILE='.sp1'
## END OF FILE #################################################################

@ -1,25 +0,0 @@
---
instance_info:
connections:
- algorithm: serial
links:
- interfaces:
- name: vlan1720
type: sip_int
name: C
type: instance
name: proxy
host: lb01b
interfaces:
- ip: 172.30.52.204
name: vlan1719
type:
- sip_ext
- ip: 172.30.52.146
name: vlan1720
type:
- sip_int
label: lb
name: A
service: kamailio-lb
status: online

@ -1,6 +0,0 @@
/etc/kamailio/lb:/etc/kamailio/lb_A:A
/etc/kamailio/lb:/etc/kamailio/lb_B:B
/etc/momo:/etc/momo_A:A
/etc/momo:/etc/momo_B:B
/etc/other/lb:/etc/other/lb_A:A
/etc/other/lb:/etc/other/lb_B:B

@ -1,2 +0,0 @@
/etc/kamailio/lb/db:/etc/kamailio/lb_A/db:A
/etc/kamailio/lb/db:/etc/kamailio/lb_B/db:B

@ -1,2 +0,0 @@
/etc/kamailio/lb:/etc/kamailio/lb_A:A
/etc/kamailio/lb:/etc/kamailio/lb_B:B

@ -1,6 +0,0 @@
/etc/kamailio/lb:/etc/kamailio/lb_A:A
/etc/kamailio/lb:/etc/kamailio/lb_B:B
/etc/momo:/etc/momo_A:A
/etc/momo:/etc/momo_B:B
/etc/other/lb:/etc/other/lb_A:A
/etc/other/lb:/etc/other/lb_B:B

@ -1,10 +0,0 @@
#!KAMAILIO
# lb01a
#!ifndef INSTANCE
# external interfaces
listen=udp:172.30.52.103:5060
listen=tcp:172.30.52.103:5060
#!else
# external interfaces
# internal interfaces
#!endif

@ -1,15 +0,0 @@
#!KAMAILIO
# lb01a
#!define INSTANCE A
#!ifndef INSTANCE
# external interfaces
listen=udp:172.30.52.103:5060
listen=tcp:172.30.52.103:5060
#!else
# external interfaces
listen=udp:172.30.52.204:5060
listen=tcp:172.30.52.204:5060
# internal interfaces
listen=udp:172.30.52.146:5060
listen=tcp:172.30.52.146:5060
#!endif

@ -1,15 +0,0 @@
#!KAMAILIO
# lb01a
#!define INSTANCE B
#!ifndef INSTANCE
# external interfaces
listen=udp:172.30.52.103:5060
listen=tcp:172.30.52.103:5060
#!else
# external interfaces
listen=udp:172.30.52.203:5060
listen=tcp:172.30.52.203:5060
# internal interfaces
listen=udp:172.30.52.145:5060
listen=tcp:172.30.52.145:5060
#!endif

@ -1,6 +0,0 @@
[rtpengineA]
host_ha_iface=vlan1721
peer_ha_iface=vlan1721
sip_int_ips=172.30.52.146
interface=ext/172.30.52.199

@ -1,9 +0,0 @@
CARRIER_LB_IP='172.30.52.135 172.30.52.145 172.30.52.146'
CARRIER_PRXS='prx01'
SIPADDRESS='172.30.52.132'
MGMT_SIP_IPS='172.30.52.141'
DISPATCHER_IPS="50;172.30.52.135;172.30.52.145;172.30.52.146 "
declare -A DISPATCHER_IDS=(
[default]=50
)

@ -0,0 +1,9 @@
CARRIER_LB_IP=''
CARRIER_PRXS='sp'
SIPADDRESS=''
MGMT_SIP_IPS='127.0.0.1'
DISPATCHER_IPS="50;127.0.0.1;127.0.0.1 "
declare -A DISPATCHER_IDS=(
[default]=50
)

@ -1,9 +0,0 @@
CARRIER_LB_IP='192.168.255.250 192.168.255.253 192.168.255.254'
CARRIER_PRXS='sp'
SIPADDRESS='192.168.255.250'
MGMT_SIP_IPS='192.168.255.250'
DISPATCHER_IPS="50;192.168.255.250;192.168.255.253;192.168.255.254 "
declare -A DISPATCHER_IDS=(
[default]=50
)

@ -1,3 +0,0 @@
# lb01a
# A
ip=172.30.52.150

@ -1,3 +0,0 @@
# lb01a
# B
ip=172.30.52.138

@ -1,3 +0,0 @@
# sp1
# A
ip=192.168.255.249

@ -1,3 +0,0 @@
# sp1
# B
ip=192.168.255.250

@ -30,7 +30,6 @@ CFG_KEYS = [
"CONSTANTS_CONFIG",
"MAINTENANCE_CONFIG",
"NETWORK_CONFIG",
"TEMPLATE_INSTANCES",
"EXTRA_CONFIG_DIR",
]
POOL_KEYS = [

@ -30,9 +30,6 @@ echo "SERVICES_POOL_BASE=${SERVICES_POOL_BASE:-}"
echo "SITES_DIR=${SITES_DIR:-}"
echo "SITES_CONFIG=${SITES_CONFIG:-}"
# location of instances info for templates
echo "TEMPLATE_INSTANCES=${TEMPLATE_INSTANCES:-}"
# timestamp format for console output
echo "TIME_FORMAT=${TIME_FORMAT:-}"

@ -1,14 +0,0 @@
---
sources:
- orig: etc/kamailio/lb
dest: etc/kamailio/lb_${INSTANCE_NAME}
label: lb
- orig: etc/other/lb
dest: etc/other/lb_${INSTANCE_NAME}
label: lb
- orig: etc/momo
dest: etc/momo_${INSTANCE_NAME}
label: lb
- orig: etc/rtpengine
dest: etc/rtpengine_${INSTANCE_NAME}
label: rtp

@ -1,834 +0,0 @@
---
hosts:
db01a:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
dbnode: '1'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1721
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
v6ip: ::1
peer: db01b
role:
- db
status: online
vlan1721:
hwaddr: AA:7C:C0:DA:85:45
ip: 172.30.52.180
netmask: 255.255.255.224
shared_ip:
- 172.30.52.179
type:
- ha_int
- ssh_ext
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.183
netmask: 255.255.255.0
shared_ip:
- 192.168.25.185
shared_v6ip: []
type:
- mon_ext
- ssh_ext
vlan_raw_device: bond0
db01b:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
dbnode: '2'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1721
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
v6ip: ::1
peer: db01a
role:
- db
status: online
vlan1721:
hwaddr: BE:3A:47:A7:11:0D
ip: 172.30.52.181
netmask: 255.255.255.224
shared_ip:
- 172.30.52.179
type:
- ssh_ext
- ha_int
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.184
netmask: 255.255.255.0
shared_ip:
- 192.168.25.185
shared_v6ip: []
type:
- ssh_ext
- mon_ext
vlan_raw_device: bond0
lb01a:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
dbnode: '3'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1719
- vlan1720
- vlan1721
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
v6ip: ::1
peer: lb01b
role:
- lb
status: online
vlan1719:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.104
netmask: 255.255.255.224
shared_ip:
- 172.30.52.103
type:
- sip_ext
vlan_raw_device: bond0
vlan1720:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.136
netmask: 255.255.255.224
shared_ip:
- 172.30.52.135
type:
- sip_int
vlan_raw_device: bond0
vlan1721:
hwaddr: 46:78:04:52:C2:6C
ip: 172.30.52.174
netmask: 255.255.255.224
shared_ip:
- 172.30.52.173
type:
- ha_int
- ssh_ext
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.186
netmask: 255.255.255.0
shared_ip:
- 192.168.25.188
shared_v6ip: []
type:
- mon_ext
- ssh_ext
vlan_raw_device: bond0
lb01b:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
dbnode: '4'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1719
- vlan1720
- vlan1721
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
v6ip: ::1
peer: lb01a
role:
- lb
status: online
vlan1719:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.105
netmask: 255.255.255.224
shared_ip:
- 172.30.52.103
type:
- sip_ext
vlan_raw_device: bond0
vlan1720:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.137
netmask: 255.255.255.224
shared_ip:
- 172.30.52.135
type:
- sip_int
vlan_raw_device: bond0
vlan1721:
hwaddr: F2:5A:F1:41:B7:57
ip: 172.30.52.175
netmask: 255.255.255.224
shared_ip:
- 172.30.52.173
type:
- ha_int
- ssh_ext
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.187
netmask: 255.255.255.0
shared_ip:
- 192.168.25.188
shared_v6ip: []
type:
- mon_ext
- ssh_ext
vlan_raw_device: bond0
prx01a:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
dbnode: '5'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1720
- vlan1721
- vlan1722
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
- rtp_int
v6ip: ::1
peer: prx01b
role:
- proxy
- rtp
status: online
vlan1720:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.133
netmask: 255.255.255.224
shared_ip:
- 172.30.52.132
type:
- sip_int
vlan_raw_device: bond0
vlan1721:
hwaddr: 1E:B7:5A:23:BD:FE
ip: 172.30.52.171
netmask: 255.255.255.224
shared_ip:
- 172.30.52.170
type:
- ha_int
- ssh_ext
vlan_raw_device: bond0
vlan1722:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.197
netmask: 255.255.255.240
shared_ip:
- 172.30.52.196
type:
- rtp_ext
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.189
netmask: 255.255.255.0
shared_ip:
- 192.168.25.191
shared_v6ip: []
type:
- mon_ext
- ssh_ext
vlan_raw_device: bond0
prx01b:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
dbnode: '6'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1720
- vlan1721
- vlan1722
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
- rtp_int
v6ip: ::1
peer: prx01a
role:
- proxy
- rtp
status: online
vlan1720:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.139
netmask: 255.255.255.224
shared_ip:
- 172.30.52.138
type:
- sip_int
vlan_raw_device: bond0
vlan1721:
hwaddr: 1A:E6:67:D3:B3:34
ip: 172.30.52.145
netmask: 255.255.255.224
shared_ip:
- 172.30.52.144
type:
- ha_int
- ssh_ext
vlan_raw_device: bond0
vlan1722:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.148
netmask: 255.255.255.240
shared_ip:
- 172.30.52.147
type:
- rtp_ext
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.190
netmask: 255.255.255.0
shared_ip:
- 192.168.25.191
shared_v6ip: []
type:
- mon_ext
- ssh_ext
vlan_raw_device: bond0
prx02a:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
dbnode: '7'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1720
- vlan1721
- vlan1722
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
- rtp_int
v6ip: ::1
peer: prx02b
role:
- proxy
- rtp
status: inactive
vlan1720:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.140
netmask: 255.255.255.224
shared_ip:
- 172.30.52.138
type:
- sip_int
vlan_raw_device: bond0
vlan1721:
hwaddr: 1E:B7:5A:23:BD:FA
ip: 172.30.52.146
netmask: 255.255.255.224
shared_ip:
- 172.30.52.144
type:
- ha_int
- ssh_ext
vlan_raw_device: bond0
vlan1722:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.149
netmask: 255.255.255.240
shared_ip:
- 172.30.52.147
type:
- rtp_ext
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.192
netmask: 255.255.255.0
shared_ip:
- 192.168.25.194
shared_v6ip: []
type:
- mon_ext
- ssh_ext
vlan_raw_device: bond0
prx02b:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
dbnode: '8'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1720
- vlan1721
- vlan1722
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
- rtp_int
v6ip: ::1
peer: prx01a
role:
- proxy
- rtp
status: inactive
vlan1720:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.134
netmask: 255.255.255.224
shared_ip:
- 172.30.52.132
type:
- sip_int
vlan_raw_device: bond0
vlan1721:
hwaddr: 1A:E6:67:D3:B3:35
ip: 172.30.52.172
netmask: 255.255.255.224
shared_ip:
- 172.30.52.170
type:
- ha_int
- ssh_ext
vlan_raw_device: bond0
vlan1722:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.198
netmask: 255.255.255.240
shared_ip:
- 172.30.52.196
type:
- rtp_ext
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.193
netmask: 255.255.255.0
shared_ip:
- 192.168.25.194
shared_v6ip: []
type:
- mon_ext
- ssh_ext
vlan_raw_device: bond0
web01a:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
hwaddr: 00:00:00:00:00:00
ip: 192.168.1.2
netmask: 255.255.255.0
shared_ip:
- 192.168.1.1
type:
- boot_int
dbnode: '9'
eth0:
hwaddr: 00:00:00:00:00:00
type:
- web_ext
- web_int
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1718
- vlan1720
- vlan1721
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
v6ip: ::1
peer: web01b
role:
- mgmt
status: online
vlan1718:
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.69
netmask: 255.255.255.224
shared_ip:
- 172.30.52.68
type:
- web_ext
vlan_raw_device: bond0
vlan1720:
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.142
netmask: 255.255.255.224
shared_ip:
- 172.30.52.141
type:
- sip_int
vlan_raw_device: bond0
vlan1721:
hwaddr: E2:67:FE:AB:0B:DE
ip: 172.30.52.168
netmask: 255.255.255.224
shared_ip:
- 172.30.52.167
type:
- ha_int
- web_int
- ssh_ext
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.180
netmask: 255.255.255.0
shared_ip:
- 192.168.25.182
shared_v6ip: []
type:
- mon_ext
- ssh_ext
vlan_raw_device: bond0
web01b:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
hwaddr: 00:00:00:00:00:00
ip: 192.168.1.3
netmask: 255.255.255.0
shared_ip:
- 192.168.1.1
type:
- boot_int
dbnode: '10'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1718
- vlan1720
- vlan1721
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
v6ip: ::1
peer: web01a
role:
- mgmt
status: online
vlan1718:
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.70
netmask: 255.255.255.224
shared_ip:
- 172.30.52.68
type:
- web_ext
vlan_raw_device: bond0
vlan1720:
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.143
netmask: 255.255.255.224
shared_ip:
- 172.30.52.141
type:
- sip_int
vlan_raw_device: bond0
vlan1721:
hwaddr: 3A:79:8B:6A:A7:01
ip: 172.30.52.169
netmask: 255.255.255.224
shared_ip:
- 172.30.52.167
type:
- ssh_ext
- ha_int
- web_int
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.181
netmask: 255.255.255.0
shared_ip:
- 192.168.25.182
shared_v6ip: []
type:
- ssh_ext
- mon_ext
vlan_raw_device: bond0
instances:
- name: A
service: kamailio-lb
host: lb01b
status: online
label: lb
interfaces:
- name: vlan1719
ip: 172.30.52.204
type:
- sip_ext
- name: vlan1720
ip: 172.30.52.146
type:
- sip_int
connections:
- name: proxy
algorithm: serial
links:
- type: instance
name: C
interfaces:
- name: vlan1720
type: sip_int
- name: B
service: kamailio-lb
host: lb01a
label: lb
status: online
interfaces:
- name: vlan1719
ip: 172.30.52.203
type:
- sip_ext
- name: vlan1720
ip: 172.30.52.145
type:
- sip_int
connections:
- name: proxy
algorithm: serial
links:
- type: host
name: prx01b
interfaces:
- name: vlan1720
type: sip_int
- name: C
service: kamailio-proxy
host: prx01a
status: online
label: proxy
interfaces:
- name: vlan1720
ip: 172.30.52.150
type:
- sip_int

@ -1,768 +0,0 @@
---
hosts:
db01a:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
dbnode: '1'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1721
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
v6ip: ::1
peer: db01b
role:
- db
status: online
vlan1721:
hwaddr: AA:7C:C0:DA:85:45
ip: 172.30.52.180
netmask: 255.255.255.224
shared_ip:
- 172.30.52.179
type:
- ha_int
- ssh_ext
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.183
netmask: 255.255.255.0
shared_ip:
- 192.168.25.185
shared_v6ip: []
type:
- mon_ext
- ssh_ext
vlan_raw_device: bond0
db01b:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
dbnode: '2'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1721
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
v6ip: ::1
peer: db01a
role:
- db
status: online
vlan1721:
hwaddr: BE:3A:47:A7:11:0D
ip: 172.30.52.181
netmask: 255.255.255.224
shared_ip:
- 172.30.52.179
type:
- ssh_ext
- ha_int
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.184
netmask: 255.255.255.0
shared_ip:
- 192.168.25.185
shared_v6ip: []
type:
- ssh_ext
- mon_ext
vlan_raw_device: bond0
lb01a:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
dbnode: '3'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1719
- vlan1720
- vlan1721
- vlan1722
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
v6ip: ::1
peer: lb01b
role:
- lb
status: online
vlan1719:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.104
netmask: 255.255.255.224
shared_ip:
- 172.30.52.103
type:
- sip_ext
vlan_raw_device: bond0
vlan1720:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.136
netmask: 255.255.255.224
shared_ip:
- 172.30.52.135
type:
- sip_int
- rtp_int
vlan_raw_device: bond0
vlan1721:
hwaddr: 46:78:04:52:C2:6C
ip: 172.30.52.174
netmask: 255.255.255.224
shared_ip:
- 172.30.52.173
type:
- ha_int
- ssh_ext
vlan_raw_device: bond0
vlan1722:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.197
netmask: 255.255.255.240
shared_ip:
- 172.30.52.196
type:
- rtp_ext
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.186
netmask: 255.255.255.0
shared_ip:
- 192.168.25.188
shared_v6ip: []
type:
- mon_ext
- ssh_ext
vlan_raw_device: bond0
lb01b:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
dbnode: '4'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1719
- vlan1720
- vlan1721
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
v6ip: ::1
peer: lb01a
role:
- lb
status: online
vlan1719:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.105
netmask: 255.255.255.224
shared_ip:
- 172.30.52.103
type:
- sip_ext
vlan_raw_device: bond0
vlan1720:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.137
netmask: 255.255.255.224
shared_ip:
- 172.30.52.135
type:
- sip_int
- rtp_int
vlan_raw_device: bond0
vlan1721:
hwaddr: F2:5A:F1:41:B7:57
ip: 172.30.52.175
netmask: 255.255.255.224
shared_ip:
- 172.30.52.173
type:
- ha_int
- ssh_ext
vlan_raw_device: bond0
vlan1722:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.149
netmask: 255.255.255.240
shared_ip:
- 172.30.52.147
type:
- rtp_ext
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.187
netmask: 255.255.255.0
shared_ip:
- 192.168.25.188
shared_v6ip: []
type:
- mon_ext
- ssh_ext
vlan_raw_device: bond0
prx01a:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
dbnode: '5'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1720
- vlan1721
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
v6ip: ::1
peer: prx01b
role:
- proxy
- rtp
status: online
vlan1720:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.133
netmask: 255.255.255.224
shared_ip:
- 172.30.52.132
type:
- sip_int
vlan_raw_device: bond0
vlan1721:
hwaddr: 1E:B7:5A:23:BD:FE
ip: 172.30.52.171
netmask: 255.255.255.224
shared_ip:
- 172.30.52.170
type:
- ha_int
- ssh_ext
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.189
netmask: 255.255.255.0
shared_ip:
- 192.168.25.191
shared_v6ip: []
type:
- mon_ext
- ssh_ext
vlan_raw_device: bond0
prx01b:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
dbnode: '6'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1720
- vlan1721
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
v6ip: ::1
peer: prx01a
role:
- proxy
- rtp
status: online
vlan1720:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.139
netmask: 255.255.255.224
shared_ip:
- 172.30.52.138
type:
- sip_int
vlan_raw_device: bond0
vlan1721:
hwaddr: 1A:E6:67:D3:B3:34
ip: 172.30.52.145
netmask: 255.255.255.224
shared_ip:
- 172.30.52.144
type:
- ha_int
- ssh_ext
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.190
netmask: 255.255.255.0
shared_ip:
- 192.168.25.191
shared_v6ip: []
type:
- mon_ext
- ssh_ext
vlan_raw_device: bond0
prx02a:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
dbnode: '7'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1720
- vlan1721
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
v6ip: ::1
peer: prx02b
role:
- proxy
- rtp
status: inactive
vlan1720:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.140
netmask: 255.255.255.224
shared_ip:
- 172.30.52.138
type:
- sip_int
vlan_raw_device: bond0
vlan1721:
hwaddr: 1E:B7:5A:23:BD:FA
ip: 172.30.52.146
netmask: 255.255.255.224
shared_ip:
- 172.30.52.144
type:
- ha_int
- ssh_ext
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.192
netmask: 255.255.255.0
shared_ip:
- 192.168.25.194
shared_v6ip: []
type:
- mon_ext
- ssh_ext
vlan_raw_device: bond0
prx02b:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
dbnode: '8'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1720
- vlan1721
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
v6ip: ::1
peer: prx01a
role:
- proxy
- rtp
status: inactive
vlan1720:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.134
netmask: 255.255.255.224
shared_ip:
- 172.30.52.132
type:
- sip_int
vlan_raw_device: bond0
vlan1721:
hwaddr: 1A:E6:67:D3:B3:35
ip: 172.30.52.172
netmask: 255.255.255.224
shared_ip:
- 172.30.52.170
type:
- ha_int
- ssh_ext
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.193
netmask: 255.255.255.0
shared_ip:
- 192.168.25.194
shared_v6ip: []
type:
- mon_ext
- ssh_ext
vlan_raw_device: bond0
web01a:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
hwaddr: 00:00:00:00:00:00
ip: 192.168.1.2
netmask: 255.255.255.0
shared_ip:
- 192.168.1.1
type:
- boot_int
dbnode: '9'
eth0:
hwaddr: 00:00:00:00:00:00
type:
- web_ext
- web_int
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1718
- vlan1720
- vlan1721
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
v6ip: ::1
peer: web01b
role:
- mgmt
status: online
vlan1718:
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.69
netmask: 255.255.255.224
shared_ip:
- 172.30.52.68
type:
- web_ext
vlan_raw_device: bond0
vlan1720:
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.142
netmask: 255.255.255.224
shared_ip:
- 172.30.52.141
type:
- sip_int
vlan_raw_device: bond0
vlan1721:
hwaddr: E2:67:FE:AB:0B:DE
ip: 172.30.52.168
netmask: 255.255.255.224
shared_ip:
- 172.30.52.167
type:
- ha_int
- web_int
- ssh_ext
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.180
netmask: 255.255.255.0
shared_ip:
- 192.168.25.182
shared_v6ip: []
type:
- mon_ext
- ssh_ext
vlan_raw_device: bond0
web01b:
bond0:
bond_miimon: '100'
bond_mode: active-backup
bond_slaves: eth0 eth1
hwaddr: 00:00:00:00:00:00
ip: 192.168.1.3
netmask: 255.255.255.0
shared_ip:
- 192.168.1.1
type:
- boot_int
dbnode: '10'
eth0:
hwaddr: 00:00:00:00:00:00
eth1:
hwaddr: 00:00:00:00:00:00
interfaces:
- vlan300
- vlan1718
- vlan1720
- vlan1721
- lo
- eth0
- eth1
- bond0
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- ssh_ext
- api_int
v6ip: ::1
peer: web01a
role:
- mgmt
status: online
vlan1718:
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.70
netmask: 255.255.255.224
shared_ip:
- 172.30.52.68
type:
- web_ext
vlan_raw_device: bond0
vlan1720:
hwaddr: 00:00:00:00:00:00
ip: 172.30.52.143
netmask: 255.255.255.224
shared_ip:
- 172.30.52.141
type:
- sip_int
vlan_raw_device: bond0
vlan1721:
hwaddr: 3A:79:8B:6A:A7:01
ip: 172.30.52.169
netmask: 255.255.255.224
shared_ip:
- 172.30.52.167
type:
- ssh_ext
- ha_int
- web_int
vlan_raw_device: bond0
vlan300:
dns_nameservers:
- 92.42.136.30
- 92.42.136.31
gateway: 192.168.25.1
hwaddr: 00:00:00:00:00:00
ip: 192.168.25.181
netmask: 255.255.255.0
shared_ip:
- 192.168.25.182
shared_v6ip: []
type:
- ssh_ext
- mon_ext
vlan_raw_device: bond0
instances:
- name: A
service: ngcp-rtpengine-daemon
host: lb01b
status: online
label: rtp
interfaces:
- name: vlan1720
ip: 172.30.52.146
type:
- sip_int
- rtp_int
- name: vlan1722
ip: 172.30.52.199
type:
- rtp_ext

@ -1,216 +0,0 @@
---
hosts:
sp1:
dbnode: '1'
interfaces:
- lo
- neth0
- neth1
- neth2
lo:
advertised_ip: []
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- web_ext
- web_int
- aux_ext
- ssh_ext
- api_int
- stor_int
v6ip: ::1
v6netmask: 128
neth0:
dhcp: yes
dns_nameservers:
- 10.15.20.30
gateway: 192.168.211.1
hwaddr: 08:00:27:9c:a3:22
ip: 10.0.2.15
netmask: 255.255.255.0
shared_ip:
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
neth1:
cluster_sets:
- default
hwaddr: da:52:ca:90:8f:63
ip: 192.168.255.251
netmask: 255.255.255.248
shared_ip:
- 192.168.255.250
shared_v6ip:
type:
- ssh_ext
- ha_int
- boot_int
- sip_int
- rtp_int
neth2:
hwaddr: 0a:00:27:45:bb:ce
ip: 192.168.2.173
netmask: 255.255.255.0
shared_ip:
- 192.168.2.151
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
- sip_ext
- rtp_ext
- mon_ext
peer: sp2
role:
- proxy
- lb
- mgmt
- rtp
- db
- storage
status: online
swraiddevices: []
sysdescr: ''
syslocation: ''
sysname: ''
sp2:
dbnode: '2'
interfaces:
- lo
- neth0
- neth1
- neth2
lo:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 127.0.0.1
netmask: 255.0.0.0
shared_ip: []
shared_v6ip: []
type:
- api_int
- stor_int
- web_int
- web_ext
- aux_ext
v6ip: ::1
neth0:
dhcp: yes
dns_nameservers:
- 10.15.20.30
gateway: 192.168.211.1
hwaddr: 08:00:27:75:e6:93
ip: 10.0.3.15
netmask: 255.255.255.0
shared_ip:
shared_v6ip:
type:
- ssh_ext
- web_int
- web_ext
neth1:
cluster_sets:
- default
hwaddr: 00:00:00:00:00:00
ip: 192.168.255.252
netmask: 255.255.255.248
shared_ip:
- 192.168.255.250
shared_v6ip:
type:
- ssh_ext
- ha_int
- boot_int
- sip_int
- rtp_int
neth2:
hwaddr: 0a:00:27:45:bb:66
ip: 192.168.2.177
netmask: 255.255.255.0
shared_ip:
- 192.168.2.151
shared_v6ip:
type:
- ssh_ext
- web_ext
- web_int
- sip_ext
- rtp_ext
- mon_ext
peer: sp1
role:
- storage
- proxy
- lb
- mgmt
- rtp
- db
status: online
swraiddevices: []
sysdescr: ''
syslocation: ''
sysname: ''
instances:
- name: A
service: kamailio-lb
host: sp2
status: online
label: lb
interfaces:
- name: neth2
ip: 192.168.2.250
type:
- sip_ext
- name: neth1
ip: 192.168.255.253
type:
- sip_int
connections:
- name: proxy
algorithm: serial
links:
- type: instance
name: C
interfaces:
- name: neth1
type: sip_int
- name: B
service: kamailio-lb
host: sp1
label: lb
status: online
interfaces:
- name: neth2
ip: 192.168.2.251
type:
- sip_ext
- name: neth1
ip: 192.168.255.254
type:
- sip_int
connections:
- name: proxy
algorithm: serial
links:
- type: host
name: sp2
interfaces:
- name: neth1
type: sip_int
- name: C
service: kamailio-proxy
host: sp1
status: online
label: proxy
interfaces:
- name: neth1
ip: 192.168.255.249
type:
- sip_int

@ -16,14 +16,6 @@
PROCESS '../lib/get_all_shared_ips';
sip_lb_ips = out;
FOR instance IN instances;
NEXT UNLESS instance.service == 'kamailio-lb';
argv.type = 'sip_int';
argv.instance = instance;
PROCESS '../lib/get_all_ips_for_instance';
sip_lb_ips = out.merge(sip_lb_ips);
END;
argv.role='lb'; argv.type='sip_int';
PROCESS '../lib/get_all_cluster_set_shared_ip_maps';
UNLESS out.size;

@ -114,7 +114,7 @@ def test_template_pool_cli(ngcpcfgcli):
def test_config_cli(ngcpcfgcli):
"""test that templates are properly copied and configs defined in env"""
out = ngcpcfgcli(
"status", env={"NGCPCFG": "fixtures/ngcpcfg_carrier_instances.cfg"}
"status", env={"NGCPCFG": "fixtures/ngcpcfg_carrier.cfg"}
)
# NGCPCFG is always generated with env values and add as
# "${NGCPCTL_MAIN}/ngcpcfg.cfg".
@ -128,5 +128,5 @@ def test_config_cli(ngcpcfgcli):
assert tt2_path.exists()
assert (
Path(out.env["NETWORK_CONFIG"])
== Path("fixtures/repos/network_carrier_instances.yml").resolve()
== Path("fixtures/repos/network_carrier.yml").resolve()
)

@ -1,114 +0,0 @@
#!/usr/bin/env py.test-3
import re
import pytest
CMD = "../sbin/ngcp-instances-validator"
def test_help(cli):
cmd = [CMD, "--help"]
out = cli(*cmd)
assert out.exitcode == 0
def test_no_network(cli):
cmd = [CMD]
out = cli(*cmd)
assert out.exitcode != 0
assert re.search(
"Can't open '/etc/ngcp-config/network.yml' for input", out.stderr
)
def test_no_instances(cli):
cmd = [CMD, "--network-file=./fixtures/repos/network_pro.yml"]
out = cli(*cmd)
assert out.exitcode == 0
@pytest.mark.tt_168102
def test_pro_instances(cli):
cmd = [CMD, "--network-file=./fixtures/repos/network_pro_instances.yml"]
out = cli(*cmd)
assert out.exitcode == 0
def test_wrong_link(cli):
cmd = [CMD, "--network-file=./fixtures/instances-validator/wrong_link.yml"]
out = cli(*cmd)
assert out.exitcode != 0
msg = "Missing required instance for connection link"
assert re.search(
rf"\[instances/A/proxy/fake\] {msg}",
out.stderr,
)
msg = "Missing required host for connection link"
assert re.search(
rf"\[instances/B/proxy/sp3\] {msg}",
out.stderr,
)
def test_wrong_link_interfaces(cli):
file = "wrong_link_interfaces"
cmd = [
CMD,
f"--network-file=./fixtures/instances-validator/{file}.yml",
]
out = cli(*cmd)
assert out.exitcode != 0
msg = "Missing type sip_X on link interface"
assert re.search(
rf"\[instances/A/proxy/C/neth1\] {msg}",
out.stderr,
)
assert re.search(
rf"\[instances/B/proxy/sp2/neth1\] {msg}",
out.stderr,
)
def test_repeated_instance_name(cli):
file = "repeated_instance_name"
cmd = [
CMD,
f"--network-file=./fixtures/instances-validator/{file}.yml",
]
out = cli(*cmd)
assert out.exitcode != 0
msg = "Duplicate instance name with an existing instance A"
assert re.search(
rf"\[/instances/<name>\] {msg}",
out.stderr,
)
def test_repeated_instance_name_in_connections(cli):
file = "repeated_instance_name_in_connections"
cmd = [
CMD,
f"--network-file=./fixtures/instances-validator/{file}.yml",
]
out = cli(*cmd)
assert out.exitcode != 0
msg = "Duplicate connetion name #3 : D: proxy"
assert re.search(
rf"\[/instances/<name>\] {msg}",
out.stderr,
)
def test_host_to_run_on_is_absent(cli):
file = "host_to_run_on_is_absent"
cmd = [
CMD,
f"--network-file=./fixtures/instances-validator/{file}.yml",
]
out = cli(*cmd)
assert out.exitcode != 0
msg = "Missing required host sp3"
assert re.search(
rf"\[instances/A\] {msg}",
out.stderr,
)

@ -1,117 +0,0 @@
#!/usr/bin/env py.test-3
from pathlib import Path
import pytest
import re
import shutil
from fixtures.fs import check_stdoutput
def test_apply_instances(ngcpcfgcli, tmpdir):
commit_msg = "instance changes"
out = ngcpcfgcli(
"apply",
"--force-all-services",
commit_msg,
env={
"NGCP_HOSTNAME": "lb01a",
"TEMPLATE_POOL_BASE": "fixtures/build_instances",
"TEMPLATE_INSTANCES": "fixtures/repos/instances.yml",
"NGCPCFG": "fixtures/ngcpcfg_carrier_instances.cfg",
},
)
assert out.returncode == 0
assert not re.search(r"Error", out.stdout)
assert not re.search(r"Error", out.stderr)
base_dir = out.env["OUTPUT_DIRECTORY"]
output_file = base_dir.joinpath("ngcpcfg.service")
check_stdoutput("INSTANCE_NAME:\n", str(output_file), tmpdir)
assert re.search(
r"Executing action for .*/etc/kamailio/lb/ngcpcfg.services", out.stdout
)
output_file = base_dir.joinpath("ngcpcfg.serviceA")
check_stdoutput("INSTANCE_NAME:A\n", str(output_file), tmpdir)
assert re.search(
r"Executing action for .*/etc/kamailio/lb/ngcpcfg.services\[A\]",
out.stdout,
)
output_file = base_dir.joinpath("ngcpcfg.serviceB")
check_stdoutput("INSTANCE_NAME:B\n", str(output_file), tmpdir)
assert re.search(
r"Executing action for .*/etc/kamailio/lb/ngcpcfg.services\[B\]",
out.stdout,
)
def test_apply_instances_changes(ngcpcfg, ngcpcfgcli, tmpdir, gitrepo):
commit_msg = "instance changes for B"
env, cfg = ngcpcfg(
env={
"NGCP_HOSTNAME": "lb01a",
"TEMPLATE_POOL_BASE": "fixtures/apply_instances",
"TEMPLATE_INSTANCES": "fixtures/repos/instances.yml",
"NGCPCFG": "fixtures/ngcpcfg_carrier_instances.cfg",
}
)
base_dir = env["OUTPUT_DIRECTORY"]
base_git = Path(base_dir).joinpath("etc")
base_path = Path(base_dir).joinpath("etc/kamailio")
base_orig = Path("fixtures/output")
orig = [
("lb_kamailio_cfg_carrier", "lb"),
("lb_kamailio_cfg_instances_A", "lb_A"),
("lb_kamailio_cfg_instances_B", "lb_B"),
]
# put expected output of build_instances
with gitrepo.in_folder(base_git) as git:
# ensure we have valid user information
git.config("--local", "user.email", "pytest@example.com")
git.config("--local", "user.name", "pytest")
for file, dir in orig:
dst_path = base_path.joinpath(dir)
dst_path.mkdir(parents=True, exist_ok=True)
dst_file = dst_path.joinpath("kamailio.cfg")
shutil.copy(base_orig.joinpath(file), dst_file)
git.add(dst_file)
ex, out, err = git.commit("-a", "-m", "old conf done")
print("{}\nstdout:\n{}stderr:{}\n".format("git commit", out, err))
assert ex == 0
out = ngcpcfgcli(
"apply",
commit_msg,
env=env,
)
assert out.returncode == 0
assert re.search(
r"Executing action for .*/etc/kamailio/lb/ngcpcfg.services", out.stdout
)
assert not re.search(r"Error", out.stdout)
assert not re.search(r"Error", out.stderr)
output_file = base_dir.joinpath("ngcpcfg.service")
assert not output_file.exists()
assert not re.search(
r"Executing action for .*/etc/kamailio/lb/ngcpcfg.services$",
out.stdout,
)
output_file = base_dir.joinpath("ngcpcfg.serviceA")
assert not output_file.exists()
assert not re.search(
r"Executing action for .*/etc/kamailio/lb/ngcpcfg.services\[A\]$",
out.stdout,
)
output_file = base_dir.joinpath("ngcpcfg.serviceB")
check_stdoutput("INSTANCE_NAME:B\n", str(output_file), tmpdir)
assert re.search(
r"Executing action for .*/etc/kamailio/lb/ngcpcfg.services\[B\]",
out.stdout,
)

@ -1,149 +0,0 @@
#!/usr/bin/env py.test-3
import re
from fixtures.fs import check_output
from fixtures.fs import check_stdoutput
def test_build_instances(ngcpcfgcli):
out = ngcpcfgcli(
"build",
"--ignore-branch-check",
"/etc/kamailio",
env={
"NGCP_HOSTNAME": "lb01a",
"TEMPLATE_POOL_BASE": "fixtures/build_instances",
"TEMPLATE_INSTANCES": "fixtures/repos/instances.yml",
"NGCPCFG": "fixtures/ngcpcfg_carrier_instances.cfg",
},
)
assert re.search(
r"Generating .*/etc/kamailio/lb/kamailio.cfg: OK", out.stdout
)
assert not re.search(r"Error", out.stdout)
assert not re.search(r"Error", out.stderr)
base_dir = out.env["OUTPUT_DIRECTORY"]
output_file = base_dir.joinpath("etc/kamailio/lb/kamailio.cfg")
test_file = "fixtures/output/lb_kamailio_cfg_carrier"
check_output(str(output_file), test_file)
assert re.search(
r"Generating .*/etc/kamailio/lb_A/kamailio.cfg: OK", out.stdout
)
output_file = base_dir.joinpath("etc/kamailio/lb_A/kamailio.cfg")
test_file = "fixtures/output/lb_kamailio_cfg_instances_A"
check_output(str(output_file), test_file)
assert re.search(
r"Generating .*/etc/kamailio/lb_B/kamailio.cfg: OK", out.stdout
)
output_file = base_dir.joinpath("etc/kamailio/lb_B/kamailio.cfg")
test_file = "fixtures/output/lb_kamailio_cfg_instances_B"
check_output(str(output_file), test_file)
assert out.returncode == 0
def test_build_instance_customtt(ngcpcfgcli):
out = ngcpcfgcli(
"build",
"--ignore-branch-check",
"/etc/kamailio/lb/",
env={
"NGCP_HOSTNAME": "lb01a",
"TEMPLATE_POOL_BASE": "fixtures/build_instances",
"TEMPLATE_INSTANCES": "fixtures/repos/instances.yml",
"NGCPCFG": "fixtures/ngcpcfg_carrier_instances.cfg",
},
)
assert re.search(
r"Generating .*/etc/kamailio/lb_B/simple.cfg: OK", out.stdout
)
assert not re.search(r"Error", out.stdout)
assert not re.search(r"Error", out.stderr)
base_dir = out.env["OUTPUT_DIRECTORY"]
output_file = base_dir.joinpath("etc/kamailio/lb_B/simple.cfg")
test_file = "fixtures/output/lb_custom_cfg_instances_B"
check_output(str(output_file), test_file)
assert out.returncode == 0
def test_instances_info_noargs(helpercli, tmpdir):
out = helpercli(
"instances-info",
env={
"TEMPLATE_INSTANCES": "fixtures/repos/instances.yml",
"NETWORK_CONFIG": "fixtures/repos/network_carrier_instances.yml",
},
)
test_file = "fixtures/output/instances_info_noargs"
check_stdoutput(out.stdout, test_file, tmpdir)
assert out.returncode == 0
def test_instances_info_args(helpercli, tmpdir):
out = helpercli(
"instances-info",
"/etc",
env={
"TEMPLATE_INSTANCES": "fixtures/repos/instances.yml",
"NETWORK_CONFIG": "fixtures/repos/network_carrier_instances.yml",
},
)
test_file = "fixtures/output/instances_info_args"
check_stdoutput(out.stdout, test_file, tmpdir)
assert out.returncode == 0
def test_instances_info_args_same(helpercli, tmpdir):
out = helpercli(
"instances-info",
"/etc/kamailio/lb",
env={
"TEMPLATE_INSTANCES": "fixtures/repos/instances.yml",
"NETWORK_CONFIG": "fixtures/repos/network_carrier_instances.yml",
},
)
test_file = "fixtures/output/instances_info_args_same"
check_stdoutput(out.stdout, test_file, tmpdir)
assert out.returncode == 0
def test_instances_info_args_longer(helpercli, tmpdir):
out = helpercli(
"instances-info",
"/etc/kamailio/lb/db",
env={
"TEMPLATE_INSTANCES": "fixtures/repos/instances.yml",
"NETWORK_CONFIG": "fixtures/repos/network_carrier_instances.yml",
},
)
test_file = "fixtures/output/instances_info_args_longer"
check_stdoutput(out.stdout, test_file, tmpdir)
assert out.returncode == 0
def test_instances_info_relative_path(helpercli):
out = helpercli(
"instances-info",
"../lb/db",
env={
"TEMPLATE_INSTANCES": "fixtures/repos/instances.yml",
"NETWORK_CONFIG": "fixtures/repos/network_carrier_instances.yml",
},
)
assert out.returncode != 0

@ -1,42 +0,0 @@
#!/usr/bin/env py.test-3
from pathlib import Path
import pytest
import re
from fixtures.fs import check_stdoutput
def test_instance_info_noargs(helpercli):
out = helpercli(
"instance-info",
env={
"NETWORK_CONFIG": "fixtures/repos/network_carrier_instances.yml",
},
)
assert out.returncode != 0
assert "Error: wrong number of arguments" in out.stderr
def test_instances_info_no_instance(helpercli):
out = helpercli(
"instance-info",
"D",
env={
"NETWORK_CONFIG": "fixtures/repos/network_carrier_instances.yml",
},
)
assert out.returncode != 0
def test_instance_info(helpercli, tmpdir):
out = helpercli(
"instance-info",
"A",
env={
"NETWORK_CONFIG": "fixtures/repos/network_carrier_instances.yml",
},
)
test_file = "fixtures/output/instance_info_A"
assert out.returncode == 0
check_stdoutput(out.stdout, test_file, tmpdir)

@ -1,74 +0,0 @@
#!/usr/bin/env py.test-3
import re
from fixtures.fs import check_output
msg = r"Generating {}/etc/kamailio/lb{}/whatever.cfg: OK"
def test_carrier_instances(ngcpcfgcli):
out = ngcpcfgcli(
"build",
"--ignore-branch-check",
"/etc/kamailio/lb/whatever.cfg",
env={
"NGCP_HOSTNAME": "lb01a",
"TEMPLATE_POOL_BASE": "fixtures/build_instances",
"TEMPLATE_INSTANCES": "fixtures/repos/instances.yml",
"NGCPCFG": "fixtures/ngcpcfg_carrier_instances.cfg",
},
)
assert re.search(msg.format(out.env["OUTPUT_DIRECTORY"], ""), out.stdout)
output_file = out.env["OUTPUT_DIRECTORY"].joinpath(
"etc/kamailio/lb/whatever.cfg"
)
test_file = "fixtures/output/whatever.cfg_carrier"
check_output(str(output_file), test_file)
assert re.search(msg.format(out.env["OUTPUT_DIRECTORY"], "_A"), out.stdout)
output_file = out.env["OUTPUT_DIRECTORY"].joinpath(
"etc/kamailio/lb_A/whatever.cfg"
)
test_file = "fixtures/output/whatever.cfg_carrier_instances_A"
check_output(str(output_file), test_file)
assert re.search(msg.format(out.env["OUTPUT_DIRECTORY"], "_B"), out.stdout)
output_file = out.env["OUTPUT_DIRECTORY"].joinpath(
"etc/kamailio/lb_B/whatever.cfg"
)
test_file = "fixtures/output/whatever.cfg_carrier_instances_B"
check_output(str(output_file), test_file)
def test_pro_instances(ngcpcfgcli):
out = ngcpcfgcli(
"build",
"--ignore-branch-check",
"/etc/kamailio/lb/whatever.cfg",
env={
"NGCP_HOSTNAME": "sp1",
"TEMPLATE_POOL_BASE": "fixtures/build_instances",
"TEMPLATE_INSTANCES": "fixtures/repos/instances.yml",
"NGCPCFG": "fixtures/ngcpcfg_pro_instances.cfg",
},
)
assert re.search(msg.format(out.env["OUTPUT_DIRECTORY"], ""), out.stdout)
output_file = out.env["OUTPUT_DIRECTORY"].joinpath(
"etc/kamailio/lb/whatever.cfg"
)
test_file = "fixtures/output/whatever.cfg_pro"
check_output(str(output_file), test_file)
assert re.search(msg.format(out.env["OUTPUT_DIRECTORY"], "_A"), out.stdout)
output_file = out.env["OUTPUT_DIRECTORY"].joinpath(
"etc/kamailio/lb_A/whatever.cfg"
)
test_file = "fixtures/output/whatever.cfg_pro_instances_A"
check_output(str(output_file), test_file)
assert re.search(msg.format(out.env["OUTPUT_DIRECTORY"], "_B"), out.stdout)
output_file = out.env["OUTPUT_DIRECTORY"].joinpath(
"etc/kamailio/lb_B/whatever.cfg"
)
test_file = "fixtures/output/whatever.cfg_pro_instances_B"
check_output(str(output_file), test_file)

@ -1,34 +0,0 @@
#!/usr/bin/env py.test-3
import re
from fixtures.fs import check_output
filepath = "etc/rtpengine{}/rtpengine.conf"
msg = r"Generating {}/{}: OK"
env = {
"NGCP_HOSTNAME": "lb01a",
"TEMPLATE_POOL_BASE": "fixtures/build_instances",
"TEMPLATE_INSTANCES": "fixtures/repos/instances.yml",
"NGCPCFG": "fixtures/ngcpcfg_carrier_instances.cfg",
"NETWORK_CONFIG": "fixtures/repos/network_carrier_instances_rtp.yml",
}
def test_carrier_instances(ngcpcfgcli):
out = ngcpcfgcli(
"build",
"--ignore-branch-check",
"/etc/rtpengine/rtpengine.conf",
env=env,
)
rstr = msg.format(out.env["OUTPUT_DIRECTORY"], filepath.format(""))
assert re.search(rstr, out.stdout)
output_file = out.env["OUTPUT_DIRECTORY"].joinpath(filepath.format(""))
test_file = "fixtures/output/rtpengine.conf_carrier"
check_output(str(output_file), test_file)
rstr = msg.format(out.env["OUTPUT_DIRECTORY"], filepath.format("_A"))
assert re.search(rstr, out.stdout)
output_file = out.env["OUTPUT_DIRECTORY"].joinpath(filepath.format("_A"))
test_file = "fixtures/output/rtpengine.conf_instances_A"
check_output(str(output_file), test_file)

@ -23,31 +23,16 @@ def test_status_carrier(ngcpcfgcli):
check_output(str(output_file), test_file)
def test_status_carrier_instances(ngcpcfgcli):
def test_status_pro(ngcpcfgcli):
out = ngcpcfgcli(
"build",
"--ignore-branch-check",
"/etc/status.cfg",
env={
"NGCPCFG": "fixtures/ngcpcfg_carrier_instances.cfg",
"NGCPCFG": "fixtures/ngcpcfg_pro.cfg",
},
)
assert re.search(msg.format(out.env["OUTPUT_DIRECTORY"]), out.stdout)
output_file = out.env["OUTPUT_DIRECTORY"].joinpath("etc/status.cfg")
test_file = "fixtures/output/status.cfg_carrier_instances"
check_output(str(output_file), test_file)
def test_status_pro_instances(ngcpcfgcli):
out = ngcpcfgcli(
"build",
"--ignore-branch-check",
"/etc/status.cfg",
env={
"NGCPCFG": "fixtures/ngcpcfg_pro_instances.cfg",
},
)
assert re.search(msg.format(out.env["OUTPUT_DIRECTORY"]), out.stdout)
output_file = out.env["OUTPUT_DIRECTORY"].joinpath("etc/status.cfg")
test_file = "fixtures/output/status.cfg_pro_instances"
test_file = "fixtures/output/status.cfg_pro"
check_output(str(output_file), test_file)

@ -6,7 +6,7 @@ use warnings;
use Cwd;
use Test::More;
plan tests => 56;
plan tests => 54;
use_ok('NGCP::Template::Object');
@ -212,72 +212,3 @@ is($obj_ce->net_ip_expand('001:2::0005:020'),
is($obj_ce->net_ip_expand('1::0'),
'1:0:0:0:0:0:0:0',
'normalize IPv6 1::0');
## instances
delete $cfg_pro->{hosts}{sp3};
$cfg_pro->{hosts}{sp2}{peer} = 'sp1';
$cfg_pro->{hosts}{sp1}{interfaces} = [ qw(eth0 eth1) ];
$cfg_pro->{hosts}{sp1}{eth0} = {
ip => '172.16.7.1',
netmask => '255.255.255.0',
type => [ qw(ha_int sip_int) ],
};
$cfg_pro->{hosts}{sp1}{eth1} = {
cluster_set => [ 'default' ],
ip => '172.16.8.1',
netmask => '255.255.255.224',
type => [ 'sip_ext' ],
};
$cfg_pro->{hosts}{sp2}{interfaces} = [ qw(eth0 eth1) ];
$cfg_pro->{hosts}{sp2}{eth0} = {
ip => '172.16.7.2',
netmask => '255.255.255.0',
type => [ qw(ha_int sip_int) ],
};
$cfg_pro->{hosts}{sp2}{eth1} = {
cluster_set => [ 'default' ],
ip => '172.16.8.2',
netmask => '255.255.255.224',
type => [ 'sip_ext' ],
};
my $iface_A = [
{name => 'eth0', ip => '172.16.7.4', type => 'sip_int'},
{name => 'eth1', ip => '172.16.8.4', type => 'sip_ext'},
];
my $iface_B = [
{name => 'eth0', ip => '172.16.7.6', type => 'sip_int'},
{name => 'eth1', ip => '172.16.8.6', type => 'sip_ext'},
];
$cfg_pro->{instances} = [
{name => 'A', host => 'sp2', interfaces => $iface_A},
{name => 'B', host => 'sp3', interfaces => $iface_B},
];
$obj_pro = NGCP::Template::Object->new($cfg_pro);
# Check get_instances(hostname).
my $instances = [
{
name => 'A',
host => 'sp2',
interfaces => [
{
name => 'eth0',
ip => '172.16.7.4',
type => 'sip_int',
netmask => '255.255.255.0'
},
{
name => 'eth1',
ip => '172.16.8.4',
type => 'sip_ext',
netmask => '255.255.255.224',
cluster_set => ['default']
},
]
},
];
is_deeply($obj_pro->get_instances('sp1'), $instances,
'host sp1 has one instances defined');
is_deeply($obj_pro->get_instances('sp2'), $instances,
'host sp2 has one instances defined');

Loading…
Cancel
Save