Commit Graph

35 Commits

Author SHA1 Message Date
Ghanshyam Mann 72ea117f61 Retire Tripleo: remove repo content
TripleO project is retiring
- https://review.opendev.org/c/openstack/governance/+/905145

this commit remove the content of this project repo

Change-Id: Ic549bdcc76a5e12a0104143fbe79fd0db2c866b0
2024-02-24 11:44:35 -08:00
Cédric Jeanneret bed8aa0115 Remove emulation enforcing
Lately this is making the Wallaby on CS9 line crumble. After some tests,
it seems, at least on CS9, we're able to get rid of this option - and
should, since it's crashing virt-customize.

Change-Id: I4e3cbe4507cbe7d1471f75cb41af99f84725b3ad
Closes-Bug: #2018356
Related-Bug: #1743749
2023-05-03 13:03:27 +02:00
Chandan Kumar 85fcfd4eb2 Add modify_image_run_command var to modify-image role
In order to run specific command on the image, we need
to add support for --run-command to the modify image role.
It will be useful to run specific command instead of using
script.

This functionality will be consumed here:
https://review.opendev.org/c/openstack/tripleo-quickstart/+/868864

Related-Bug: #2000226

Signed-off-by: Chandan Kumar <chkumar@redhat.com>
Change-Id: I8575c712467db8fea403459d26731dd7070df131
2022-12-29 20:48:05 +05:30
Steve Baker c3f417bddf Revert "Revert "Use tripleo-mount-image for modify-image""
This reverts commit a7a05c4371.

This was failing on train, ussuri, victoria because the fallback path
assumed the overcloud-full partition image is in raw format, but is
qcow2 on these stable branches.

This revert now includes the same image format detection that was
introduced to tripleo-mount-image in change
I628abc4cb8c46c3b2e5bfd3cd16bb6d5cc95fabe.

Change-Id: I0354a7f8804949916cfccfc22c59f26b54c4c134
2021-11-01 11:44:25 +13:00
Ronelle Landy a7a05c4371 Revert "Use tripleo-mount-image for modify-image"
This reverts commit 1ce3c2b63e.

Reason for revert: https://bugs.launchpad.net/tripleo/+bug/1949107

Change-Id: I2a840646c19ef8896ac1319d165fd93fd4197525
2021-10-28 18:18:45 +00:00
Douglas Viroel df4cd4c55b Revert "In modify-image don't convert qcow2<->raw"
This reverts commit 1526ef8e52.

Reason for revert: https://bugs.launchpad.net/tripleo/+bug/1949107

Change-Id: I9a08cde7a7e613ae4a37f3a0e0021f84f5db509b
2021-10-28 17:59:51 +00:00
Steve Baker 1526ef8e52 In modify-image don't convert qcow2<->raw
With qemu-nbd it is not necessary to mount the raw image. Leaving it
as qcow2 will save around 45 seconds.

Change-Id: I2f4e9c8d0b474b839bcff5b7cf9027f695eef047
2021-10-07 09:29:41 +13:00
Steve Baker 1ce3c2b63e Use tripleo-mount-image for modify-image
tripleo-mount-image will only be backported as far as Wallaby, so a
minimal qemu-nbd fallback is included which assumes a simple partition
image.

Depends-On: https://review.opendev.org/c/openstack/tripleo-common/+/809486
Change-Id: I04c0a589ed32149ef94557ea7ab36d217f8b8d11
Blueprint: whole-disk-default
2021-10-07 09:29:41 +13:00
Sandeep Yadav b14d108ae1 Install lvm2 in modify-image role
Patch[1] added dep on vgscan in modify-image role, This caused
an issue in downstream ovb ci jobs because lvm2 rpm which provides
vgscan command was not installed on node-pool images by default.

It will be good to ensure all require deps installed as part of this
role.

[1] https://review.opendev.org/c/openstack/tripleo-quickstart-extras/+/806283

Depends-On: https://review.opendev.org/c/openstack/tripleo-quickstart/+/810048

