Mount resource not working as expected


#1

I am using mount resource to update fstab configurations from

tmpfs /dev/shm tmpfs defaults 0 0 to tmpfs /dev/shm tmpfs 'nodev,nosuid,noexec' 0 0
I have tried following options

mount 'update mount point configurations' do
  device 'tmpfs'
  fstype 'tmpfs'
  options ['nodev','nosuid','noexec']
  mount_point '/dev/shm'
  dump 0
  pass 0
end

mount 'update mount point configurations' do
  device 'tmpfs'
  fstype 'tmpfs'
  options 'nodev,nosuid,noexec'
  mount_point '/dev/shm'
  dump 0
  pass 0
end

But it is saying everything is up to date and no changes got reflected. Can someone help me out on this.


#2

Hi @phanikumar,

It seems that you forgot to use the action that adds the entry to FSTAB. You should add action :enable

According to the docs (https://docs.chef.io/resource_mount.html), the default action is :mount which is going to mount only and not add nothing to fstab.

Regards,
Claudio


#3

That fixed my issue, thanks