Commit Graph

100 Commits

Author SHA1 Message Date
Adam Williamson
bf4f704096 openqa: improve how we do the git config thing
The background to this is
https://bugzilla.redhat.com/show_bug.cgi?id=2073414 , in response
to which git was changed to die if a user runs git commands
on a repo which it doesn't own. In openQA, the test directory
is a git repo and openQA itself likes to run git commands on it,
but this is often going to be as a different user than the owner
of the directory. In fact on the worker hosts, the user that owns
the directory (geekotest on the server box) doesn't even exist.

This just sets the config by copying a file in place rather than
running a git command (which is hard to get to be idempotent) and
uses `/etc/gitconfig` so we don't wind up with a file in the
_openqa-worker user's home directory, which is meant to be empty.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2022-05-27 10:24:34 -07:00
Adam Williamson
3d148f5e7f openqa/worker: handle git 'safety' check for test dir
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2022-05-27 09:05:06 -07:00
Adam Williamson
f869c0f643 Revert "openqa/worker: handle git 'safety' check for test dir"
This reverts commit 34b3d3a5cc. On
second thoughts it's kinda ugly and I need to think about other
options...
2022-05-26 15:23:13 -07:00
Adam Williamson
34b3d3a5cc openqa/worker: handle git 'safety' check for test dir
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2022-05-26 15:05:00 -07:00
Adam Williamson
38888162ea openQA: remove swtpm-teardown now the work is done
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2021-12-06 14:18:46 -08:00
Adam Williamson
7a5d7f59fb openQA: Drop already-done step from swtpm-teardown
This is just cleaning up the mess of the bad parameter from
earlier, run of this play broke halfway through, need to do the
remaining half without choking on this part.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2021-12-06 14:12:43 -08:00
Adam Williamson
ca2684c711 openQA: fix stupid semodule argument
gah.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2021-12-06 14:05:14 -08:00
Adam Williamson
224e28131d openQA: prepare for prod deployment of latest releases
This unifies prod and stg onto the ways of doing things for the
latest packages, and rejigs the swtpm stuff a bit to tear down
more (we shouldn't need the custom SELinux policy any more).

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2021-12-06 10:40:33 -08:00
Adam Williamson
5889d3a9ae openQA: untag the swtpm-teardown task for stg now it's run
Keeping it around to run on prod when needed, then we'll take it
out.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2021-11-26 14:03:33 -08:00
Adam Williamson
7f3f19035f openQA: test new os-autoinst scratch build on lab
This also tears down our swtpm systemd service setup, as
os-autoinst should now handle swtpm device setup for us.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2021-11-26 12:34:41 -08:00
Adam Williamson
fc3f87b646 Revert "openQA: deploy new qemu build with qxl snapshot fix"
This reverts commit 92e66bb444 and
follow-up commits. We don't need it now we're back on virtio
graphics.
2021-11-12 15:40:00 -08:00
Adam Williamson
d00fdb03eb openqa/worker: install latest qemu-common
to make the last change actually work. temporary change.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2021-11-08 12:21:21 -08:00
Adam Williamson
faa8f6c27b openqa/worker: install packages used by tests
A recent test has a couple of perl deps, we need to ensure these
are installed on the worker hosts.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2021-06-18 08:56:17 -07:00
Adam Williamson
ca112a1922 openQA: update some branch names to 'main' not 'master'
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2021-06-01 13:39:02 -07:00
Adam Williamson
95f062c07a openQA: allow all workers NFS write access, other tweaks
The main goal of these changes is to allow all workers in each
deployment NFS write access to the factory share. This is because
I want to try using os-autoinst's at-job-run-time decompression
of disk images instead of openQA's at-asset-download-time
decompression; it avoids some awkwardness with the asset file
name, and should also actually allow us to drop the decompression
code from openQA I think.

I also rejigged various other things at the same time as they
kinda logically go together. It's mostly cleanups and tweaks to
group variables. I tried to handle more things explicitly with
variables, as it's better for use of these plays outside of
Fedora infra.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-11-05 16:10:32 -08:00
Adam Williamson
be8dc36f7f openqa/worker: sigh restarted not started
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-10-30 14:36:12 -07:00
Adam Williamson
c2023d5560 openQA: try to make NFS mount changes more robust
On client end, restart mount unit (with daemon-reload) if mount
file changes. On server end, run exportfs -r if export config
file changes.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-10-30 14:06:07 -07:00
Adam Williamson
13f59ad0eb openqa/worker: have swtpm service restart on success
This is because swtpm is designed not to be persistent, it's
sort of tied to a single "system" (VM in this case). We can't
expect an instance will stick around after it's been "used", it
doesn't do that, it exits successfully. So we need to restart it
when that happens.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-09-08 10:56:12 -07:00
Adam Williamson
a2bef634cf openqa/worker: use include_tasks not import_tasks
Using `when` with `import_tasks` doesn't actually skip the import
entirely, it just imports the tasks and skips them one by one.
Which reads oddly. `include_tasks` is properly dynamic so seems
better here.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-07-24 14:11:21 -07:00
Adam Williamson
d9f5530046 openqa/worker: configure to use 172. IP range not 10.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-07-23 17:27:19 -07:00
Adam Williamson
6b196e70ab openqa/worker: set up swtpm service on tap worker hosts
swtpm is a TPM emulator we want to use for testing Clevis on
IoT (and potentially other things in future). We're implementing
this by having os-autoinst just add the qemu args but expect
swtpm itself to be running already - that's counted as the
sysadmin's responsibility. My approach to this is to have openQA
tap worker hosts also be tpm worker hosts, meaning they run one
instance of swtpm per worker instance (as a systemd service) and
are added to a 'tpm' worker class which tests can use to ensure
they run on a suitably-equipped worker. This sets up all of that.
We need a custom SELinux policy module to allow systemd to run
swtpm - this is blocked by default.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-06-24 16:59:11 -07:00
Adam Williamson
be6a4937ea openqa/worker: revert br0 netmask
os-autoinst *really really* wants it to be this. The helper
service fails if it isn't.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-06-10 17:05:24 -07:00
Adam Williamson
e7e8fbd6d0 openqa/worker: ignore network.service start fail for now
It's failing on the new IAD worker and I can't figure out why.
Let's skip it for now just to get the plays run.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-06-10 12:56:09 -07:00
Adam Williamson
44434ee9fa openqa/worker: tighten netmask for br0 tap bridge
It shouldn't need anything but 10.0.2.*, and hopefully this will
stop it interfering with the rest of the infra network...

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-06-09 16:31:33 -07:00
Adam Williamson
a720ccac18 openqa/worker: correct scratchrepo cleanup filename
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-05-06 15:08:54 -07:00
Adam Williamson
1b87504450 openqa/worker: make createhdds git branch to use configurable
So we can test non-master branches on stg easier. May extend this
design to other repos (like the tests...) later.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-05-06 14:43:33 -07:00
Adam Williamson
c1adee3cb7 openqa: drop scratch builds, drop hack
Scratch builds are installed now and seem to be working, so on
their way to updates-testing, so we don't need to specify them
here any more. Also drop the hack I put in to get the service
restart handler run.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-04-30 17:03:32 -07:00
Adam Williamson
e9c96f5b4d openqa: really fix the worker service loop this time (I hope)
Thanks mackerman on Freenode...

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-04-30 15:43:26 -07:00
Adam Williamson
6566f6ba3f openqa/worker: try the |int fix for the loop here too
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-04-30 15:33:00 -07:00
Adam Williamson
d9d0048729 openqa/worker: abuse the scratch build stuff to trigger handler
I want this handler to run so I need to abuse something that's
gonna come up 'changed'.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-04-30 15:00:48 -07:00
Adam Williamson
c1b38b5ced openqa/worker: try and fix the service restart handler
It's failing and I don't see why, since I based this right on the
ansible docs. Maybe a |int will help?

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-04-30 15:00:48 -07:00
Adam Williamson
26005bf805 openqa: correct scratch repo config filename
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-04-30 12:38:48 -07:00
Adam Williamson
ba8c7b49ff openqa: create repodata for scratchrepo
Whoops.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-04-30 12:35:00 -07:00
Adam Williamson
bb1525bdef openqa/{server,worker}: enhance package handling
This provides a mechanism for deploying scratch builds, and also
for controlling whether or not to install openQA and os-autoinst
from updates-testing.

I have been doing the scratch build thing for years already, just
manually by ssh'ing into the boxes. This is getting tiring now
we have like 15 worker hosts.

The scratch build mechanism isn't properly idempotent, but fixing
that would be hard and I really only intend to use it transiently
when I'm updating the packages, so I don't think it's worth the
effort.

This also adds a notification for restarting openQA worker
services when the packages or config are updated, and fixes the
worker playbook to enable the last worker service.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-04-30 12:23:57 -07:00
Adam Williamson
22f9b422f6 openqa/worker: fix issues flagged by ansible-lint
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-04-29 17:46:29 -07:00
Adam Williamson
a6b9c5392d openqa/worker: disable aarch64-02 with a special worker class
openqa-aarch64-02.qa is broken in some very mysterious way:
https://pagure.io/fedora-infrastructure/issue/8750
until we can figure that out, this should prevent it picking up
normal jobs, but let us manually target a job at it whenever we
need to for debugging.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-04-24 21:34:26 +02:00
Adam Williamson
f26edfa7e7 openqa/worker: always install network-scripts
No need to conditionalize this any more, F29 is about to go EOL.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-04-24 21:34:14 +02:00
Adam Williamson
f29f9a38e5 openqa: update libsemanage python package names too
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-04-24 21:34:14 +02:00
Adam Williamson
b916a7cba6 openqa: update python selinux package name for Python 3
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-04-24 21:34:14 +02:00
Kevin Fenzi
81fb4582e7 ansible: change when conditions to use == instead of is when checking strings.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:10 +02:00
Karsten Hopp
c9ed62ac32 update ansible_distribution_major_version conditionals
Signed-off-by: Karsten Hopp <karsten@redhat.com>
2020-04-24 21:34:10 +02:00
Adam Williamson
5759ecd1b6 openqa/worker: try and avoid failures in the NFS mount
I thought just having it WantedBy remote-fs.target should be
enough, but in fact this mount often fails on boot, and I forget
to check all the worker boxes until a bunch of tests fail and
everyone is sad. Let's try After=network-online.target and see
if that helps.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2019-06-15 09:11:40 -07:00
Paul W. Frields
7ef3be1d94 openqa: all roles change dnf -> package 2019-06-11 14:39:52 +00:00
Kevin Fenzi
4b31ac5152 ansible: Change all our group names from foo-bar to foo_bar or foo-bar-baz to foo_bar_baz
In ansible 2.8 the - character isn't supposed to be valid in group names.
While we could override this, might has well just bite the bullet and change it.
So, just switch all group names to use _ instead of -

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2019-05-20 17:38:09 +00:00
Peter Robinson
a3b174ccf7 aarch64: add edk2-arm UEFI firmware for oz/imagefactory/openqa for armhfp on aarch64 processes 2019-02-28 20:59:49 +00:00
Adam Williamson
5a902d0cca Make ifcfg change for openqa-ppc64le as well, and drop hack
Hopefully this bit in tap-setup.yml can now go away, as this
approach of using ansible_ifcfg_whitelist and _disabled does the
same thing in a cleaner way.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2018-12-15 10:06:54 -08:00
Adam Williamson
fb01e9ad79 openqa/worker: install network-scripts on F29+ tap workers
network.service isn't in initscripts any more.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2018-12-14 16:19:23 -08:00
Adam Williamson
c69c2fd485 openqa/relvalconsumer: fix all other dnf loop cases to use lists
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2018-10-09 13:50:39 -07:00
Adam Williamson
9a7dc2b145 openqa: Add libsemanage-python to worker createhdds packages
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2018-06-11 15:01:41 -07:00
Adam Williamson
543ffa4c20 openqa/worker: add withlock to packages needed for createhdds
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2018-05-28 17:09:49 -07:00