Closes-bug: #1944175
Change-Id: I29d8b760ec8b24253886b70c369d7a76bd7659a8
2021-09-21 09:39:45 +00:00
Steve Baker 5045f1ed69 Use qemu-nbd instead of kpartx, handle whole-disk image
This change switches to using qemu-nbd instead of kpartx to unify with
documentation on what tool to use for mount based image
modifications[1].

This change also handles whole-disk images. The script is actually an
inlined version of these scripts which will be packaged with
tripleo-common[2]. This inline script can be replaced with
tripleo-mount-image as soon as it is packaged

Blueprint: whole-disk-default
[1] https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.1/html/bare_metal_provisioning/booting-from-cinder-volumes
[2] https://review.opendev.org/c/openstack/tripleo-common/+/806067

Change-Id: I088bcf7a537d761565faaaa297114f4f0f609f7e
2021-09-10 14:00:27 +12:00
Steve Baker b911d3f9be Don't hard-code overcloud-full
This will soon be overcloud-hardened-uefi-full on master, and the
download will be of a qcow2 file, not a tar file.

This change moves whole_disk_images default setting to extras-common,
and also adds default variable overcloud_image, which is used wherever
'overcloud-full' is currently hard-coded.

Change-Id: Iba7833c16eae3d3129b7bab48434c66ec2e1efcf
Blueprint: whole-disk-default
2021-06-30 10:09:43 +12:00
Ronelle Landy d9fda900b4 Add /etc/resolv.conf if missing for image
RHEL 8.4 image does not include /etc/resolv.conf
automatically.

This review adds the file to the temp dir
used in the modify-image role if it is
missing.

Change-Id: Ia6deca65b3561e8763445923f77355444d9a2ef0
2021-02-22 17:37:27 +00:00
yatinkarel c7905f0b44 [modify-image] Ensure qemu-img is installed
The role relies on qemu-image rpm, let's ensure
it's installed.

It used to be installed with tripleoclient before
[1], since the role relies on that rpm let's have
it as part of role.

Also use set -eo pipefail for convert image task
so that task fail if any part of the script fails.

[1] https://review.rdoproject.org/r/#/c/30690/

Closes-Bug: #1906486
Change-Id: I532e236caad86941db8a4cfcffa4be67c76502b5
2020-12-02 17:34:54 +05:30
Sorin Sbarnea 8b2e5653e4 lint: fixed ansible-lint 301 rule
Change-Id: I8ce7e11cd6027b53f1112c5880a5891c778db9d4
2020-01-05 19:37:09 +00:00
Sorin Sbarnea 16649df878 lint: bumping to latest versions
- run `pre-commit autoupdate` and fixed new issues
- adopted newer pre-commit config for ansible-lint 4.2.0+
- fixed some reported broken rules
- temporary disabled few rules, just to contain the size of of review,
  planning to drop/fix them in follow-ups.

Change-Id: I807ba4e919527be56c85ec72d0f4c7148f04e994
2020-01-05 19:36:36 +00:00
Sorin Sbarnea 72141b7fab Adopt yamllint strict linting
Upgrades yamllint to latest version and adots use of its strict
checking.

Fix all known problems reported by yamllint so we don't have to do
that while touching these files.

Change-Id: I4bdc520d9e2aff086c4b463718bc1e053261a4f5
Story: https://tree.taiga.io/project/tripleo-ci-board/task/381
2018-11-26 12:37:21 +00:00
Bogdan Dobrelya 850595c42a Do not enforce libguestfs emulation mode
Allow users to override the setting on their own risk
of being hit by bug 1743749

Related-Doc: http://libguestfs.org/guestfs.3.html#force_tcg

Related-Bug: #1743749

Change-Id: I5aa3f665d9e449eaa8e91441a3f46d322d5d43a4
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
2018-09-18 07:51:18 +00:00
Derek Higgins d19178ca4f Set the permissions for "/" in the ramdisk
Assert that the "/" directory in the ramdisk has the permissions
of 755 and not leave it up to umask (or chance).

