Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Roque
slapos
Commits
9f8ee468
Commit
9f8ee468
authored
Sep 06, 2016
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stack-resilient: adds promise for data integrity in pbsready-import
parent
6b5b9f5d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
stack/resilient/buildout.cfg
stack/resilient/buildout.cfg
+1
-1
stack/resilient/pbsready-import.cfg.in
stack/resilient/pbsready-import.cfg.in
+27
-0
No files found.
stack/resilient/buildout.cfg
View file @
9f8ee468
...
...
@@ -50,7 +50,7 @@ mode = 0644
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/pbsready-import.cfg.in
output = ${buildout:directory}/pbsready-import.cfg
md5sum =
b4a48d7fc502ca08d14b52097ccc4c6
e
md5sum =
32343741db4ad7792a27af99da707ba
e
mode = 0644
[pbsready-export]
...
...
stack/resilient/pbsready-import.cfg.in
View file @
9f8ee468
...
...
@@ -24,7 +24,9 @@ parts =
resilient-web-takeover-httpd-wrapper
resilient-web-takeover-httpd-promise
check-backup-integrity-on-notification
import-on-notification
backup-transfer-integrity-promise
resilient-publish-connection-parameter
[resilient-publish-connection-parameter]
...
...
@@ -56,6 +58,31 @@ recipe = slapos.cookbook:notifier.callback
on-notification-id = $${slap-parameter:on-notification}
callback = $${importer:wrapper}
[post-notification-run]
recipe = collective.recipe.template
diff-file-name = $${basedirectory:backup}/backup.diff
input = inline:
#!/${bash:location}/bin/bash
cd $${directory:backup}
find -type f ! -name backup.signature ! -wholename "./rdiff-backup-data/*" -print0 | xargs -P4 -0 sha256sum | LC_ALL=C sort -k 66 > ../proof.signature
diff -ruw backup.signature $${basedirectory:backup}/proof.signature > $${:diff-file-name}
output = $${rootdirectory:bin}/post-notification-run
mode = 0700
[check-backup-integrity-on-notification]
<= notifier
recipe = slapos.cookbook:notifier.callback
on-notification-id = $${slap-parameter:on-notification}
callback = $${post-notification-run:output}
[backup-transfer-integrity-promise]
recipe = slapos.recipe.template:jinja2
template = inline:
#!/${bash:location}/bin/bash
if [ "$(wc -l $${post-notification-run:diff-file-name} | cut -d \ -f1)" -eq 0 ]; then exit 0; else exit 1; fi
rendered = $${basedirectory:promises}/backup-transfer-integrity-promise
mode = 700
###########
# Generate the takeover script
###########
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment