diff --git a/docs/ngcpcfg.txt b/docs/ngcpcfg.txt index 32ade6d3..3f55055f 100644 --- a/docs/ngcpcfg.txt +++ b/docs/ngcpcfg.txt @@ -58,14 +58,14 @@ $EDITOR, webfrontend,... * _/etc/ngcp-config/config.$NGCP_HOSTNAME.yml_: host specific configuration file, depending on the ngcp_hostname (:= $NGCP_HOSTNAME) of the system. -* _/etc/ngcp-config/config.$PAIRNAME.yml_: pair specific configuration file, -depending on the pairname (:= $PAIRNAME) of the system (for example _sp_ on +* _/etc/ngcp-config/config.$NGCP_PAIRNAME.yml_: pair specific configuration file, +depending on the pairname (:= $NGCP_PAIRNAME) of the system (for example _sp_ on CE/PRO or _web01_ on CARRIER). -* _/etc/ngcp-config/config.$HA_NODE.yml_: HA node specific configuration file, -depending on the HA node name of the system. $HA_NODE is determined using the -content of /etc/ngcp_ha_node (usually being _sp1_ for the first node and _sp2_ -for the second node). +* _/etc/ngcp-config/config.$NGCP_NODENAME.yml_: HA node specific configuration +file, depending on the HA node name of the system. $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 pair). * _/etc/ngcp-config/config.local.yml_: local configuration, not being host specific. @@ -94,14 +94,15 @@ Files with suffix '.cfg' inside this directory are sourced after [IMPORTANT] Configuration file priority: constants.yml takes precedence over all files in _/etc/ngcp-config/config.d/_, over config.local.yml, -over config.$NGCP_HOSTNAME.yml, over config.$PAIRNAME.yml, -over config.$HA_NODE.yml, over config.yml. +over config.$NGCP_HOSTNAME.yml, over config.$NGCP_PAIRNAME.yml, +over config.$NGCP_NODENAME.yml, over config.yml. High Availability specific configuration files ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* _/etc/ngcp_ha_node_: defines the node name in High Availability setups, usually -being _sp1_ for the first node and _sp2_ for the second node. +* _/etc/ngcp_nodename_: defines the node name in High Availability setups, +being _spce_ for CE systems, and _spN_ where N is the index of the node in +the pair. * _/etc/ngcp-config/systems.cfg_: configuration file that specifies to which hosts changes should be pushed to. @@ -119,25 +120,27 @@ 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.$HA_NODE_: node specific -template file. $HA_NODE is determined using the content of /etc/ngcp_ha_node -(usually being _sp1_ for the first node and _sp2_ for the second node on the -Sipwise Next Generation Platform). Whereas _*customtt.tt2_ files are used on all -nodes in a High Availability setup the _*.tt2.$HA_NODE*_ file is specific for -the single node only. A common use case is master vs. slave configuration of a -service. The configuration file is usually provided by a Debian package. +* _/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 +pair). +Whereas _*customtt.tt2_ files are used on all nodes in a High Availability +setup the, _*.tt2.$NGCP_NODENAME*_ file is specific for the single node only +of each pair. +A common use case is master vs. slave configuration of a service. +The configuration file is usually provided by a Debian package. Note: This feature is available in High Availability setups only. -* _/etc/ngcp-config/templates/etc/foobar/baz.tt2.$PAIRNAME_: pair specific +* _/etc/ngcp-config/templates/etc/foobar/baz.tt2.$NGCP_PAIRNAME_: pair specific template file. Given a PRO pair in a CARRIER environment where two nodes are -named _web01a_ and _web01b_ then $PAIRNAME corresponds to _web01_. This is +named _web01a_ and _web01b_ then $NGCP_PAIRNAME corresponds to _web01_. This is useful if there are multiple pairs available but only a specific pair of them should include some specific configuration. Note: This feature is available in High Availability setups only. * _/etc/ngcp-config/templates/etc/foobar/baz.tt2.$NGCP_HOSTNAME_: ngcp_hostname specific -template file. While $HA_NODE is usually bound to _sp1_ for the first node and -_sp2_ via /etc/ngcp_ha_node it's possible to use host specific template file by +template file. While $NGCP_NODENAME is usually bound to _sp1_ for the first node and +_sp2_ via __ngcp-nodename__, it's possible to use host specific template file by referring to its ngcp_hostname ($NGCP_HOSTNAME is determined via ngcp-hostname). Note: This feature is available in High Availability setups only. @@ -151,16 +154,17 @@ _/etc/ngcp-config/templates/etc/foobar/baz.tt2.inst-$INSTANCE_NAME_ but it's gua 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.$HA_NODE_: node -specific template file. Regarding $HA_NODE the same as for _baz.tt2.$HA_NODE_ +* _/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_ applies (see the previous bullet), but the configuration file usually isn't provided by a Debian package but can be modified independently from any Debian package mechanism. Note: This feature is available in High Availability setups only. -* _/etc/ngcp-config/templates/etc/foobar/baz.customtt.tt2.$PAIRNAME_: +* _/etc/ngcp-config/templates/etc/foobar/baz.customtt.tt2.$NGCP_PAIRNAME_: configuration file similar to -_/etc/ngcp-config/templates/etc/foobar/baz.tt2.$PAIRNAME_ but it's guaranteed +_/etc/ngcp-config/templates/etc/foobar/baz.tt2.$NGCP_PAIRNAME_ but it's guaranteed that the file won't be part of any Debian package mechanism. Note: This feature is available in High Availability setups only. @@ -174,13 +178,13 @@ available in High Availability setups only. Configuration file precedence (highest to lowest): *.customtt.tt2.inst-$INSTANCE_NAME *.customtt.tt2.$NGCP_HOSTNAME -*.customtt.tt2.$PAIRNAME -*.customtt.tt2.$HA_NODE +*.customtt.tt2.$NGCP_PAIRNAME +*.customtt.tt2.$NGCP_NODENAME *.customtt.tt2 *.tt2.inst-$INSTANCE_NAME *.tt2.$NGCP_HOSTNAME -*.tt2.$PAIRNAME -*.tt2.$HA_NODE +*.tt2.$NGCP_PAIRNAME +*.tt2.$NGCP_NODENAME *.tt2 Customisation for default template files @@ -205,8 +209,8 @@ availability of the necessary local changes on every configuration apply. The patch to be applied to the corresponding tt2 template file is selected in the following order (highest to lowest): *.patchtt.tt2.$NGCP_HOSTNAME -*.patchtt.tt2.$PAIRNAME -*.patchtt.tt2.$HA_NODE +*.patchtt.tt2.$NGCP_PAIRNAME +*.patchtt.tt2.$NGCP_NODENAME *.patchtt.tt2 [IMPORTANT] diff --git a/etc/ngcp-config/ngcpcfg.cfg b/etc/ngcp-config/ngcpcfg.cfg index c524cc2e..2b89e3b7 100644 --- a/etc/ngcp-config/ngcpcfg.cfg +++ b/etc/ngcp-config/ngcpcfg.cfg @@ -10,7 +10,9 @@ NGCPCTL_BASE='/etc' NGCPCTL_MAIN="${NGCPCTL_BASE}/ngcp-config" NGCPCTL_CONFIG="${NGCPCTL_MAIN}/config.yml" -HA_CONFIG="${HA_FILE:+${NGCPCTL_MAIN}/config${HA_FILE}.yml}" +# HA_CONFIG is deprecated, only for backwards compatibility. +HA_CONFIG="${NODE_FILE:+${NGCPCTL_MAIN}/config${NODE_FILE}.yml}" +NODE_CONFIG="${NODE_FILE:+${NGCPCTL_MAIN}/config${NODE_FILE}.yml}" PAIR_CONFIG="${PAIR_FILE:+${NGCPCTL_MAIN}/config${PAIR_FILE}.yml}" HOST_CONFIG="${NGCPCTL_MAIN}/config.$(ngcp-hostname).yml" LOCAL_CONFIG="${NGCPCTL_MAIN}/config.local.yml" diff --git a/functions/main b/functions/main index ba2b65df..781785e5 100644 --- a/functions/main +++ b/functions/main @@ -20,15 +20,10 @@ fi if [ -r "${FUNCTIONS}"/ha_features ] ; then # shellcheck disable=SC1090,SC1091 . "${FUNCTIONS}"/ha_features - # Set ${HA_FILE}, used by ngcpcfg.cfg, tt2-process and encrypt. - set_ha_file -fi -if [ -r "${FUNCTIONS}"/carrier_features ] ; then - # shellcheck disable=SC1090,SC1091 - . "${FUNCTIONS}"/carrier_features - # Set ${HOST_FILE} + ${PAIR_FILE}, used by ngcpcfg.cfg and tt2-process. - set_host_and_pair_files + # Set HOST_FILE, NODE_FILE and PAIR_FILE variables, used by ngcpcfg.cfg, + # tt2-process and encrypt. + set_ha_vars fi ## }}} @@ -155,7 +150,7 @@ chown_configs() { return fi - for f in ${NGCPCTL_CONFIG:-} ${HA_CONFIG:-} ${PAIR_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} "${EXTRA_CONFIG_FILES[@]}" ; do + for f in ${NGCPCTL_CONFIG:-} ${NODE_CONFIG:-} ${PAIR_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} "${EXTRA_CONFIG_FILES[@]}" ; do if [ ! -f "${f}" ]; then continue fi diff --git a/helper/tt2-process b/helper/tt2-process index 40e2a7aa..b4c140da 100755 --- a/helper/tt2-process +++ b/helper/tt2-process @@ -255,7 +255,7 @@ sub generate_iofiles { if (length $ENV{INSTANCE_NAME}) { push @tt2_hosts, ".inst-".lc $ENV{INSTANCE_NAME}; } - foreach my $name (qw(HOST_FILE PAIR_FILE HA_FILE)) { + foreach my $name (qw(HOST_FILE PAIR_FILE NODE_FILE)) { push @tt2_hosts, $ENV{$name} if defined $ENV{$name}; } @tt2_hosts = uniq(@tt2_hosts); diff --git a/scripts/build b/scripts/build index 17529660..898702d4 100755 --- a/scripts/build +++ b/scripts/build @@ -43,7 +43,7 @@ if [ -n "${NGCP_JOBS:-}" ] ; then ARGS+=("--jobs=${NGCP_JOBS}") fi -for f in ${NGCPCTL_CONFIG:-} ${HA_CONFIG:-} ${PAIR_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${NETWORK_CONFIG:-} "${EXTRA_CONFIG_FILES[@]}" ${CONSTANTS_CONFIG:-} ; do +for f in ${NGCPCTL_CONFIG:-} ${NODE_CONFIG:-} ${PAIR_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${NETWORK_CONFIG:-} "${EXTRA_CONFIG_FILES[@]}" ${CONSTANTS_CONFIG:-} ; do if [ -r "$f" ] ; then ARGS+=("-c" "$f") fi @@ -127,7 +127,7 @@ else done declare -a configs - for config in "${HA_CONFIG}" "${PAIR_CONFIG}"; do + for config in "${NODE_CONFIG}" "${PAIR_CONFIG}"; do if [ -n "${config}" ]; then configs+=("-e" "$(basename "${config}")") fi diff --git a/scripts/cat b/scripts/cat index d3927539..669c3b5e 100755 --- a/scripts/cat +++ b/scripts/cat @@ -66,7 +66,7 @@ done declare -a configs_try if "${config_types[config]}"; then configs_try+=("${NGCPCTL_CONFIG}") - configs_try+=("${HA_CONFIG}") + configs_try+=("${NODE_CONFIG}") configs_try+=("${PAIR_CONFIG}") configs_try+=("${HOST_CONFIG}") configs_try+=("${LOCAL_CONFIG}") diff --git a/scripts/check b/scripts/check index d45dba2e..226151ac 100755 --- a/scripts/check +++ b/scripts/check @@ -236,7 +236,7 @@ check_shared_storage() { } if [ "$*" = "" ] ; then - config_files="${NGCPCTL_CONFIG:-} ${HA_CONFIG:-} ${PAIR_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${NETWORK_CONFIG:-} ${EXTRA_CONFIG_FILES[*]} ${CONSTANTS_CONFIG:-}" + config_files="${NGCPCTL_CONFIG:-} ${NODE_CONFIG:-} ${PAIR_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${NETWORK_CONFIG:-} ${EXTRA_CONFIG_FILES[*]} ${CONSTANTS_CONFIG:-}" else config_files="$*" fi diff --git a/scripts/edit b/scripts/edit index 597aeab1..c396639c 100755 --- a/scripts/edit +++ b/scripts/edit @@ -55,7 +55,7 @@ else # and process the main YML configs first: config.yml network.yml constants.yml # NOTE: the file are loaded/merged into ngcpcfg in different order! declare -a CONFIGS - for f in ${NGCPCTL_CONFIG:?} ${NETWORK_CONFIG:?} ${CONSTANTS_CONFIG:?} ${HA_CONFIG:-} ${PAIR_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} "${EXTRA_CONFIG_FILES[@]}" ; do + for f in ${NGCPCTL_CONFIG:?} ${NETWORK_CONFIG:?} ${CONSTANTS_CONFIG:?} ${NODE_CONFIG:-} ${PAIR_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} "${EXTRA_CONFIG_FILES[@]}" ; do if [ -r "$f" ] ; then CONFIGS+=("${f}") fi diff --git a/scripts/encrypt b/scripts/encrypt index 920030a8..1edd145f 100755 --- a/scripts/encrypt +++ b/scripts/encrypt @@ -20,7 +20,7 @@ fi get_config_file_list() { for dir in ${CONFIG_POOL} ; do # shellcheck disable=SC2044 - for file in $(find "${TEMPLATE_POOL_BASE}/${dir}" -name \*.tt2 -o -name \*.tt2"${HA_FILE:-}") ; do + for file in $(find "${TEMPLATE_POOL_BASE}/${dir}" -name \*.tt2 -o -name \*.tt2"${NODE_FILE:-}") ; do x=${file##"${NGCPCTL_MAIN}"/templates/} # drop leading /etc/ngcp-config y=${x%%.tt2} # drop trailing suffix '.tt2' y=${y%%.tt2.sp1} # drop trailing suffix '.tt2.sp1' diff --git a/scripts/get b/scripts/get index d4b6c7c5..b60f677f 100755 --- a/scripts/get +++ b/scripts/get @@ -46,7 +46,7 @@ fi # Get the list of configs in proper order to load. declare -a ARGS -for f in ${NGCPCTL_CONFIG:-} ${HA_CONFIG:-} ${PAIR_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${NETWORK_CONFIG:-} "${EXTRA_CONFIG_FILES[@]}" ${CONSTANTS_CONFIG:-} ; do +for f in ${NGCPCTL_CONFIG:-} ${NODE_CONFIG:-} ${PAIR_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${NETWORK_CONFIG:-} "${EXTRA_CONFIG_FILES[@]}" ${CONSTANTS_CONFIG:-} ; do if [ -r "$f" ] ; then ARGS+=("-c" "${f}") fi diff --git a/scripts/patch b/scripts/patch index e0dab3e5..712385d7 100755 --- a/scripts/patch +++ b/scripts/patch @@ -48,8 +48,8 @@ patch_search() { if [ -n "${PAIR_FILE:-}" ]; then hosts+=("${PAIR_FILE}") fi - if [ -n "${HA_FILE:-}" ]; then - hosts+=("${HA_FILE}") + if [ -n "${NODE_FILE:-}" ]; then + hosts+=("${NODE_FILE}") fi for val in "${hosts[@]}"; do regexp="${regexp}|\\${val}" diff --git a/t/fixtures/ngcpcfg_carrier.cfg b/t/fixtures/ngcpcfg_carrier.cfg index ab32b7ec..a3cbb304 100644 --- a/t/fixtures/ngcpcfg_carrier.cfg +++ b/t/fixtures/ngcpcfg_carrier.cfg @@ -2,7 +2,9 @@ [ -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 "${HA_CONFIG:-}" ] || HA_CONFIG="${NGCPCTL_MAIN}/config.ha.yml" +# HA_CONFIG is deprecated, only for backwards compatbility. +[ -n "${HA_CONFIG:-}" ] || HA_CONFIG="${NGCPCTL_MAIN}/config.node.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" diff --git a/t/fixtures/ngcpcfg_carrier_instances.cfg b/t/fixtures/ngcpcfg_carrier_instances.cfg index 12c9d32a..b09f9249 100644 --- a/t/fixtures/ngcpcfg_carrier_instances.cfg +++ b/t/fixtures/ngcpcfg_carrier_instances.cfg @@ -2,7 +2,9 @@ [ -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 "${HA_CONFIG:-}" ] || HA_CONFIG="${NGCPCTL_MAIN}/config.ha.yml" +# HA_CONFIG is deprecated, only for backwards compatbility. +[ -n "${HA_CONFIG:-}" ] || HA_CONFIG="${NGCPCTL_MAIN}/config.node.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" diff --git a/t/fixtures/ngcpcfg_network_interfaces.cfg b/t/fixtures/ngcpcfg_network_interfaces.cfg index 76cda4d6..84ba77e8 100644 --- a/t/fixtures/ngcpcfg_network_interfaces.cfg +++ b/t/fixtures/ngcpcfg_network_interfaces.cfg @@ -41,6 +41,8 @@ [ -n "${NETWORK_CONFIG_GROUP:-}" ] || NETWORK_CONFIG_GROUP="_ngcp-admin" [ -n "${NETWORK_CONFIG_CHMOD:-}" ] || NETWORK_CONFIG_CHMOD="0660" +# HA_FILE is deprecated, only for backwards compatibility. [ -n "${HA_FILE:-}" ] || HA_FILE='.sp1' +[ -n "${NODE_FILE:-}" ] || NODE_FILE='.sp1' ## END OF FILE ################################################################# diff --git a/t/fixtures/ngcpcfg_pro.cfg b/t/fixtures/ngcpcfg_pro.cfg index aca2757f..2c898297 100644 --- a/t/fixtures/ngcpcfg_pro.cfg +++ b/t/fixtures/ngcpcfg_pro.cfg @@ -2,7 +2,9 @@ [ -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 "${HA_CONFIG:-}" ] || HA_CONFIG="${NGCPCTL_MAIN}/config.ha.yml" +# HA_CONFIG is deprecated, only for backwards compatbility. +[ -n "${HA_CONFIG:-}" ] || HA_CONFIG="${NGCPCTL_MAIN}/config.node.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" @@ -43,6 +45,8 @@ [ -n "${NETWORK_CONFIG_GROUP:-}" ] || NETWORK_CONFIG_GROUP="_ngcp-admin" [ -n "${NETWORK_CONFIG_CHMOD:-}" ] || NETWORK_CONFIG_CHMOD="0660" +# HA_FILE is deprecated, only for backwards compatibility. [ -n "${HA_FILE:-}" ] || HA_FILE='.sp1' +[ -n "${NODE_FILE:-}" ] || NODE_FILE='.sp1' ## END OF FILE ################################################################# diff --git a/t/fixtures/ngcpcfg_pro_instances.cfg b/t/fixtures/ngcpcfg_pro_instances.cfg index 597ca5f5..f51c8f60 100644 --- a/t/fixtures/ngcpcfg_pro_instances.cfg +++ b/t/fixtures/ngcpcfg_pro_instances.cfg @@ -2,7 +2,9 @@ [ -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 "${HA_CONFIG:-}" ] || HA_CONFIG="${NGCPCTL_MAIN}/config.ha.yml" +# HA_CONFIG is deprecated, only for backwards compatbility. +[ -n "${HA_CONFIG:-}" ] || HA_CONFIG="${NGCPCTL_MAIN}/config.node.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" @@ -43,6 +45,8 @@ [ -n "${NETWORK_CONFIG_GROUP:-}" ] || NETWORK_CONFIG_GROUP="_ngcp-admin" [ -n "${NETWORK_CONFIG_CHMOD:-}" ] || NETWORK_CONFIG_CHMOD="0660" +# HA_FILE is deprecated, only for backwards compatibility. [ -n "${HA_FILE:-}" ] || HA_FILE='.sp1' +[ -n "${NODE_FILE:-}" ] || NODE_FILE='.sp1' ## END OF FILE ################################################################# diff --git a/t/fixtures/programs.py b/t/fixtures/programs.py index 78a7b260..91b041a9 100644 --- a/t/fixtures/programs.py +++ b/t/fixtures/programs.py @@ -22,6 +22,7 @@ DEFAULT_CFG = Path("fixtures/ngcpcfg.cfg").resolve() CFG_KEYS = [ "NGCPCTL_CONFIG", "HA_CONFIG", + "NODE_CONFIG", "PAIR_CONFIG", "HOST_CONFIG", "LOCAL_CONFIG", diff --git a/t/fixtures/read_cfg.sh b/t/fixtures/read_cfg.sh index 66be1d82..ba781a32 100755 --- a/t/fixtures/read_cfg.sh +++ b/t/fixtures/read_cfg.sh @@ -7,7 +7,9 @@ echo "[ngcpcfg]" echo "NGCPCTL_BASE=${NGCPCTL_BASE:-}" echo "NGCPCTL_MAIN=${NGCPCTL_MAIN:-}" echo "NGCPCTL_CONFIG=${NGCPCTL_CONFIG:-}" -echo "HA_CONFIG=${HA_CONFIG:-}" +# HA_CONFIG is deprecated, only for backwards compatibility. +echo "HA_CONFIG=${NODE_CONFIG:-}" +echo "NODE_CONFIG=${NODE_CONFIG:-}" echo "PAIR_CONFIG=${PAIR_CONFIG:-}" echo "HOST_CONFIG=${HOST_CONFIG:-}" echo "LOCAL_CONFIG=${LOCAL_CONFIG:-}" @@ -52,6 +54,8 @@ echo "NETWORK_CONFIG_GROUP=${NETWORK_CONFIG_GROUP:-}" echo "NETWORK_CONFIG_CHMOD=${NETWORK_CONFIG_CHMOD:-}" # fake values from ngcpcfg-ha +# HA_FILE is deprecated, only for backwards compatibility. echo "HA_FILE=${HA_FILE:-}" +echo "NODE_FILE=${NODE_FILE:-}" echo "HOST_FILE=${HOST_FILE:-}" echo "PAIR_FILE=${PAIR_FILE:-}" diff --git a/t/fixtures/repos/config.ha.yml b/t/fixtures/repos/config.node.yml similarity index 100% rename from t/fixtures/repos/config.ha.yml rename to t/fixtures/repos/config.node.yml