Change-Id: I609914f15b8eca6f3cb8e72099c130b88f294224
Closes-Bug: #1770972
2018-05-18 17:55:46 +01:00
Sagi Shnaidman 24be186119 Mount /dev for chrooted environment
Yum fails to run in chrooted environment because of blocking
access to /dev/urandom. Mount hosts /dev to chrooted.

Close-Bug: #1771755
Change-Id: I4849d77f21163ec8f116859c857a85f9c72ec282
2018-05-17 07:14:57 +00:00
yatin 071b871bad Revert the workarouds for kernel override
Centos 7.5 is released with the new kernel so workaround applied
for Centos 7.4 update kernel needs revert.
The patch reverts the following 4 commits applied
in order to override kernel. Some nested VMs(Skylake) have
issues running virt-customize with kvm backend, so set
LIBGUESTFS_BACKEND_SETTINGS=force_tcg to not use
kvm accelaration. Setting this option drops performance
for running virt-customize a little but can't find any other
option until it's fixed in kernel/kvm.

Revert "add option to turn on/off non default kernel"

This reverts commit fec6fd069d.

Revert "Do not attempt install kernel when chrooted"

This reverts commit d991c1033f.

Revert "Ensure libguestfs_kernel_override kernel is installed"

This reverts commit ff0a5c9ac7.

Revert "Set SUPERMIN_* variables to working kernel"

This reverts commit 6aac21081d.

Change-Id: If46010d7ca14f9dde9a49173aa0b6de91c3826a8
Related-Bug: #1743749
2018-05-12 11:32:37 +05:30
Sagi Shnaidman 69ad943add Add ansible linter rule for set pipefail
When using pipes in ansible shell module we can miss the error
because shell is executing without pipefail by default.
This rule will check every shell module if it has "set -e pipefail"
and will fail in case if not.
It excludes tasks which have 'ignore_errors: true' or register
variables.

Change-Id: I394c72040d62dff76180aeb9d703bb8a212bcc98
2018-04-26 21:32:24 +03:00
Wes Hayutin fec6fd069d add option to turn on/off non default kernel
The default kernel for RHEL is now patched.
Allow this option to be turned off

Change-Id: I9add2b2a09f854e15228d93a6842b7ddb01625a7
2018-04-11 18:17:51 +00:00
Bogdan Dobrelya d991c1033f Do not attempt install kernel when chrooted
When building images from a container/chroot, do not
attempt to install kernels.
Use the shared via the common defaults chrooted param
to control that behavior.

Depends-On: I8cc198bd1081e0c1864228dad6228daa92ac32b7
Related-Bug: #1676373

Change-Id: Ie880a33fbb758240638178c45c43156e80bf4d24
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
2018-03-13 17:47:15 +01:00
yatin ff0a5c9ac7 Ensure libguestfs_kernel_override kernel is installed
https://review.openstack.org/#/c/535293/ assumed
that centos7 base kernel 3.10.0-693.el7.x86_64 is
always installed in the centos 7.4 vm. But it's not true for
some images which are build using DIB(ex: centos7-minimal).
This patch ensures libguestfs_kernel_override kernel
is installed before running virt-customize command.

Change-Id: Ic41b0675153c590ad7daf79a3bc117156f2173f3
2018-01-22 20:22:03 +05:30
yatin 6aac21081d Set SUPERMIN_* variables to working kernel
virt-customize(libguestfs) is not working with current
kernel 3.10.0-693.11.6.el7 in centos.
So until it's fixed in libguestfs or kernel, let's
use working kernel 3.10.0-693.el7.x86_64.
The kernel version is managed using following variable
which can be overridden when required.
Libguesfs requires following environment variables
to use the overridden kernel.

- SUPERMIN_KERNEL_VERSION: {{ libguestfs_kernel_override }}
- SUPERMIN_KERNEL: /boot/vmlinuz-{{ libguestfs_kernel_override }}
- SUPERMIN_MODULES: /lib/modules/{{ libguestfs_kernel_override }}

