{"action":"created","issue":{"url":"https://api.github.com/repos/chef/chef/issues/4660","repository_url":"https://api.github.com/repos/chef/chef","labels_url":"https://api.github.com/repos/chef/chef/issues/4660/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef/issues/4660/comments","events_url":"https://api.github.com/repos/chef/chef/issues/4660/events","html_url":"https://github.com/chef/chef/issues/4660","id":138230628,"number":4660,"title":"Mount Resource for bind mounts is not idempotent","user":{"login":"pollosp","id":1783343,"avatar_url":"https://avatars.githubusercontent.com/u/1783343?v=3","gravatar_id":"","url":"https://api.github.com/users/pollosp","html_url":"https://github.com/pollosp","followers_url":"https://api.github.com/users/pollosp/followers","following_url":"https://api.github.com/users/pollosp/following{/other_user}","gists_url":"https://api.github.com/users/pollosp/gists{/gist_id}","starred_url":"https://api.github.com/users/pollosp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pollosp/subscriptions","organizations_url":"https://api.github.com/users/pollosp/orgs","repos_url":"https://api.github.com/users/pollosp/repos","events_url":"https://api.github.com/users/pollosp/events{/privacy}","received_events_url":"https://api.github.com/users/pollosp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-03-03T16:42:32Z","updated_at":"2016-03-10T09:42:22Z","closed_at":null,"body":"## Description\r\n\r\nMount Resource for bind mounts is not idempotent\r\nHere https://tickets.opscode.com/browse/CHEF-5254 is a similar bug opened with version 11.12.2 and fixed in version 11.14.0\r\n\r\n## Chef Version\r\n\r\n12.7.2 + Opscode server version\r\n\r\n## Platform Version\r\n\r\nDebian Jessie 8.3\r\n\r\n## Replication Case\r\n\r\nThis is the provider code.\r\n```\r\nmount '/mnt' do\r\n  device '/tmp'\r\n  fstype 'ext4'\r\n  options %w(bind rw)\r\n  action [:mount, :enable]\r\nend\r\n```\r\n\r\nBind mountpoints in fstab file are mounted again in every chef-run, if you run chef-client four times you are going to have the resource mounted four times.\r\n\r\nFstab file is ok just one line per mount. \r\n\r\nNow mounted binds in jessie are not displaying the word bind as in squeeze with the mount command and using cat /proc/mounts  \r\n \r\n## Client Output\r\n```shell\r\nsudo chef-apply mount.rb\r\n\r\nRecipe: (chef-apply cookbook)::(chef-apply recipe)\r\n  * mount[/mnt] action mount\r\n    - mount /tmp to /mnt\r\n  * mount[/mnt] action enable\r\n    - enable /tmp\r\nvagrant:~/code$\r\nvagrant:~/code$ sudo chef-apply mount.rb\r\nRecipe: (chef-apply cookbook)::(chef-apply recipe)\r\n  * mount[/mnt] action mount\r\n    - mount /tmp to /mnt\r\n  * mount[/mnt] action enable (up to date)\r\nvagrant:~/code$ mount\r\n/dev/sda1 on /mnt type ext4 (rw,relatime,errors=remount-ro,data=ordered)\r\n/dev/sda1 on /mnt type ext4 (rw,relatime,errors=remount-ro,data=ordered)\r\n```\r\n## Stacktrace\r\n\r\n\r\n\r\n### NOTE: CHEF CLIENT BUGS ONLY\r\n\r\nThis issue tracker is for the code contained within this repo -- `chef-client`, base `knife` functionality (not\r\nplugins), `chef-apply`, `chef-solo`, `chef-client -z`, etc.\r\n\r\n* [Server issues](https://github.com/chef/chef-server/issues/new)\r\n* [ChefDK issues](https://github.com/chef/chef-dk/issues/new)\r\n* Cookbook Issues (see the https://github.com/chef-cookbooks repos or search [Supermarket](https://supermarket.chef.io) or GitHub/Google)\r\n"},"comment":{"url":"https://api.github.com/repos/chef/chef/issues/comments/194757959","html_url":"https://github.com/chef/chef/issues/4660#issuecomment-194757959","issue_url":"https://api.github.com/repos/chef/chef/issues/4660","id":194757959,"user":{"login":"josacar","id":1630686,"avatar_url":"https://avatars.githubusercontent.com/u/1630686?v=3","gravatar_id":"","url":"https://api.github.com/users/josacar","html_url":"https://github.com/josacar","followers_url":"https://api.github.com/users/josacar/followers","following_url":"https://api.github.com/users/josacar/following{/other_user}","gists_url":"https://api.github.com/users/josacar/gists{/gist_id}","starred_url":"https://api.github.com/users/josacar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josacar/subscriptions","organizations_url":"https://api.github.com/users/josacar/orgs","repos_url":"https://api.github.com/users/josacar/repos","events_url":"https://api.github.com/users/josacar/events{/privacy}","received_events_url":"https://api.github.com/users/josacar/received_events","type":"User","site_admin":false},"created_at":"2016-03-10T09:42:22Z","updated_at":"2016-03-10T09:42:22Z","body":"yes, I supposed that. I'll try to look for another solution. Also a warning or error should be raised in these scenarios."}}