We do not use /tmp/ngcp-installer.log since mr6.5 and
using directly /var/log/ngcp-installer.log inside chroot.
Change-Id: I35b098fb09046a0fbc0a9bfc56bd125362c34fd0
We're executing `apt-get update` even when nothing needs to be
installed. This adds unnecessary overhead and can fill ram/disk
on live system on consecutive runs, so let's avoid that.
Change-Id: Ic1a40d82988caf454f317b4803e03f4c9de3feea
Implement suggestions from review I16e4f19f3b9270ccfef6c7c1274bb8b8d95695bd
1. In some cases there can be multiple gateways. Return only the 1st one.
2. Remove configuration of the management (IMM2/IPMI) interface of
lenovo servers.
Change-Id: Ia1bb6e9f0e44bcb0c6be87407a8c11899163c03a
All non-zero returned values are caught by '-e' option and passed
to function wait_exit by 'trap'.
So if it is an error we can set 'error' status in this function.
Change-Id: I762e5470d94a537b4f8f0e32fe6d0c1575bbb075
We need it to be able to connect from mgmt node to installed one
to run 'ngcp-initial-configuration'.
Change-Id: Id907094ba2eae32c05ad8d42d8a504e498a57ad4
wget in Debian/buster:
| Package: wget
| Version: 1.19.5-1
| [...]
| Priority: standard
wget in Debian/stretch and earlier:
| Package: wget
| Version: 1.18-5+deb9u2
| [...]
| Priority: important
To ensure we still have wget available inside the
Debian system, e.g. for retrieving the ngcp-installer*.deb
file, we need to add it to the package selection.
The ngcp-nth-* packages also include wget in their dependencies,
ngcp-installer also checks and adds it, though it's too late
there for bootstrapping our systems, as we're e.g. retrieving the
installer deb + checking for PPAs using wget.
While at it move the slightly misleading comment to the
appropriate place.
Change-Id: I971b2d06528a33b1dc4c310feef83c32e10ae557
Switch from:
> +10:43:04 (/usr/sbin/ngcp-status:10): main(): export LC_ALL=C.UTF-8
to:
> +10:43:04 (ngcp-status:10): main(): export LC_ALL=C.UTF-8
Since we have unique names for all the script we use,
the full path is not so important as the space we spent of the console.
Change-Id: Ie6fe2ce1ca409033189e1c033a4aebf9e037eaba
1706:9 shellcheck:warning When used with -p, -m only applies to the deepest directory. [SC2174]
1726:9 shellcheck:warning When used with -p, -m only applies to the deepest directory. [SC2174]
Change-Id: I98efba1253c0aefd9e97ac34500476936b860ca5
257:9 shellcheck:error Arrays implicitly concatenate in [[ ]]. Use a loop (or explicit * instead of @). [SC2199]
Change-Id: I49504d5b1a8d8ae021d4d6c6465639d58a2670e3
If the installation device is virtual it is necessary to redefine
DEFAULT_INSTALL_DEV variable to the name of real interface but
save the origin name to stop it.
Change-Id: I9e59ca8411e713235a0e0e5407ef0c3acc30e299
This list is used to add all network interfaces to network.yml but
we do not need to add virtual interfaces there - they will be added
automatically from installation's configuration.
Change-Id: I3f21abc066b4f0c714b1780dcfdf4335e7506d1d
The deployment.sh script as well as installer should not configure system
or services.
Remove network's configuration code.
Remove services' configuration code.
Remove unused variables and parameters.
Copy existing /e/n/i into chroot env so the server starts with the same
network configuration.
Move gateway detection to the top - we need this information to generate
proper /e/n/i
Change-Id: I16e4f19f3b9270ccfef6c7c1274bb8b8d95695bd
1. 'localhost' has to be resolved to ipv4 only not ipv6.
2. There should be 'hostname.' with dot record.
Change-Id: I9f34f45b00453746b254f41494d7652a10de0d04
Without explicit return function returns the exit code of the last function
which in not 0 in this case so it causes amiss exit of the script.
Change-Id: Ic7f1f534048cb051fe116cb76ee386bf4ca07ff4
If 'systemctl reboot|halt' is called within script 'trap' function
is not called so deployment.sh does not wait and jenkins can miss
the status.
Move waiting to separate function and call it directly so there is
waiting in the end of deployment.sh in any case.
Change-Id: Ib93bf6fd4e6f133c9342d02d412ea1f18cdceba6
For now if there is an error in deployment.sh it is ended immediately
so jenkins node can miss deploy status.
Add wait_exit function which is called on any exit and waits
STATUS_WAIT seconds.
Change-Id: I715c2484a25222221d61a01bd220973e89547929
We are NOT installing non-free firmware packages on NGCP (since TT#42672),
as a result we should not purge them. See commit 9161d0f57 in
metapackages.git for more information.
Change-Id: I84ff3486c0b03bbc228e5332955f6654b3519137
The hardcoded list of accepted drives is never really up2date
and was meant as a safety net in the beginnings of deployment.sh.
Let's drop those checks to avoid failures in automated installations,
interactive installer/deployment mode is supposed to prompt for
before actually executing anything anyway.
Change-Id: Ib6dcaec8a221dc268638a98055219a5ae3c92a00
deployment.sh can install plain Debian systems (without NGCP),
in commit d2afaf9 such functionality has been lost. Fixing it here.
Change-Id: I883ef3c69c67cc04ae796c373f3b52d75780b4de
Currently grml-debootstrap only sets /etc/localtime, but not
/etc/timezone, so this confuses the system with libraries/tools
that read the former and others the latter. Reconfigure tzdata so
that it can get both files into a consistent state.
Change-Id: Id34c1a088809fbac19957a750c31fb8f3ceda893
It is necessary to use separate apt database and source list because
non management node has no internet access so is installed from
management node so these additional packages have to be
installed/accessible from sipwise repo.
Change-Id: I4c1310320c4d66aba01af5ce00127f4757ec71ad
Make a single list of all required packages.
For each package from the list check if it is installed or not.
Install all packages at once.
Remove custom source.list for these additional packages. Previously it
was used because GRML image and its default source.list were too old.
Now a new GRML is used so we have a vise-versa situation - deb.sipwise.com
contains older packages than default source.list so there is no sense to
use any custom locations and options.
Change-Id: I33239c255f5af666ca9bbead9d3a584de9335bb6
This code is called only once so there is no sense to make it as function.
Optimize the code - use 'sort' instead of 'for' cycle to remove duplicates.
Change-Id: I2658b2fbbb3a9478e11337327d8a76a259f22c26
Our goal is to separate installation and configuration parts so
any network related things have to be configured after the installation
and reboot. But during the deployment.sh we need to configure one
interface which will be used after the reboot. So we need consistent
interfaces' name between reboot.
Change-Id: Ib4cd19bf0455c1365a2d33fc5a90209d0a5d62d7
Several changes:
- Promote the variables to top level. Local variables are good for some things,
but if they represent external resources, it's probably better to have them
defined outside as a kind of constants, instead of deeply buried inside
functions.
- Make 'wget' a bit more robust and less verbose (to not have dozens of lines of
useless output with the progress of a big file).
Change-Id: I679de4e976497d0cf6ca3da2e13ff2fb8a76d881
The variables related to Pro edition (at least Role) needs to be present when
installing some nodes Carrier, otherwise the installation doesn't work as
expected.
Change-Id: Ibea819889f42559626164b9e344670edea5cad1b
If the dir is owned by "_apt", apt-get can use this user for network operations
instead of having to stay as "root".
Change-Id: Ib41d591d1da539c3d43fa945262d0b9766a6be23
Add choice continue or not if virtualized system was not detected and
it is interactive mode.
If it is non interactive mode - continue the deployment.
Change-Id: I8913dda6121c0e46a6de21ad1ab95eceb2c45227
The file /tmp/ngcp-installer-cmdline.log is available when GRML is running only
and will gone right after the reboot. In the same time original
"${TARGET}/etc/ngcp-installer/config_deploy.inc" is also available
during GRML is running and will stay after the reboot.
For all the time I had no reason to check /tmp/ngcp-installer-cmdline.log,
as I always used config_deploy.inc directly (which is also covered by etckeeper).
Removing it as a part of minimizing log files program.
Change-Id: Idcc2ced1bf2aba261bd519abcdb91c1f8fe0336b
* ngcp-installer*deb can be deleted right after the package installation
* ${TARGET}/config_*yml and ${TARGET}/constants_*.yml are leftovers.
They are no longer available on NGCP (long long time ago we created
them to upload CFG schema dump into git every night).
See commit ba06d2b145e3e20468de532e77fa501cd38a72e7 to netscript.git
Change-Id: I75a575233a5074143d7d35de26b33f161cf77e4f
We have a lot of different log files on GRML/deployment.sh stage,
let's minimize the count here and use main $INSTALL_LOG for all
the messages printed by deployment.sh (it will simpify further debug).
Previously logit() printed to GRML /var/log/syslog which is not
available on NGCP after reboot, the new code will use $INSTALL_LOG.
Change-Id: I675c45ebc2852b00253e7b51e7abd4a10a0fb714
First of all the information here was outdated and confusing.
Moreover it duplicates info in deployment-installer-debug.log.
The line "NGCP_INSTALLER_CMDLINE=..." didn't represent the actual
running command for several years already. Also the line SCRIPT_VERSION
is already printed to all log files several times already.
The only missing line was CMD_LINE, so printing it if debug is enabled.
Change-Id: I19255354c8314201992385f5b5bb7e60910bc26a