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
Ophélie Gagnard
slapos.package
Commits
edc6bc62
Commit
edc6bc62
authored
Feb 24, 2023
by
Ophélie Gagnard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playbook: Add upgrade-river
parent
b2b33a0c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
0 deletions
+42
-0
playbook/roles/upgrade-river/meta/main.yml
playbook/roles/upgrade-river/meta/main.yml
+4
-0
playbook/roles/upgrade-river/tasks/main.yml
playbook/roles/upgrade-river/tasks/main.yml
+26
-0
playbook/roles/upgrade-river/vars/main.yml
playbook/roles/upgrade-river/vars/main.yml
+2
-0
playbook/upgrade-river.yml
playbook/upgrade-river.yml
+10
-0
No files found.
playbook/roles/upgrade-river/meta/main.yml
0 → 100644
View file @
edc6bc62
---
dependencies
:
-
{
role
:
package
,
package_name
:
fdisk
,
package_state
:
latest
}
-
{
role
:
package
,
package_name
:
pip
,
package_state
:
latest
}
playbook/roles/upgrade-river/tasks/main.yml
0 → 100644
View file @
edc6bc62
-
name
:
Install networkcache client
shell
:
pip install slapos.libnetworkcache
-
name
:
Get target available kernel version
shell
:
"
apt-cache
policy
linux-image-amd64
|
grep
Candidate
|
awk
'{print
$2}'"
register
:
target_kernel_version
-
name
:
Convert kernel version in list format
shell
:
"
echo
{{target_kernel_version.stdout}}
>
/root/debug;
python3
-c
'import
sys;
print(list(map(int,
sys.argv[1].split(
\"
+
\"
)[0].split(
\"
-
\"
)[0].split(
\"
.
\"
))))'
{{target_kernel_version.stdout}}"
register
:
kernel_version_list_format
-
name
:
Get EFI partition mount point
shell
:
fdisk -l | grep "EFI System" | awk '{print $1}'
register
:
efi_partition_mount_point
-
name
:
Create image directory (if it does not exist)
shell
:
mkdir -p /boot/efi/EFI/Linux/
-
name
:
Downlaod new initramfs image
shell
:
networkcache-download --config /etc/opt/slapos/slapos.cfg --id river "kernel-version=={{kernel_version_list_format.stdout}}" timestamp:max > /boot/efi/EFI/Linux/{{image_name}}
-
name
:
Delete old boot option
shell
:
efibootmgr -b {{default_bootnum}} -B ||
true
-
name
:
Set new boot option
shell
:
efibootmgr -b {{default_bootnum}} --create --disk {{efi_partition_mount_point.stdout}} --label "river" --loader EFI/Linux/{{image_name}}
playbook/roles/upgrade-river/vars/main.yml
0 → 100644
View file @
edc6bc62
default_bootnum
:
100
image_name
:
river
playbook/upgrade-river.yml
0 → 100644
View file @
edc6bc62
# This is part of the OCEAN project.
# The goal of this is to download the right initramfs image from shacache
# when the kernel is upgraded.
-
name
:
a play that runs entirely on the ansible host
hosts
:
127.0.0.1
connection
:
local
roles
:
-
upgrade-river
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