Commit Graph

4378 Commits

Author SHA1 Message Date
Zuul c81f77b9f3 Merge "Remove pre-bullseye release workaround" 2024-03-25 12:03:53 +00:00
Zuul 2ba78f79a1 Merge "Call grub2-mkconfig with --update-bls-cmdline" 2024-03-11 16:24:38 +00:00
Birger J. Nordølum ce44d51677
feat: add almalinux-container element
Change-Id: I0b9f50e9a8844e157af70ee0f343fe9d40fa2537
Signed-off-by: Birger J. Nordølum <contact@mindtooth.no>
2024-03-07 08:31:42 +01:00
Zuul 5d0162905f Merge "Bump upper version of flake8" 2024-03-06 00:58:16 +00:00
Steve Baker c9f3b1b231 Call grub2-mkconfig with --update-bls-cmdline
Recent versions of redhat grub2-mkconfig no longer automatically update
kernel arguments in BLS entries[1]. This change optionally adds the
--update-bls-cmdline argument where supported so this previous
behaviour continues to work.

[1] https://pkgs.devel.redhat.com/cgit/rpms/grub2/tree/0327-grub-mkconfig-dont-overwrite-BLS-cmdline-if-BLSCFG.patch?h=rhel-9.3.0

Change-Id: I568c34ef9b00b3a4e28ae13e013018fd6cedafa2
2024-03-05 07:07:34 +13:00
Ettore Simone 741ab26206 Cleanup uses of DIB_IMAGE_ROOT_FS_UUID variable
Since 2.4.0 disk-image-create does not export DIB_IMAGE_ROOT_FS_UUID
anymore. This patch fix documentation and the iso element.

Closes-Bug: 1699273
Change-Id: I5e926c36256e580579bfd2c5aeff4ba6193c367a
2024-03-04 12:09:03 +01:00
Zuul 0168c3057d Merge "rocky-container: Add installation of Minimal Install group" 2024-02-23 22:12:41 +00:00
Takashi Kajinami 2563a12a4b Bump upper version of flake8
So that we can use flake8 6.1.0, which is required by hacking 6.1.0.

Change-Id: Ia2d9d8b0b80d5349d1534be09f09ce543c43ab64
2024-02-21 02:38:18 +00:00
Clark Boylan f305d7fe70 Fetch compatibile dnf download command in functest setup
The dnf-plugins-core repo updates its download command to use a
dnf.utils method that is not present in the dnf version installed by
Debian packages. Update the fetch of dnf-plugins-core to use the last
version of the download plugin that is compatible with the dnf package
in Debian.

Note that we don't use the bookworm dnf-plugins-core package to address
this because dnf-plugins-core specifies that it breaks and replaces
zypper. This occurs due to the collision of a single manpage filename.
OpenSUSE addresses this by moving one of the manpages to a different
location allowing zypper and dnf to be installed together on SUSE
distros. Hopefully Debian will manage to do similar eventually.

Change-Id: I3a029340f9635f54570e48a68a9e2c1b1e30a76f
2024-02-19 08:21:45 -08:00
Sam James 9e0ff1f5b3 Fix various minor issues with Gentoo; make CI pass
This patch contains the known set of changes needed to make a gentoo
image build successfully.

- Standardize use of GENTOO_EMERGE_DEFAULT_OPTS, reduce duplication of
  options set there.
- Correct the cleanup commands to reflect standard Gentoo good
  practices by omitting --complete-graph, which is unneeded with --deep,
  and using --changed-use instead of --newuse to reduce unneeded package
  churn.
- Stop using deprecated layman command to manage reposiotry overlays,
  instead use new supported eselect-repository
- Set new USE flags required for LVM and installkernel. This was
  communicated via a Gentoo news item and is a required cleanup.
- Remove now-invalid skip of gpg if using musl

This is the set of changes needed to get the CI job passing and make DIB
build images at all, and we'd like to land them, but there are still
items we'd like to complete to enhance Gentoo support in DIB:
- Optional, built-in support for Gentoo binhosts -- where you can set a
  DIB_GENTOO_BINHOST=true (or similar) and have the binhost enabled by
  default.
- Make the default configuration of EMERGE_DEFAULT_OPTS more easily
  managed in a DIB-style manner, e.g. setting --quiet vs --verbose based
  on the value of DIB_DEBUG_TRACE.

