Hey @heatmiser,
Thanks for prodding me a bit. Iāve been meaning to reply for awhile but I keep going around in circles. This is still very much a work in progress. I had some stuff working in Fedora SB 30 and now on SB 31 some stuff works better and other stuff is broken. Anyway, have a look here,
https://github.com/flannon/dotfiles-fedora-sb
My initial idea was to build two toolbox containers, control and $USER, and use ansible to provision them. After awhile I realized I really only need one container, so now everything runs from the $USER container. The control playbook makes a network connection on 127.0.0.1 and installs flatpaks on the host, while the user playbook makes an ansible local connection, installing packages with dnf in the $USER container.
Thereās a few things that need to be done to get started. First thereās setup.sh. On SB 30 there wasnāt H.264 support for video so I had to install rpmfusion and compat-ffmpeg28 with rpm-ostree. On SB 31 this is no longer necessary and Iāve gotten things worked out so I donāt need to install any packages on the base image. So now setup.sh pretty much just configures sshd for remote connectivity on 127.0.0.1. This part worked just fine on SB 30, but for some reason I havenāt been able to get remote login working on SB 31. At this point, when I ssh to 127.0.0.1 I canāt authenticate, either with ssh key, or with a password. So I still have to sort that out again.
After setup.sh itās time to run errata.sh. I ran into a problem on SB 30 where I was getting a āfailed ot obtain transaction lockā error thatās described in this issue, dnf transaction fails inside Fedora container and corrupts container Ā· Issue #108 Ā· containers/fuse-overlayfs Ā· GitHub. I havenāt had time to look into it to see if this is still an issue on SB 31, so for now Iām still running errata.sh.
A couple of more steps and weāll get to where things are āautomaticā. So next up is build.sh, which is going to set up the $USER container and do the first ansible run. Thereās also a wrapper for ansbile so you can re-run the playbooks by doing ansible-run.sh $USER
or ansible-run.sh control
.
At this point Iām pretty much running all my desktop applications from the $USER container, but there are a few idiosyncrasies that come along with the system. I used $USER for the container name, rather than just using the default container, because I built this on my home computer, but now Iām also running it on my workstaion and laptop at work, so I like the name difference. But itās a pain to always have to do toolbox enter -c $USER
, so in by .bashrc I have āalias enter="toolbox -c $USERā. Iāve also installed VSCode in the $USER container, but sometimes I want to run it from a regular shell session. Iāve got it so code will now start anywhere with this alias: alias code=ātoolbox run -c terrance bash -c ā'ācodeā'āā. The other thing I had problems with was vim. I like to alias vi to vim, but in this situation vim only lives in the container. Itās a bit of kludge but I ended up aliasing vi to v, and vim to vi, which works well enough that Iām happy.
Rather than bloating the playbook I like to write roles and call the role from the playbook, even for silly things like this. So the user role is in dotfiles-fedors-sb/ansible/roles/local/fedora_sb_user. The templates directory has my bashrc and some package repo definitions, and the tasks directory is where most everything happens. When it runs it installs some packages, sets up vim and vundle, installs vscode, keybase, chrome and some other stuff. It does a decent job for what it is, but I have to say Iām starting to have serious doubts about using toolbox at all. My quible comes at the point where toolbox presents a completely mutable containerized environment. Iād rather it were variably mutable, than completely mutable. With that in mind Iāve shifted focus and Iām working on using buildah to provision a container image from the ansible user playbook. Itās not working yet, but Iāve got the building a container in a container part mostly working now, so Iām hopeful itāll be running before too long.
-f