TT#177600 Move ngcpcfg specific configuration under /etc/ngcp-ngcpcfg

The configuration files specific to the ngcpcfg tool should not be
mixed with the site specific configuration, as that's rather confusing,
more so when the actual ngcpcfg configuration contains references to the
location of the ngcp-config dir itself, which makes it self-referential.

Change-Id: I93f59e2ce3441c2c315956f68e22e4b2e9c839ac
mr11.0
Guillem Jover 3 years ago
parent be5ce720cf
commit 55d8353873

@ -27,4 +27,4 @@ jobs:
run: shellcheck --version run: shellcheck --version
- name: Shellcheck execution - name: Shellcheck execution
run: shellcheck -P functions scripts/* functions/* etc/ngcp-config/ngcpcfg.cfg sbin/ngcpcfg run: shellcheck -P functions scripts/* functions/* etc/ngcp-ngcpcfg/ngcpcfg.cfg sbin/ngcpcfg

@ -2,7 +2,7 @@
BASH_SCRIPTS = \ BASH_SCRIPTS = \
scripts/* \ scripts/* \
functions/* \ functions/* \
etc/ngcp-config/ngcpcfg.cfg \ etc/ngcp-ngcpcfg/ngcpcfg.cfg \
sbin/ngcpcfg sbin/ngcpcfg
PERL_SCRIPTS = \ PERL_SCRIPTS = \
lib/NGCP/Template.pm \ lib/NGCP/Template.pm \

@ -1,4 +1,4 @@
etc/ngcp-config/ngcpcfg.cfg etc/ngcp-config/ etc/ngcp-ngcpcfg/ngcpcfg.cfg etc/ngcp-ngcpcfg/
functions/init usr/share/ngcp-ngcpcfg/functions/ functions/init usr/share/ngcp-ngcpcfg/functions/
functions/logs usr/share/ngcp-ngcpcfg/functions/ functions/logs usr/share/ngcp-ngcpcfg/functions/
functions/main usr/share/ngcp-ngcpcfg/functions/ functions/main usr/share/ngcp-ngcpcfg/functions/

@ -0,0 +1 @@
mv_conffile /etc/ngcp-config/ngcpcfg.cfg /etc/ngcp-ngcpcfg/ngcpcfg.cfg 11.0.0.0+0~mr11.0.0.0

@ -39,7 +39,7 @@ in _/etc/ngcp-config/network.yml_
*shared repository*:: Git repository shared amongst nodes inside a High *shared repository*:: Git repository shared amongst nodes inside a High
Availability setup, as defined by the GLUSTERFS setting in Availability setup, as defined by the GLUSTERFS setting in
/etc/ngcp-config/ngcpcfg.d/shared_storage.cfg (requires ngcp-ngcpcfg-ha) and /etc/ngcp-ngcpcfg/ngcpcfg.d/shared_storage.cfg (requires ngcp-ngcpcfg-ha) and
being _/mnt/glusterfs_ by default being _/mnt/glusterfs_ by default
*templates*:: template toolkit files with .tt2 suffix, found in *templates*:: template toolkit files with .tt2 suffix, found in
@ -75,20 +75,20 @@ any other .yml file _/etc/ngcp-config/_, defining important constant settings.
This file is *not* supposed to be modified by the user (without having a very This file is *not* supposed to be modified by the user (without having a very
good reason). good reason).
* _/etc/ngcp-config/ngcpcfg.cfg_: main configuration file for ngcpcfg itself,
provides global variables used inside ngcpcfg and its helper scripts. This file
is *not* supposed to be modified by the user (without having a very good
reason).
* _/etc/ngcp-config/config.d/_: optional configuration directory with additional * _/etc/ngcp-config/config.d/_: optional configuration directory with additional
yml configuration files. Files inside this directory aren't supposed to be yml configuration files. Files inside this directory aren't supposed to be
added or modified by the user. The purpose of this configuration directory is added or modified by the user. The purpose of this configuration directory is
that software packages can enable/disable certain features through configuration that software packages can enable/disable certain features through configuration
options on demand. options on demand.
* _/etc/ngcp-config/ngcpcfg.d/_: configuration directory for ngcpcfg itself. * _/etc/ngcp-ngcpcfg/ngcpcfg.cfg_: main configuration file for ngcpcfg itself,
provides global variables used inside ngcpcfg and its helper scripts. This file
is *not* supposed to be modified by the user (without having a very good
reason).
* _/etc/ngcp-ngcpcfg/ngcpcfg.d/_: configuration directory for ngcpcfg itself.
Files with suffix '.cfg' inside this directory are sourced after Files with suffix '.cfg' inside this directory are sourced after
/etc/ngcp-config/ngcpcfg.cfg has been read. Files inside this directory are /etc/ngcp-ngcpcfg/ngcpcfg.cfg has been read. Files inside this directory are
*not* supposed to be modified by the user (without having a very good reason). *not* supposed to be modified by the user (without having a very good reason).
[IMPORTANT] [IMPORTANT]
@ -241,7 +241,7 @@ configuration file (/etc/foobar/baz) is available within the postbuild script.
Syntax and layout of configuration files Syntax and layout of configuration files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* _/etc/ngcp-config/ngcpcfg.cfg_: plain shell syntax style "key=value" entries * _/etc/ngcp-ngcpcfg/ngcpcfg.cfg_: plain shell syntax style "key=value" entries
* _central yml files_ (*.yml): YAML configuration syntax (see http://yaml.org/) * _central yml files_ (*.yml): YAML configuration syntax (see http://yaml.org/)
@ -738,7 +738,7 @@ Setup instructions
Requirements for High Availability setups: Requirements for High Availability setups:
* glusterfs is supposed to be set up working and deployed at /mnt/glusterfs * glusterfs is supposed to be set up working and deployed at /mnt/glusterfs
(as defined via /etc/ngcp-config/ngcpcfg.cfg) (as defined via /etc/ngcp-ngcpcfg/ngcpcfg.cfg)
* hosts are expected to be set up for automatic ssh login (ssh-keygen && ssh-copy-id) * hosts are expected to be set up for automatic ssh login (ssh-keygen && ssh-copy-id)

@ -1,4 +1,4 @@
# Filename: /etc/ngcp-config/ngcpcfg.cfg # Filename: /etc/ngcp-ngcpcfg/ngcpcfg.cfg
# Purpose: main configuration file for ngcpcfg tools # Purpose: main configuration file for ngcpcfg tools
# Note: do not modify unless you have a really good reason to do so # Note: do not modify unless you have a really good reason to do so

@ -10,13 +10,13 @@ if [ -r "${NGCPCFG:-}" ] ; then
# shellcheck disable=SC1090 # shellcheck disable=SC1090
. "${NGCPCFG:-}" . "${NGCPCFG:-}"
else else
if [ -r /etc/ngcp-config/ngcpcfg.cfg ] ; then if [ -r /etc/ngcp-ngcpcfg/ngcpcfg.cfg ] ; then
# shellcheck disable=SC1091 # shellcheck disable=SC1091
. /etc/ngcp-config/ngcpcfg.cfg . /etc/ngcp-ngcpcfg/ngcpcfg.cfg
log_debug "sourced configuration file /etc/ngcp-config/ngcpcfg.cfg" log_debug "sourced configuration file /etc/ngcp-ngcpcfg/ngcpcfg.cfg"
if [ -d /etc/ngcp-config/ngcpcfg.d ] ; then if [ -d /etc/ngcp-ngcpcfg/ngcpcfg.d ] ; then
for file in /etc/ngcp-config/ngcpcfg.d/*.cfg ; do for file in /etc/ngcp-ngcpcfg/ngcpcfg.d/*.cfg ; do
if [ -r "${file}" ]; then if [ -r "${file}" ]; then
# shellcheck disable=SC1090 # shellcheck disable=SC1090
. "${file}" . "${file}"
@ -28,7 +28,7 @@ else
log_error "Configuration pool locked. Please contact your distributor. Exiting." log_error "Configuration pool locked. Please contact your distributor. Exiting."
exit 1 exit 1
else else
log_error "Could not read configuration file /etc/ngcp-config/ngcpcfg.cfg. Exiting." log_error "Could not read configuration file /etc/ngcp-ngcpcfg/ngcpcfg.cfg. Exiting."
exit 1 exit 1
fi fi
fi fi

@ -21,7 +21,7 @@ def test_ngcpcfgcfg_ko(ngcpcfgcli):
out = ngcpcfgcli(env={"NGCPCFG": "/doesnotexist"}) out = ngcpcfgcli(env={"NGCPCFG": "/doesnotexist"})
assert ( assert (
"Error: Could not read configuration file " "Error: Could not read configuration file "
"/etc/ngcp-config/ngcpcfg.cfg. Exiting." in out.stderr "/etc/ngcp-ngcpcfg/ngcpcfg.cfg. Exiting." in out.stderr
) )
assert out.returncode == 1 assert out.returncode == 1

Loading…
Cancel
Save