blog_dirty #8
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -1,4 +1,4 @@ | ||||||
| size_mb = node.metadata.get('systemd-swap')//1_000_000 | size = node.metadata.get('systemd-swap') | ||||||
| 
 | 
 | ||||||
| actions = { | actions = { | ||||||
|     'stop_swap': { |     'stop_swap': { | ||||||
|  | @ -15,8 +15,8 @@ actions = { | ||||||
|         }, |         }, | ||||||
|     }, |     }, | ||||||
|     'create_swapfile': { |     'create_swapfile': { | ||||||
|         'command': f'dd if=/dev/zero of=/swapfile bs=1000000 count={size_mb}', |         'command': f'fallocate -l {size} /swapfile', | ||||||
|         'unless': f'stat -c %s /swapfile | grep ^{size_mb*1_000_000}$', |         'unless': f'stat -c %s /swapfile | grep ^{size}$', | ||||||
|         'preceded_by': { |         'preceded_by': { | ||||||
|             'action:stop_swap', |             'action:stop_swap', | ||||||
|             'action:remove_swapfile', |             'action:remove_swapfile', | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue