Accidentally deleting /etc/salt

I accidentally deleted everything in /etc/salt with “sudo rm -r *” How can i restore everything there? Sadly dom0 backups only include /home directory
Where can i download default /etc/salt files?

1 Like

You should try to reinstall all salt-related packages and see if you can recover from that:

sudo qubes-dom0-update --action=reinstall $(rpm -qa --qf "%{NAME}\n" | grep salt | tr '\n' ' ')
1 Like
dnf provides /etc/salt/minion.dom0.conf
qubes-mgmt-salt-config-4.2.2-1.fc37.noarch : Qubes+Salt Management base configuration for SaltStack's Salt Infrastructure
                                           : automation and management system.
Dépôt               : @System
Correspondances trouvées dans  :
Nom de fichier : /etc/salt/minion.dom0.conf

Reinstalling package qubes-mgmt-salt-config may help.

Best reply would be to say “recover from backups” but I guess you have no backups? I always either install etckeeper that keeps track of all /etc in git, or do it manually by adding everything in /etc/ in a git repository

1 Like

i used integrated qubes os backup tool, but i didn’t knew that it only backups /home in dom0

1 Like

How can i reset all salt configuration and get default one? I feel like by deleting everything /etc/salt i broke something in other configuration files that may be located somewhere else

1 Like

did you try the command above to reinstall the package qubes-mgmt-salt-config? This may be enough to fix the problem.

1 Like

yeah, it fixed the problem completely. But, resetting salt to default completely may prevent unexpected problems in the future

1 Like

Can you share the output of this command? This will allow to check if some files were changed on my computer compared to yours.

$ sudo find /etc/salt/ -type f -exec sha256sum {} +

My results are

f1492d2590bf0197a947eafccce51644fb5de75f2c395b39b7a03c9c5a64b27a  /etc/salt/minion.vm.conf
c4508b7583d8bbd769b78bd5a3240868e26358d0b0b45dfe4952d701eb62c74e  /etc/salt/minion.d/f_defaults.conf
a8b3f6eadb1f260b27acb66ba5713acf0148f595ff96fd74c59ed860a0f2db5f  /etc/salt/minion.d/formula-virtual-machines.conf
792b8238f342ade66d2fcc6363aba411594db489e39379344de65995370854a0  /etc/salt/minion.d/qubes_ext_pillar.conf
7611db6af0e9da27bb829fd89dbc50cc3492c2f6ec25dc82c5fd9dc6c420f114  /etc/salt/minion.d/formula-update.conf
d5db8ed53d6e0f95188c52168f7802d33bf32028547591509d242e8d7480dbc7  /etc/salt/spm
480ff43ea084d5f576f60091ddbe3a88bcb64c27a217292b7d8207fb408d16bc  /etc/salt/minion_id
90b2a7581fb71b16714feeec90fd3bcb6bc39bbe6d46caab898375d441512aa3  /etc/salt/minion
77c3bdd85ad2dc959c419a2c308f80b69431db13afaca74c7b16dd216217a559  /etc/salt/minion.dom0.conf
f5c8220c57bd0fd73cc314c6ddfe1bb95c21772af049cb1e3cad4282e914945f  /etc/salt/proxy
055f1c4e7bcc1b2846127eef631f4c68cab840d08ff1afddeab15b7950a36bf5  /etc/salt/spm.repos.d/local.repo
ad285a8304df7539e823d4aca5da2e12722e6930bfe6d0c4a34fc482a9dca634  /etc/salt/minion.dist

Please also share the output of

$ sudo find /etc/salt/
1 Like

Hashes:

77c3bdd85ad2dc959c419a2c308f80b69431db13afaca74c7b16dd216217a559 /etc/salt/minion.dom0.conf
90b2a7581fb71b16714feeec90fd3bcb6bc39bbe6d46caab898375d441512aa3 /etc/salt/minion
d5db8ed53d6e0f95188c52168f7802d33bf32028547591509d242e8d7480dbc7 /etc/salt/spm
f1492d2590bf0197a947eafccce51644fb5de75f2c395b39b7a03c9c5a64b27a /etc/salt/minion.vm.conf
792b8238f342ade66d2fcc6363aba411594db489e39379344de65995370854a0 /etc/salt/minion.d/qubes_ext_pillar.conf
c4508b7583d8bbd769b78bd5a3240868e26358d0b0b45dfe4952d701eb62c74e /etc/salt/minion.d/f_defaults.conf
a8b3f6eadb1f260b27acb66ba5713acf0148f595ff96fd74c59ed860a0f2db5f /etc/salt/minion.d/formula-virtual-machines.conf
e73832118e200778e8ff18a792e85e288b24af9188338f22b10ef213c2788c55 /etc/salt/minion.d/qusal.conf
7611db6af0e9da27bb829fd89dbc50cc3492c2f6ec25dc82c5fd9dc6c420f114 /etc/salt/minion.d/formula-update.conf
ad285a8304df7539e823d4aca5da2e12722e6930bfe6d0c4a34fc482a9dca634 /etc/salt/minion.dist
f5c8220c57bd0fd73cc314c6ddfe1bb95c21772af049cb1e3cad4282e914945f /etc/salt/proxy
055f1c4e7bcc1b2846127eef631f4c68cab840d08ff1afddeab15b7950a36bf5 /etc/salt/spm.repos.d/local.repo
480ff43ea084d5f576f60091ddbe3a88bcb64c27a217292b7d8207fb408d16bc /etc/salt/minion_id

I don’t know if results are useful at all, probably not, since i installed ben’s gradle salt scripts and that probably changed some things or all things in the folder
find /etc/salt:

/etc/salt/
/etc/salt/minion.dom0.conf
/etc/salt/minion
/etc/salt/pki
/etc/salt/pki/minion
/etc/salt/spm
/etc/salt/minion.vm.conf
/etc/salt/minion.d
/etc/salt/minion.d/minion.dom0.conf
/etc/salt/minion.d/qubes_ext_pillar.conf
/etc/salt/minion.d/f_defaults.conf
/etc/salt/minion.d/formula-virtual-machines.conf
/etc/salt/minion.d/qusal.conf
/etc/salt/minion.d/formula-update.conf
/etc/salt/minion.dist
/etc/salt/proxy
/etc/salt/spm.repos.d
/etc/salt/spm.repos.d/local.repo
/etc/salt/minion_id

1 Like

The checksum list matches exactly the one I shared earlier, except the extra qusal.conf file, so I think your salt install is correctly restored.

2 Likes