Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Tyagov
slapos.package
Commits
a44f8c36
Commit
a44f8c36
authored
Jun 13, 2023
by
Joanne Hugé
Browse files
Options
Browse Files
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 @@
...
@@ -24,17 +24,21 @@
args
:
args
:
chdir
:
/opt/upgrader/tmp
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
-
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
-
stat
:
path=/opt/upgrader/tmp/hosts
register
:
hosts_file
register
:
hosts_file
-
shell
:
rm -rf /opt/upgrader/playbook-tmp
-
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
-
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
-
name
:
Save new archive MD5
stat
:
stat
:
...
...
playbook/sha256sum
0 → 100644
View file @
a44f8c36
9b6a2d1ca9912e9e48f2eb3d6d78e30fc27930337a91f6fd83e288c3b1c47752 -
playbook/util/upload-to-cache
View file @
a44f8c36
...
@@ -3,4 +3,5 @@ conf=${1:-/etc/opt/slapcache.cfg}
...
@@ -3,4 +3,5 @@ conf=${1:-/etc/opt/slapcache.cfg}
conf=$(realpath $conf)
conf=$(realpath $conf)
cd $playbook_dir
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
rm -f /tmp/archive.tar.gz && tar -czvf /tmp/archive.tar.gz . && slapcache-upload --file=/tmp/archive.tar.gz --slapos-configuration=$conf
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