Signed-Off-By: Jay Faulkner <jay@jvf.cc>
Signed-Off-By: Sam James <sam@gentoo.org>
Co-Authored-By: Sam James <sam@gentoo.org>
Change-Id: Idab82a9fa986fcc56fe4e1e1bf0445c7306b2858
2024-02-05 22:11:46 +00:00
Zuul 6fa80234bc Merge "gentoo: don't uninstall packages that aren't installed" 2024-01-30 15:03:34 +00:00
Zuul 0d4fbf1a47 Merge "Fix indentation of output formats" 2024-01-25 02:31:23 +00:00
Zuul 1d77f49b4e Merge "Fix small syntax issue" 2024-01-25 02:31:21 +00:00
Zuul c8f1cc11e2 Merge "python3.12: "fix" unittests" 2024-01-25 01:42:52 +00:00
Zuul 9d03eeb558 Merge "Replace OpenSUSE Leap 15.3 to OpenSUSE Leap 15.5" 2024-01-25 01:37:47 +00:00
Zuul d2310eebbb Merge "Add san support to growvols" 2024-01-09 14:43:40 +00:00
Xavier Coulon b242f913a8 Replace OpenSUSE Leap 15.3 to OpenSUSE Leap 15.5
OpenSUSE Leap 15.3 is out of support since 2022. This patch remove the
support of OpenSUSE Leap 15.3 and replace it with the OpenSUSE Leap
15.5.
Add the grub2-x86_64-efi package in the pkg-map of the bootloader
element to allow EFI support.
Replace version 15.3 to 15.5 in every required location.
Add dracut-mkinitrd-deprecated package in package-installs.yaml of
the opensuse element to support the usage of the deprecated mkinitrd
command from the zypper element.

Change-Id: Ie903ffcf229d8e32374c4a1346b5295990c83ff4
2024-01-05 10:54:23 +01:00
Julia Kreger 59831c10df Enable the no_timer_check option to be removable
Turns out, some kernels on some versions of hardware, can
fail to boot when the hardware clock timer is not explicitly
checked. Normally, with virtual machines, you want to disable
the timer check, becuase the virutal machine inherently gets time
slices, and checking the timer can create issues booting.

Co-Authored-By: Ella Shulman <eshulman@redhat.com>
Change-Id: I8b9697ba60748bfe1e1e1914f24f207439cda2f1
2024-01-04 12:44:13 -08:00
Matthew Thode 98190139cf
gentoo: don't uninstall packages that aren't installed
I380b9638cd28f5771530089c558ef5ab638c0173 introduced a bug where it
would ask for cloud-init to be uninstalled even if the package was
already not installed.  We handle that here by filtering the uninstall
list down to only packages that are already installed.

One drawback to this filtering is that if it's not presented with a list
of category/packagename formated packages it can result in false
positives (failing to remove).  This type of behavior was always an
issue for install as well, for instance acct-user/puppet and
app-admin/puppet both have the puppet package name but different
categories.

also fixes root.d to download the images again

also also uses the merged-usr profile for systemd
https://www.gentoo.org/support/news-items/2022-12-01-systemd-usrmerge.html

Change-Id: Ib67aa91c64be2fcc7d9df324918edfc080237528
Signed-off-by: Matthew Thode <mthode@mthode.org>
2023-12-22 18:43:17 -06:00
Steve Baker b35e7db0fd Add san support to growvols
In the san case the "disk" device will be of type "mpath", this change
adds "mpath" to the allowed partition types to treat as the primary
device.

Full unit test coverage has been added using an actual mpath lsblk
output to validate behaviour.

Change-Id: Id593d32e64abdb2ce4b3fd2e43f89fe262d374d1
2023-12-22 13:39:26 +13:00
Damien Rannou e6444a1162 Fix small syntax issue
Change-Id: Iece6063c5c8d4ec2fe3112e218d003de5528e272
2023-12-19 14:19:33 +01:00
Ian Wienand 895fa69e75
python3.12: "fix" unittests
These are written to import the python utility into the unittest as a
module, which is then tested.  Python 3.12 removed "imp" which broke
this.

The documentation discusses using spec_from_file_location [2] for this
task, but one complication is that it only allows files with an
extension of .py to load like that ... so add an additional hack so
that the importlib loader will read the file.

[2] https://docs.python.org/3/library/importlib.html

Change-Id: I3c842b3a712ead6d2151b90171f9228caecedd11
2023-12-18 11:13:39 +11:00
Zuul 72513f6bdf Merge "Remove cloud-init when using simple-init" 2023-12-14 19:05:33 +00:00
Michal Nasiadka 39892dc8c1 rocky-container: Add installation of Minimal Install group
Currently the images lack some packages like linux-firmware and
microcode_ctl, installing 'Minimal Install' group adds those and
some others that are expected to be on a VM or bare metal.

