Hello,
I’ve been working on a salt script to configure my development environment. Thanks to some great posts here in the community and good docs I managed to get pretty far already.
I followed mostly this:
- https://forum.qubes-os.org/t/qubes-salt-beginners-guide/20126
- https://dataswamp.org/~solene/2023-06-02-reproducible-config-mgmt-qubes-os.html
And I got to the point where I can already create my template from a cloned fedora template, install the apps that I need and change my default shell.
So far I’ve been only working on a single file I created in /srv/user_salt/developer.sls
And I’ve been using the jinja syntax to decide where to run things.
I trigger salt with: sudo qubesctl --targets=fedora-44-dev state.sls developer
What I wasn’t able to figure out, is how can I apply some changes in the actual AppVM? More precisely I am configuring split ssh, so I know how I can append to the rpc file policy in dom0 with:
/etc/qubes/policy.d/50-ssh.policy:
file.append:
- text: |
qubes.SshAgent * dev vault ask default_target=vault
But how do I get to auto write to the /rw/config/rc.local in my AppVm this part?:
/rw/config/rc.local:
file.append:
- text: |
SSH_VAULT_VM="vault"
if [ "$SSH_VAULT_VM" != "" ]; then
export SSH_SOCK="/home/user/.SSH_AGENT_$SSH_VAULT_VM"
rm -f "$SSH_SOCK"
sudo -u user /bin/sh -c "umask 177 && exec socat 'UNIX-LISTEN:$SSH_SOCK,fork' 'EXEC:qrexec-client-vm $SSH_VAULT_VM qubes.SshAgent'" &
fi
The command runs all states I created, but it never gets to run the one for rw/config/rc.local
I think is because is gated after this else if block:
{% elif grains ['id'] == 'dev' %}
So it never gets to run the rw command block.
Thanks in advance