redhat-partner-solutions / crucible

Apache License 2.0
34 stars 59 forks source link

make sure nmstate is installed before generating ISO #256

Closed manurodriguez closed 1 year ago

manurodriguez commented 1 year ago

Fixes: #255

dcibot commented 1 year ago
dcibot commented 1 year ago
dcibot commented 1 year ago
dcibot commented 1 year ago

Starting dci-check-change job.

dcibot commented 1 year ago
dcibot commented 1 year ago

Starting dci-check-change job.

dcibot commented 1 year ago
manurodriguez commented 1 year ago

In the test above, the task passed in an OCP 4.13 deployment, it didn't install nmstate because this is a KVM lab and the install it's done in another task before, but now this fix #255

TASK [generate_agent_iso : Install nmstate] ******************************************************** 4s
task path: /var/lib/dci-openshift-agent/gerrit/28885-0122dcecbb9c0e661db90bd65150cdb7/crucible/roles/generate_agent_iso/tasks/main.yml:1
ok: [bastion] => {"changed": false, "msg": "Nothing to do", "rc": 0, "results": []}
manurodriguez commented 1 year ago

Thanks for the feedback

I think the solution (or at least band-aid) to this issue is to add nmstate here and here such that the user can install themselves or ask the admin of the bastion to do it for them.

Done

Perhaps adding a rescue block around the install and then raise an error with fail would be a good way of allowing users with sudo access to reap the benefit of automation but allowing users without it to see a nice error message with something like install "this" package.

Done

dcibot commented 1 year ago

Starting dci-check-change job.

dcibot commented 1 year ago
dcibot commented 1 year ago

Starting dci-check-change job.

dcibot commented 1 year ago
manurodriguez commented 1 year ago

I squashed the commits and tested two validate the two scenarios: Failed job because nmstate was not installed: https://www.distributed-ci.io/jobs/761cd8cb-02b9-4e9a-af94-41894a1ed28c/jobStates?sort=date&task=03457f31-5ef4-49da-add2-05141b2cf145 working job, not impacted with change because nmstate is installed: https://www.distributed-ci.io/jobs/b1aacd2f-1f3b-46c6-8df5-80d1b2f2386d/jobStates?sort=date&task=dceb8965-aef8-4fd7-a09e-8cab512e30c6

Red Hat SSO required to see the jobs, he failed job looks like this: Screenshot from 2023-07-25 18-13-15