saltstack-formulas / openssh-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
90 stars 297 forks source link

Can changed config files default to Backup? #116

Closed grendelson closed 5 years ago

grendelson commented 6 years ago

The "backup: minion" setting is not present in the config.sls file. So someone trying to get this working may inadvertently change an SFTP server or a server with custom settings all to defaults and will not have an easy way to restore. Salt allows easy backups and restoration without having to go to tape or other method - any change to an existing file seems like it should Default to "backup"

hudecof commented 5 years ago

I would like to have an option to backup original file before change.

noelmcloughlin commented 5 years ago

The backup option is supported - this issue just needs a PR to implement this.

noelmcloughlin commented 5 years ago

I'm wrong! the backup parameter this issue is requesting is the following?

backup -- Create a backup of the original file with the extension: "Year-Month-Day-Hour-Minutes-Seconds".

I think this issue needs to be raised against salt repo.

For this formula you could add cmd.run state to take a backup?

hudecof commented 5 years ago

@noelmcloughlin adding backup: minion for file.managed should be enough, isn't it?

I'm new in salt, so maybe silly question. I d not want to enable it globally in minion configuration file.

noelmcloughlin commented 5 years ago

I guess yes because I do not like messing with global config either. To be honest I never used the backup:minion option ... and backup: True option is not supported?

If you open a PR to add backup:minion then would fix this issue?