Change-Id: I129ec6c48d801cd605c4befda5ee00a025480413
Partial-Bug: #1743749
2018-01-19 20:09:45 +05:30
Ronelle Landy a05e1f7622 Fix devmode run of quickstart
Set undercloud inventory before it's used in next playbook.
Fix images update issues and set centos images to newest.
Set 'libguestfs_mode: false' to avoid running virt-customize
on initramfs.

Closes-bug: #1730997

Change-Id: I46dce77166ecb828d4186b3f2ffa56cf9aa9d31e
2017-11-09 13:05:21 +00:00
Adriano Petrich 1a73e9a65b Change where the modify script logs
Right now it logs on something like
/var/lib/oooq-images/repo_setup.sh.log this changes so that it can
save that log on the {{working_dir}} to be more accessible

Change-Id: Ifa7d6eb43ea86e97ef5707d378901d3e2c074a7a
2017-08-30 08:54:22 +01:00
Sagi Shnaidman 3978e82042 Support initramfs images in modify-image role
Add support for initramfs images in modify-image role for
updating packages in CI in ironic-python-agent image.

Change-Id: I1dd4d6fa0629d498c4f0d30da33ff49844ca4068
2017-08-21 13:21:31 +00:00
Sagi Shnaidman c2dc459ac2 Implement different approach to modify image
Because of very long image modifying by libguestfs, implement
different way to do it by converting image to raw, mounting it
and modifying in the place. This patch uses usual tripleo-ci way
to do it, as it was before transition.

Change-Id: Ice4487aa8d263aa7f4a426b7924104a469bd1b52
2017-05-30 18:51:14 +00:00
Raoul Scarazzini b9648724d8 Add root password option to modify-image role
It can be useful (i.e. in baremetal deployments) to set the root
password on the overcloud image, this commit adds this ability to the
modify-image role.

Change-Id: Idf3ee95745c00fbbdbc3a9df4cc8d3e8ea71b46f
2017-03-06 12:50:16 -05:00
John Trowbridge 14b92f0ae1 Reset virt-customize args at the beginning of the role
Without doing this, if a play includes multiple runs of the
modify-image role, the virt-customize args keep growing. This can
lead to unintentionally re-running scripts or re-uploading files.

Since we now ignore user input for vc_args key it is renamed
_vc_args, and the defaults are updated to reflect the variable
being "private".

Change-Id: I17cb09a084136cdaabf4d25dd684f594f1f546eb
2017-03-01 15:44:17 -05:00
Juan Antonio Osorio Robles 8a60cfa2b7 Add "install" option to modify-image role
Change-Id: Ifb8bd648307fa62d974be6a6c04ec34320f925eb
2017-02-20 10:59:28 +02:00
Sagi Shnaidman 61ef59ff2c Support uploading files in modify image role
Support for uploading files to image.

Change-Id: I5cf1959437097f410cc36e1a1536141bfc9da325
2017-01-27 14:24:08 +00:00
Harry Rybacki ce7982192f Integrate undercloud_user var into oooq-extras
We need to differentiate local_working_dir from working_dir
as well as decouple the stack user from `ansible_user` var.
Both of these are causing issues as we begin to automate
deployments in more environments.

- Cleanup duplicate variables that are consumed via extras-common
  - Note: extras-common depends on the common role in OOOQ
- Cleanup redundant var and superfluous quotes from overcloud-scale
  role
- Cleanup redundant comments in <role>/defaults/main.yml

Closes-bug: 1654574
Change-Id: I9c7a3166ed1fc5042c11e420223134ea912b45c5
2017-01-18 09:32:16 -05:00
John Trowbridge 996baf15b1 Add modify-images role
We use virt-customize for many tasks. Instead of having these tasks
all being implemented in different ways across the various roles,
we can instead have a utility role for that purpose. This allows
us to keep the implementation uniform across those tasks and
provides a single place to fix issues with our virt-customize
implementation.

New roles in quickstart-extras will be expected to use this role
for any virt-customize tasks. Eventually, we will want to port
existing virt-customize tasks to use this new role as well.

Change-Id: I6dcb398e17f20a4a2f862873067d92b1b520748c
2017-01-03 21:31:41 +00:00