Improve cmd.run usage
Summary:
By nature, cmd.run is an imperative order more than a descriptive one.
This change ensures:
- file.managed is used to set file modes/ownership
- the descriptive creates is used instead of unless: test -f ...
Fixes T1349.
Test Plan:
$ salt eglide state.apply roles/shellserver/odderon/config […] Comment: File /opt/odderon/var/darkbot/userlist.db exists with proper permissions. No changes made. […] $ salt eglide state.apply roles/webserver-core/letsencrypt/certificates test=True […] Comment: /etc/letsencrypt/live/www.eglide.org/fullchain.pem exists […]
Reviewers: dereckson
Reviewed By: dereckson
Maniphest Tasks: T1349
Differential Revision: https://devcentral.nasqueron.org/D1359