-
Notifications
You must be signed in to change notification settings - Fork 123
Add backup attribute to file resource (close #124) #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add backup attribute to file resource (close #124) #191
Conversation
b8ebe41 to
0679caa
Compare
|
|
af1e2d0 to
e40a5c2
Compare
|
@ryotarai Following error occured in Werker at |
lib/itamae/resource/file.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the following is simpler
return if !attributes.backup || attributes.backup <= 0There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I'll fix it.
e40a5c2 to
e1359a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I use run_command("ls -1 #{::File.join(BACKUP_PATH, attributes.path + '.itamae-*')}") ?
(When I use ['ls', '-1', ::File.join(BACKUP_PATH, attributes.path + '.itamae-*'] , * is escaped to \* and can't execute.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current implementation is good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thank you!
0d72069 to
b9224b9
Compare
|
@ryotarai I apologize for my late reply.
|
|
Okay. It is better that |
|
@ryotarai And |
|
As you said, Specinfra doesn't have sufficient commands for this PR but you can send a PR to https://github.com/mizzy/specinfra |
|
@ryotarai OK! I try to send PR to Specinfra. |
b9224b9 to
854962a
Compare
|
@ryotarai I fixed by using Specinfra v2.54.0! |
854962a to
02b3d42
Compare
Add
backupattribute tofile(alsoremote_file,templateandhttp_request).This is the number of backups to be kept in
/var/itamae/backup(default is5.)backupmethod is based on chef/lib/chef/deprecation/provider/file.rb.(This attribute is same as file of Chef.)
For example:
(In this case, file is backed up to
/var/itamae/backup/tmp/file.itamae-20160114001759.)