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
- 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 = \
scripts/* \
functions/* \
etc/ngcp-config/ngcpcfg.cfg \
etc/ngcp-ngcpcfg/ngcpcfg.cfg \
sbin/ngcpcfg
PERL_SCRIPTS = \
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/logs 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
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
*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
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
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
that software packages can enable/disable certain features through configuration
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
/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).
[IMPORTANT]
@ -241,7 +241,7 @@ configuration file (/etc/foobar/baz) is available within the postbuild script.
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/)
@ -738,7 +738,7 @@ Setup instructions
Requirements for High Availability setups:
* 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)

@ -1,4 +1,4 @@
# Filename: /etc/ngcp-config/ngcpcfg.cfg
# Filename: /etc/ngcp-ngcpcfg/ngcpcfg.cfg
# Purpose: main configuration file for ngcpcfg tools
# 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
. "${NGCPCFG:-}"
else
if [ -r /etc/ngcp-config/ngcpcfg.cfg ] ; then
if [ -r /etc/ngcp-ngcpcfg/ngcpcfg.cfg ] ; then
# shellcheck disable=SC1091
. /etc/ngcp-config/ngcpcfg.cfg
log_debug "sourced configuration file /etc/ngcp-config/ngcpcfg.cfg"
. /etc/ngcp-ngcpcfg/ngcpcfg.cfg
log_debug "sourced configuration file /etc/ngcp-ngcpcfg/ngcpcfg.cfg"
if [ -d /etc/ngcp-config/ngcpcfg.d ] ; then
for file in /etc/ngcp-config/ngcpcfg.d/*.cfg ; do
if [ -d /etc/ngcp-ngcpcfg/ngcpcfg.d ] ; then
for file in /etc/ngcp-ngcpcfg/ngcpcfg.d/*.cfg ; do
if [ -r "${file}" ]; then
# shellcheck disable=SC1090
. "${file}"
@ -28,7 +28,7 @@ else
log_error "Configuration pool locked. Please contact your distributor. Exiting."
exit 1
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
fi
fi

@ -21,7 +21,7 @@ def test_ngcpcfgcfg_ko(ngcpcfgcli):
out = ngcpcfgcli(env={"NGCPCFG": "/doesnotexist"})
assert (
"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

Loading…
Cancel
Save