I do the following command in a series of commands.
I make swap using fallocate -l 65G & chmod 0600
I /sbin/mkswap /mnt/../../swapXXX
I /bin/echo -en '\n/mnt../../swapXXX swap swap auto 0 0\n' >> /etc/fstab
I then do the following and it fails. What am I doing wrong?
exec { "attach swap file":
command => "/sbin/swapon -af -p 1",
require => Exec["make fstab entry"],
unless => "/sbin/swapon -s | grep /mnt/ephemeral0/cassandra/swap65G",
} ->
From log file:
/Stage[main]/Ax::Cassandra::Node/Exec[attach swap file]/returns: executed successfully
dmesg shows
"Adding 68157436k swap on /mnt/ephemeral0/../swap65G. Priority:1 extents:45 across:72851452k SSFS"
free -m
total used free shared buffers cached
Mem: 3774 3213 561 8 106 1646
-/+ buffers/cache: 1460 2314
Swap: 0 0 0
No swap.
But if I run the command on command line it runs fine.
If I do a puppet apply --debug --version it works fine.
The puppet file is applied as root.
WHAT am I doing wrong? It's messing with my mind.
sudo /sbin/swapon -af -p 1
admin@:~$ free -m
total used free shared buffers cached
Mem: 3774 3232 542 8 106 1646
-/+ buffers/cache: 1479 2295
Swap: 66559 0 66559
Dmesg now has two entries!
[Sun Jul 30 02:34:54 2017] Adding 68157436k swap on /mnt/ephemeral0/cassandra/swap65G. Priority:1 extents:45 across:72851452k SSFS
[Sun Jul 30 02:50:43 2017] Adding 68157436k swap on /mnt/ephemeral0/cassandra/swap65G. Priority:1 extents:45 across:72851452k SSFS
Really whats going on?