blog_dirty #8

Merged
cronekorkn merged 10 commits from blog_dirty into master 2023-04-20 11:10:04 +02:00
Showing only changes of commit 8bdf675b47 - Show all commits

View file

@ -1,4 +1,4 @@
size_mb = node.metadata.get('systemd-swap')//1_000_000
size = node.metadata.get('systemd-swap')
actions = {
'stop_swap': {
@ -15,8 +15,8 @@ actions = {
},
},
'create_swapfile': {
'command': f'dd if=/dev/zero of=/swapfile bs=1000000 count={size_mb}',
'unless': f'stat -c %s /swapfile | grep ^{size_mb*1_000_000}$',
'command': f'fallocate -l {size} /swapfile',
'unless': f'stat -c %s /swapfile | grep ^{size}$',
'preceded_by': {
'action:stop_swap',
'action:remove_swapfile',