Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Arnaud Véron
slapos.package
Commits
a44f8c36
Commit
a44f8c36
authored
1 year ago
by
Joanne Hugé
Browse files
Options
Download
Email Patches
Plain Diff
playbook/upgrader: check sha256sum of playbook after uncompressing it
parent
e5e51ed7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
playbook/roles/upgrader/tasks/main.yml
playbook/roles/upgrader/tasks/main.yml
+7
-3
playbook/sha256sum
playbook/sha256sum
+1
-0
playbook/util/upload-to-cache
playbook/util/upload-to-cache
+1
-0
No files found.
playbook/roles/upgrader/tasks/main.yml
View file @
a44f8c36
...
...
@@ -24,17 +24,21 @@
args
:
chdir
:
/opt/upgrader/tmp
-
name
:
Check uncompressed archive sha256sum
shell
:
cd /opt/upgrader/tmp && find . -type f ! -name 'sha256sum' -print0 | sort -z | xargs -0 sha256sum | sha256sum --check sha256sum
register
:
playbook_sha256sum
-
shell
:
cp -R /opt/upgrader/tmp /opt/upgrader/playbook
when
:
playbook_folder.stat.exists == False
when
:
playbook_folder.stat.exists == False
and playbook_sha256sum.rc ==
0
-
stat
:
path=/opt/upgrader/tmp/hosts
register
:
hosts_file
-
shell
:
rm -rf /opt/upgrader/playbook-tmp
when
:
hosts_file.stat.exists == True
when
:
hosts_file.stat.exists == True
and playbook_sha256sum.rc ==
0
-
shell
:
cp -R /opt/upgrader/tmp /opt/upgrader/playbook-tmp
when
:
hosts_file.stat.exists == True
when
:
hosts_file.stat.exists == True
and playbook_sha256sum.rc ==
0
-
name
:
Save new archive MD5
stat
:
...
...
This diff is collapsed.
Click to expand it.
playbook/sha256sum
0 → 100644
View file @
a44f8c36
9b6a2d1ca9912e9e48f2eb3d6d78e30fc27930337a91f6fd83e288c3b1c47752 -
This diff is collapsed.
Click to expand it.
playbook/util/upload-to-cache
View file @
a44f8c36
...
...
@@ -3,4 +3,5 @@ conf=${1:-/etc/opt/slapcache.cfg}
conf=$(realpath $conf)
cd $playbook_dir
find . -type f ! -name 'sha256sum' -print0 | sort -z | xargs -0 sha256sum | sha256sum > sha256sum
rm -f /tmp/archive.tar.gz && tar -czvf /tmp/archive.tar.gz . && slapcache-upload --file=/tmp/archive.tar.gz --slapos-configuration=$conf
This diff is collapsed.
Click to expand it.
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