@ -1,36 +1,13 @@
[%
PROCESS '/usr/lib/ngcp-ngcpcfg/get_hostname';
hostname = out;
argv.host = hostname;
argv.role = 'proxy';
PROCESS '/usr/lib/ngcp-ngcpcfg/has_role';
is_proxy = out;
argv.host = hostname;
argv.role = 'lb';
PROCESS '/usr/lib/ngcp-ngcpcfg/has_role';
is_lb = out;
argv.host = hostname;
argv.role = 'mgmt';
PROCESS '/usr/lib/ngcp-ngcpcfg/has_role';
is_mgmt = out;
argv.host = hostname;
argv.role = 'db';
PROCESS '/usr/lib/ngcp-ngcpcfg/has_role';
is_db = out;
argv.host = hostname;
argv.role = 'rtp';
PROCESS '/usr/lib/ngcp-ngcpcfg/has_role';
is_rtp = out;
argv.role = 'li';
PROCESS '/usr/lib/ngcp-ngcpcfg/has_role';
is_li = out;
is_li_enabled = is_li && cluster_sets.type == 'distributed' && intercept.enable == 'yes';
hostname = ngcp.get_hostname();
is_proxy = ngcp.has_role(hostname, 'proxy');
is_lb = ngcp.has_role(hostname, 'lb');
is_mgmt = ngcp.has_role(hostname, 'mgmt');
is_db = ngcp.has_role(hostname, 'db');
is_rtp = ngcp.has_role(hostname, 'rtp');
is_li = ngcp.has_role(hostname, 'li');
is_li_dist = is_li && cluster_sets.type == 'distributed' && intercept.enable == 'yes';
-%]
[% PERL -%]
my $node_state = qx(ngcp-check-active -v);
@ -102,7 +79,7 @@ service:
nginx.service:
enabled: [% nginx.enable == 'yes' ? 'true' : 'false' %]
running: [% (is_mgmt || is_li_enable d) && nginx.enable == 'yes' ? 'true' : 'false' %]
running: [% (is_mgmt || is_li_dist ) && nginx.enable == 'yes' ? 'true' : 'false' %]
prosody.service:
enabled: [% general.process_handler == 'none' && prosody.enable == 'yes' ? 'true' : 'false' %]