Remove swap
This commit is contained in:
parent
16bf805717
commit
4be1448dab
|
@ -4,7 +4,7 @@ class sunetdrive::scriptreceiver()
|
|||
sunet::system_user {'script': username => 'script', group => 'script', managehome => true, shell => '/bin/bash' }
|
||||
|
||||
# These tasks correspond to a ${task}.erb.sh template
|
||||
$tasks = ['list_users', 'list_files_for_user', 'create_bucket', 'backup_db', 'purge_backups', 'maintenancemode', 'restart_sunet_service', 'start_sentinel', 'stop_sentinel', 'makeswap', 'backup_multinode_db']
|
||||
$tasks = ['list_users', 'list_files_for_user', 'create_bucket', 'backup_db', 'purge_backups', 'maintenancemode', 'restart_sunet_service', 'start_sentinel', 'stop_sentinel', 'removeswap', 'backup_multinode_db']
|
||||
|
||||
$environment = sunetdrive::get_environment()
|
||||
$config = hiera_hash($environment)
|
||||
|
@ -90,6 +90,12 @@ class sunetdrive::scriptreceiver()
|
|||
minute => '*',
|
||||
hour => '*',
|
||||
}
|
||||
file { '/home/script/bin/makeswap.sh':
|
||||
ensure => absent,
|
||||
}
|
||||
file { '/etc/sudoers.d/99-makeswap':
|
||||
ensure => absent,
|
||||
}
|
||||
$tasks.each |String $task| {
|
||||
file { "/home/script/bin/${task}.sh":
|
||||
ensure => file,
|
||||
|
|
9
templates/scriptreceiver/removeswap.erb.sh
Normal file
9
templates/scriptreceiver/removeswap.erb.sh
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
# Clean up old swap version
|
||||
swapoff -a
|
||||
cryptsetup remove cryptswap1
|
||||
sed -i 's_^/dev/mapper/cryptswap1 none swap sw 0 0__' /etc/fstab
|
||||
sed -i 's_/swapfile none swap sw 0 0__' /etc/fstab
|
||||
sed -i 's_cryptswap1 /swapfile /dev/urandom swap,offset=1024,cipher=aes-xts-plain64__' /etc/crypttab
|
||||
rm /swapfile
|
||||
rm /cryptswap1
|
Loading…
Reference in a new issue