Skip to content

Commit

Permalink
Separately delete dom0-rpm provisioned files for dev
Browse files Browse the repository at this point in the history
This will ensure idempotency of delete operations when invoking `sd-clean-all` in staging and production scenarios.
  • Loading branch information
emkll committed Mar 5, 2020
1 parent 22adc28 commit c66fd6b
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions dom0/sd-clean-all.sls
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,16 @@ dom0-reset-power-management-xfce:
- runas: {{ gui_user }}
{% endif %}

# Removes all salt-provisioned files (if these files are also provisioned via
# RPM, they should be removed as part of remove-dom0-sdw-config-files-dev)
remove-dom0-sdw-config-files:
file.absent:
- names:
- /opt/securedrop
- /etc/yum.repos.d/securedrop-workstation-dom0.repo
- /usr/bin/securedrop-update
- /etc/pki/rpm-gpg/RPM-GPG-KEY-securedrop-workstation
- /etc/pki/rpm-gpg/RPM-GPG-KEY-securedrop-workstation-test
- /etc/cron.daily/securedrop-update-cron
- /srv/salt/securedrop-update
- /srv/salt/update-xfce-settings
- /usr/share/securedrop/icons
- /home/{{ gui_user }}/.config/autostart/SDWLogin.desktop
- /usr/bin/securedrop-login
Expand All @@ -47,6 +46,17 @@ remove-dom0-sdw-config-files:
- /home/{{ gui_user }}/Desktop/securedrop-launcher.desktop
- /home/{{ gui_user }}/.securedrop_launcher

# Removes files that are provisioned by the dom0 RPM, only for the development
# environment, since dnf takes care of those provisioned in the RPM
{% if d.environment == "dev" %}
remove-dom0-sdw-config-files-dev:
file.absent:
- names:
- /opt/securedrop
- /srv/salt/securedrop-update
- /srv/salt/update-xfce-settings
{% endif %}

sd-cleanup-etc-changes:
file.replace:
- names:
Expand Down Expand Up @@ -94,4 +104,4 @@ sd-cleanup-rpc-policy-grants:
- DOTALL
- repl: ''
- backup: no
{% endif %}
{% endif %}

0 comments on commit c66fd6b

Please sign in to comment.