--allowerasing is used to remove coreutils-single and curl-minimal
which conflict with their fully fledged equivalents.

Change-Id: I08a6f8cb7b0440652c3496056ca9aee8213edc4d
2023-12-08 10:21:16 +00:00
Bartosz Bezak 14754b21a4 Add NetworkManager-config-server to rocky-container
It prevents NetworkManager from automatically running DHCP on
unconfigured ethernet devices and allows connections with static IP
addresses to be brought up even on ethernet devices with no carrier.
This is default in Server or Server with GUI RHEL installations.

Change-Id: I15f4a28a257dc1b30f8957fd9ad41aef3c9de385
2023-12-06 12:57:44 +00:00
Charalampos Kominos b197d2c641 feat: Add new fail2ban elemenent
This patch proposes a new element which installs fail2ban on the final
image. More crucially, a custom jail.local is injected during built
time which is a useful feature for cloud admins.

Change-Id: I47b90bbf3809cd6f90148b848b2afe4233be79d7
Signed-off-by: Charalampos Kominos <hkominos@gmail.com>
2023-11-25 20:23:31 +00:00
Julia Kreger 6df7921cb7 Remove cloud-init when using simple-init
When using simple-init, we are making an explicit choice
along the lines of "I want the simple tool to do the simple needful"
which works well, except when cloud-init tries to run because it
is already baked into the source image diskimage-builder started
with.

So what would happen is Glean would execute from simple-init,
and then cloud-init would get launched by default, and cloud-init
in some cases everything is DHCP, so suddenly any static
configuration, such as what might be in an attached configuration
drive, is stomped upon resulting in an unreachable instance if
DHCP is just not available.

If DHCP is available, generally this is not an issue and goes
un-noticed, yet can add a substantial amount of time to the
boot sequence "waiting" for meta-data endpoints which may
not exist.

Change-Id: I380b9638cd28f5771530089c558ef5ab638c0173
2023-11-01 09:41:44 -07:00
Zuul 0576fadab8 Merge "Stop creating default user for cloud-init" 2023-10-12 20:53:57 +00:00
Zuul 87e2321d55 Merge "Change default value of DIB_DEBIAN_ALT_INIT_PACKAGE" 2023-10-12 20:53:55 +00:00
Dmitriy Rabotyagov cff37ce502 Stop creating default user for cloud-init
All relatively modern cloud-inits are capable of creating default user
as well as granting root privileges for them. Currently
cloud-init creates pretty much the same sudoers file.
So running steps under the new DIB_DEBIAN_CLOUD_INIT_HELPER
does not make sense for last couple of Debian releases.

Change-Id: I3cebd318f1f0313bba00ecf639328978d3ad0f32
2023-10-10 16:04:31 +00:00
Pierre Riteau 81d9b7f500 Fix indentation of output formats
Change-Id: Id9f10817ac5508f694d9fe6f9b3447ef061fbeb3
2023-09-27 09:55:12 +02:00
Zuul 64a38a518d Merge "Set grub timeout style" 2023-09-20 23:09:34 +00:00
Zuul 4c4bb801ae Merge "Refactor cloud-init element" 2023-09-20 23:09:32 +00:00
Zuul 4f9ef195e3 Merge "Remove extra spaces from GRUB_CMDLINE_LINUX_DEFAULT" 2023-09-20 23:09:29 +00:00
Clark Boylan 252692c660 Update bindep rules for Debuntu
This was precipitated by nodepool switching its image builds to Debian
Bookworm. This caused sibling jobs between nodepool and dib (and others)
to fail because python-lzma and yum-utils could not be installed on
Bookworm.

In order to make this more future proof we reorganize some of the bindep
rules so that they match (or negative match) on static lists of things
which should allow new releases of Ubuntu and Debian to function without
updating the rules again.

Change-Id: I00b099daea099b9de5ee4b563ca7e401b0f856f3
2023-09-18 08:25:21 -07:00
Maksim Malchuk 4fbf564615 Set grub timeout style
Set the grub timeout style to display the menu. By default it set to
'hidden' but can be changed to 'menu' to display the menu and then
wait for the timeout expire before booting the default entry.

