Qubes Salt Beginner's Guide

You could use something like this:

conferencing--download-key:
  cmd.run:
    - name: curl --output /etc/apt/keyrings/skype.asc https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xD4040146BE3972509FD57FC71F3045A5DF7587C3
    - env:
      - https_proxy: http://127.0.0.1:8082
    - creates:
      - /etc/apt/keyrings/skype.asc

This is similar to unman’s recommendation on this topic.

don’t know why this not work form me. Which work is curl -x.

this gives me an error. Deleting this line (since we provided key file externally) make everything work.

It could be that you tried to download something from a HTTP URL while using a proxy with HTTPS. To avoid this issue you could always set both environment variables:

conferencing--download-key:
  cmd.run:
    - name: curl --output /etc/apt/keyrings/skype.asc https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xD4040146BE3972509FD57FC71F3045A5DF7587C3
    - env:
      - http_proxy: http://127.0.0.1:8082
      - https_proxy: http://127.0.0.1:8082
    - creates:
      - /etc/apt/keyrings/skype.asc

Using curl’s --proxy option like you did also works.

That’s great! I will leave this line in the guide tough, because it takes care of transforming Skype’s GPG key from an ASCII-armored format to a binary format, and this is necessary to use the key with the repository.

ahhh ok, I transform them in place using gpg --dearmor. So I got error that they are both the same.

Do you maybe have an idea how to deal with selinux policies in fedora-38? I want to install Threema but I can’t. I remember that I probably disable, selinux, reboot, install reboot and again enable selinux…

I haven’t got any experience with selinux policies, but with Salt I guess you could use the selinux interface to manage them.

A small update for anyone interested in making remote backups with Wyng:

After a few weeks of testing, I wrote section 3.4: Making remote backups. Using Wyng with rclone mount is however quite experimental, so I would recommend using the local backup method instead. This can be complemented with rclone sync for example to upload the local backup files to some cloud storage.

Nevertheless, I hope that these are interesting examples of what can be done with Salt :slight_smile:

Thanks a lot for writing this!

Ken Rosen and I are working on adding more example SALT files to Qubes.

I also hope to see a user SALT directory created by default, backed up by default, and documented.

After we get some very minimal examples set up, some of your example states may be good to include!

4 Likes

Most probably doing something stupid but some collaboration would be needed to ease having qubes-builder-v2 available and ready to use.

I tried to replicate Distribute the build environment for qubes builder (e.g., template or Salt recipe) · Issue #8774 · QubesOS/qubes-issues · GitHub but failed. Any of you willing to put this on github and make this mature, usable and ready to use?

Salt practitioners, one bug is unfixed upstream and some of that salt configuring a quebes-builder after bug manually fixed under q4.2 is totally skipped. If you can contribute that would be awesome Distribute the build environment for qubes builder (e.g., template or Salt recipe) · Issue #8774 · QubesOS/qubes-issues · GitHub

Goal would be to propose the final recipe as PR so that qubesos deploys salt recipes to deploy qubes builder for anyone wanting to build quebes. That would be needed.

Otherwise if you know how to fix this here works less then on github but that would be better than nothing :slight_smile:

Would you or anyone be able to check whether the patch to user-dirs.sls from DemiMarie fixes the issue, and report the result in issue #8491?

I think nobody was able to test it so far, and this may be what’s necessary to solve this bug :slight_smile:

2 Likes

Haha, thanks for the reminder, I forgot I was pinged to try the patch :frowning:

1 Like

Wow really, I upgraded from R4.2.0 alpha so I didn’t even notice that qubes.user-dirs state was broken in later version. Perhaps that’s why @Insurgo cannot use my recipe.

2 Likes

Thank you for that!!!
Done under Ensure that qubes.user-dirs state actually works by DemiMarie · Pull Request #11 · QubesOS/qubes-mgmt-salt-base-config · GitHub

The fix works!

But not the salt recipe to deploy qubes-builder-v2 as reported with logs there and next reply.
Will try other qubes-builder-v2 salt deployment recipe proposed which is co-dependent on other salt recipes and is not as lean as this salt could be… When personal free time permits it.

Reported PR as fixing user salt dir under Ensure that qubes.user-dirs state actually works by DemiMarie · Pull Request #11 · QubesOS/qubes-mgmt-salt-base-config · GitHub

1 Like

As it so happens, I just tried a clean 4.2 install and did set up user dirs there. Friday and yesterday (since I had to redo the install for other reasons). I saw no problem. (I have no idea what this problem was, in fact.)

Does it work reliably when you run highstate? I found it works a third of the time without error

I’m not sure I follow pas two replies. There is a bug, and a pr to fix that bug at Ensure that qubes.user-dirs state actually works by DemiMarie · Pull Request #11 · QubesOS/qubes-mgmt-salt-base-config · GitHub.

Are you both saying you can’t replicate success nor bug with/without fix? Can you please replicate locally qubes builder v2 salt recipes with without fix and comment on both places? The more votes for fixes and bug replication, the faster it is fixed because raising attention. My salt Fu is not good enough to state where thing break, but from my traces posted one can easily see where things go wrong and what is fixed with pr. It needs replication and confirmation.

I didn’t try the fix yet, but the changes applies through salt the fix I reported to work in my original issue, aka the symbolic link required to make it work fine.

I would be surprised if @SteveC doesn’t see the issue at all, because I’ve been able to reproduce it, even two weeks ago again.

1 Like

That is also my point.

1 Like