Chef not executing "mount" on first bootstrap

173 views Asked by At

I am trying to mount s3fs using chef. I could not get the mounts resource to work for s3fs and the vendor cookbook for s3fs wants to name the mount something different than what we want to name it (our s3 buckets have "." in the name).

So I manually created the fstab record and run a "mount" command to mount it. However the mount is not running. There are no errors and the chef log file says it executed the block.

bash 'mount_s3fs' do
  code <<-EOF 
  mount -a
  EOF
  user 'root'
  not_if "df -kh | grep s3fs -q"
end

Here is what gets printed to the log file

[2016-12-29T21:29:02+00:00] INFO: Processing bash[mount_s3fs] action run (cookbook::recipe line 66)
[2016-12-29T21:29:03+00:00] INFO: bash[mount_s3fs] ran successfully

If I run the recipe a second time it mounts just fine. If I add the recipe after bootstrap it runs fine. I am incredibly perplexed. As this behavior is only seen at bootstrap.

I am running on chef 12.12.15 on Debian Jessie 8.4 in AWS.

2

There are 2 answers

0
Allen K On BEST ANSWER

Well, after hours and hours of troubleshooting, I think that the issue is with Debian itself. If I run this same script with a Debian 8.0 AMI it works fine, If I go up to a 8.4 or higher image it doesn't work. I did not test with an 8.1, 8.2 or 8.3 because, well, I am tired of this issue.

3
coderanger On

While this doesn't appear to be related to Chef, you should probably fix your recipe code to use a mount resource instead.