Change-Id: I8c58407ef645d528dd77efe866bfe0389cbbbd33
Signed-off-by: Maksim Malchuk <maksim.malchuk@gmail.com>
2023-09-15 20:31:26 +00:00
Maksim Malchuk bccea6d5f0 Refactor cloud-init element
There is no need in pipe and sudo for changing /etc/cloud/cloud.cfg

TrivialFix

Change-Id: I905e8d3964f1322ec3ccc2eb09c517a02ef88044
Signed-off-by: Maksim Malchuk <maksim.malchuk@gmail.com>
2023-09-15 20:31:12 +00:00
Maksim Malchuk c2853c6f2c Remove extra spaces from GRUB_CMDLINE_LINUX_DEFAULT
Remove extra spaces from GRUB_CMDLINE_LINUX_DEFAULT in the
/etc/default/grub when there is no boot laber and/or fips
not enabled.

TrivialFix

Change-Id: Ie83781b9ceca16ff63e08e3d1f887aa6d33fec99
Signed-off-by: Maksim Malchuk <maksim.malchuk@gmail.com>
2023-09-15 17:14:25 +03:00
Dmitriy Rabotyagov 335f8dc6fd Change default value of DIB_DEBIAN_ALT_INIT_PACKAGE
For quite a while Debian is shipped with systemd-sysv
by default. However, default value of DIB_DEBIAN_ALT_INIT_PACKAGE
is not in sync across elements. We change a default now for
the `debian` element along with removing `apt_get_bp_extra_opts`
that is not defined or used anywhere else.

Change-Id: If5d3f0a21467f926c23bb39a1853be73befa768e
2023-08-31 19:20:29 +02:00
Zuul 1897b12ee9 Merge "Deprecate legacy deployment elements" 2023-08-31 14:23:21 +00:00
Zuul 9ee3063af6 Merge "Don't remove packages that are requested to be installed" 2023-08-31 06:09:41 +00:00
Zuul 2193c7c348 Merge "Append detailed printing information when exec_sudo fails" 2023-08-31 04:38:24 +00:00
Maksim Malchuk 0322695a5e Fix and issue with wait_for
Followup I2dd1c60e3bfd9c823a7382b1390b1d40c52a5c97.
The 'wait_for' array always updated even the command not executed
after test because of '&' control operator, so lets wrap construction
in standard 'if..then' case instead of using '&&' control operator.

Change-Id: I1d1ecb05e61f3995a98de450705451b94b437a08
Signed-off-by: Maksim Malchuk <maksim.malchuk@gmail.com>
2023-08-30 15:56:10 +03:00
Zuul 9b931852f7 Merge "Update the shebang to python3" 2023-08-29 15:44:45 +00:00
Julia Kreger a692673b90 Deprecate legacy deployment elements
Legacy elements deploy-tgtadm, deploy-targetcli, and deploy-baremetal
have not seen use in ages. Another element seems to date back to this,
deploy-kexec, but appears to see no actual use as the underlying methods
leveraged by these elements were long moved away from. iSCSI based
deployment being the last, and even then it required the
ironic-python-agent.

Change-Id: Ib5b3a7690c35d6859e2e0fdac2326dcd16c051d3
2023-08-29 08:02:32 -07:00
Zuul 04f140535b Merge "Install netplan.io for Debian Bookworm" 2023-08-28 20:17:42 +00:00
Zuul ed647ba5d8 Merge "Remove lower-constraints.txt" 2023-08-22 23:55:56 +00:00
Zuul 5f1581fc81 Merge "Fix baseurl for Fedora versions before 36" 2023-08-22 23:52:01 +00:00
Steve Baker 420fb14e8f growvols: reserve space for spare metadata volume
Currently space is reserved for the metadata volume, but there is also a
spare metadata volume which is used for metadata check and restore.

This change reserves space for the spare. It also changes the volume
reference in the lvextend call to vg/lv_thinpool, the path based
reference results in the spare not growing.

Resolves: rhbz#2232632
Change-Id: If78743bb37f24756c049939645db202261df6775
2023-08-23 08:29:20 +12:00
Dmitriy Rabotyagov bb9e970835 Install netplan.io for Debian Bookworm
Debian Cloud Images are shipped with netplan as a way to
configure networking for Debian. Without netplan being installed,
images built by DIB with cloud-init do not bring networking up,
since systemd-networkd is not enabled after installation, and there
are no other means to configure networking.

Alternative approach could be to enable networkd, though it is
better to be closer to official cloud images.

Change-Id: I115ab83cf374819bc447fc1bd596e71326d13ed9
2023-08-15 07:40:45 +00:00