bootc icon indicating copy to clipboard operation
bootc copied to clipboard

`system-reinstall-bootc` needs `-y` and `--user` non-interactive installation

Open henrywang opened this issue 9 months ago • 5 comments

There should be an automatic way to do installation and for automation test.

  • -y is more like dnf -y
  • --user is for user key injection

henrywang avatar Mar 25 '25 10:03 henrywang

Agreed in general, though for the use case of automated testing I think one of the tools listed from e.g. https://en.wikipedia.org/wiki/Expect would work too.

cgwalters avatar Mar 25 '25 11:03 cgwalters

I tried expect, it does not work in our case... e.g. https://github.com/bootc-dev/bootc/issues/1206.

henrywang avatar Mar 25 '25 13:03 henrywang

This's what I did:

diff --git i/playbooks/install.yaml w/playbooks/install.yaml
index 112673b..7eff66a 100644
--- i/playbooks/install.yaml
+++ w/playbooks/install.yaml
@@ -94,17 +94,22 @@
         - bootc_version is version('1.1.3', '<')
 
     - name: Single command deploys bootc image
-      command:
-        "podman run \
-         --rm \
-         --tls-verify=false \
-         --privileged \
-         --pid=host \
-         {{ test_image_url }} \
-         bootc install to-existing-root"
+      expect:
+        command: "system-reinstall-bootc {{ test_image_url }}"
+        responses:
+          "into the root user on the new bootc system":
+            - "Y"
+            - "Y"
+            - "Y"
+          "import into the root user of the new bootc system:":
+            - " "
+          "THIS WILL REINSTALL YOUR SYSTEM! Are you sure you want to continue":
+            - "y"
+            - "Y"
+            - "Y"
       become: true
       when:
-        - bootc_version is version('1.1.3', '>=')
+        - bootc_version is version('1.1.6', '>=')

henrywang avatar Mar 25 '25 14:03 henrywang

Oh right cool, Ansible has an expect module too.

But is it working?

cgwalters avatar Mar 25 '25 17:03 cgwalters

expect module works, but system-reinstall-bootc interactive installation "issue"(not exactly an issue) like https://github.com/bootc-dev/bootc/issues/1206 blocked expect.

henrywang avatar Mar 26 '25 06:03 henrywang