You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ngcpcfg/lib/get_mgmt_node

21 lines
554 B

[%
# Returns the ngcp management node shared name.
#
# @return out The mgmt node shared name.
-%]
[% PROCESS '/usr/lib/ngcp-ngcpcfg/get_ngcp_type'; ngcp_type = out -%]
[% IF ngcp_type == 'carrier' -%]
[% FOREACH host IN hosts.keys -%]
[% argv.host=host; argv.role='mgmt';
PROCESS '/usr/lib/ngcp-ngcpcfg/has_role';
is_mgmt = out -%]
[% IF is_mgmt -%]
[% matches = host.match('^(\w+[0-9])[ab]?$') -%]
[% out = matches.0 -%]
[% LAST -%]
[% END -%]
[% END -%]
[% ELSE -%]
[% out = "sp" -%]
[% END -%]