{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/86","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/86/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/86/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/86","id":44473016,"number":86,"title":"mount module doesn't work correctly with mount option \"bind\"","user":{"login":"jamesgoodhouse","id":4684194,"avatar_url":"https://avatars.githubusercontent.com/u/4684194?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesgoodhouse","html_url":"https://github.com/jamesgoodhouse","followers_url":"https://api.github.com/users/jamesgoodhouse/followers","following_url":"https://api.github.com/users/jamesgoodhouse/following{/other_user}","gists_url":"https://api.github.com/users/jamesgoodhouse/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesgoodhouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesgoodhouse/subscriptions","organizations_url":"https://api.github.com/users/jamesgoodhouse/orgs","repos_url":"https://api.github.com/users/jamesgoodhouse/repos","events_url":"https://api.github.com/users/jamesgoodhouse/events{/privacy}","received_events_url":"https://api.github.com/users/jamesgoodhouse/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/bug_report","name":"bug_report","color":"fbca04"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/P3","name":"P3","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-09-30T17:09:22Z","updated_at":"2015-02-11T19:53:34Z","closed_at":null,"body":"##### Issue Type:\r\nBug Report\r\n\r\n##### Ansible Version:\r\nansible 1.5.4\r\n\r\n##### Environment:\r\nAnsible is running from OS/X Mavericks 10.9.2\r\nI am managing an Ubuntu 12.04 instance\r\n\r\n##### Summary:\r\nWhen using the mount module and specifying an option of \"bind\", the filesystem is mounted over and over. This has been tracked down to what appears to be Python's os.path.ismount(path) returning false for any mounts with the bind option applied.\r\n\r\n##### Steps To Reproduce:\r\nCreate a mount using the mount module with the following options:\r\n\r\n- fstype: none\r\n- opts: rw,bind\r\n- state: mounted\r\n\r\n##### Expected Results:\r\nI expect to see the mount point show up in /etc/fstab, the mount point to show when the command \"mount\" is ran in the terminal, and for the Ansible task to not show as \"changed\" for each run when no change has occurred.\r\n\r\n##### Actual Results:\r\nThe mount point shows up properly in /etc/fstab, but the mount point is mounted each time the Ansible task is ran, causing it to be mounted over and over on the system as well as for the Ansible task to show the status of \"changed\"."},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/73951954","html_url":"https://github.com/ansible/ansible-modules-core/issues/86#issuecomment-73951954","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/86","id":73951954,"user":{"login":"Jmainguy","id":1372228,"avatar_url":"https://avatars.githubusercontent.com/u/1372228?v=3","gravatar_id":"","url":"https://api.github.com/users/Jmainguy","html_url":"https://github.com/Jmainguy","followers_url":"https://api.github.com/users/Jmainguy/followers","following_url":"https://api.github.com/users/Jmainguy/following{/other_user}","gists_url":"https://api.github.com/users/Jmainguy/gists{/gist_id}","starred_url":"https://api.github.com/users/Jmainguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jmainguy/subscriptions","organizations_url":"https://api.github.com/users/Jmainguy/orgs","repos_url":"https://api.github.com/users/Jmainguy/repos","events_url":"https://api.github.com/users/Jmainguy/events{/privacy}","received_events_url":"https://api.github.com/users/Jmainguy/received_events","type":"User","site_admin":false},"created_at":"2015-02-11T19:53:34Z","updated_at":"2015-02-11T19:53:34Z","body":"It depends on the target, centos7 doesn't seem to be affected by this bug. Debian 7 does.\r\n\r\nTarget ns1.example.com\r\n\r\n# cat /etc/*release\r\nPRETTY_NAME=\"Debian GNU/Linux 7 (wheezy)\"\r\nNAME=\"Debian GNU/Linux\"\r\nVERSION_ID=\"7\"\r\nVERSION=\"7 (wheezy)\"\r\nID=debian\r\nANSI_COLOR=\"1;31\"\r\nHOME_URL=\"http://www.debian.org/\"\r\nSUPPORT_URL=\"http://www.debian.org/support/\"\r\nBUG_REPORT_URL=\"http://bugs.debian.org/\"\r\n\r\n\r\n[root@phy01 ~]# ansible -i hosts all -m mount -a \"name=/mnt/test src=/tmp opts=rw,bind state=mounted fstype=none\"                                                                             \r\nns1.example.com | success >> {\r\n    \"changed\": true,\r\n    \"fstab\": \"/etc/fstab\",\r\n    \"fstype\": \"none\",\r\n    \"name\": \"/mnt/test\",\r\n    \"opts\": \"rw,bind\",\r\n    \"src\": \"/tmp\"\r\n}\r\n\r\n[root@phy01 ~]# ansible -i hosts all -m mount -a \"name=/mnt/test src=/tmp opts=rw,bind state=mounted fstype=none\"\r\nns1.example.com | success >> {\r\n    \"changed\": true,\r\n    \"fstab\": \"/etc/fstab\",\r\n    \"fstype\": \"none\",\r\n    \"name\": \"/mnt/test\",\r\n    \"opts\": \"rw,bind\",\r\n    \"src\": \"/tmp\"\r\n}\r\n\r\n[root@phy01 ~]# ansible -i hosts all -m mount -a \"name=/mnt/test src=/tmp opts=rw,bind state=mounted fstype=none\"\r\nns1.example.com | success >> {\r\n    \"changed\": true,\r\n    \"fstab\": \"/etc/fstab\",\r\n    \"fstype\": \"none\",\r\n    \"name\": \"/mnt/test\",\r\n    \"opts\": \"rw,bind\",\r\n    \"src\": \"/tmp\"\r\n}\r\n\r\n[root@phy01 ~]# ansible -i hosts all -m mount -a \"name=/mnt/test src=/tmp opts=rw,bind state=mounted fstype=none\"\r\nns1.example.com | success >> {\r\n    \"changed\": true,\r\n    \"fstab\": \"/etc/fstab\",\r\n    \"fstype\": \"none\",\r\n    \"name\": \"/mnt/test\",\r\n    \"opts\": \"rw,bind\",\r\n    \"src\": \"/tmp\"\r\n}\r\n\r\n\r\n\r\nns1:~# mount -l\r\nsysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)\r\nproc on /proc type proc (rw,nosuid,nodev,noexec,relatime)\r\nudev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=14299,mode=755)\r\ndevpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)\r\ntmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=12460k,mode=755)\r\n/dev/disk/by-uuid/641c7238-38ef-4a20-8775-96d66411bdb7 on / type ext3 (rw,relatime,errors=remount-ro,barrier=1,data=ordered)\r\ntmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)\r\ntmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=73440k)\r\nrpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)\r\n/dev/disk/by-uuid/641c7238-38ef-4a20-8775-96d66411bdb7 on /mnt/test type ext3 (rw,relatime,errors=remount-ro,barrier=1,data=ordered)\r\n/dev/disk/by-uuid/641c7238-38ef-4a20-8775-96d66411bdb7 on /mnt/test type ext3 (rw,relatime,errors=remount-ro,barrier=1,data=ordered)\r\n/dev/disk/by-uuid/641c7238-38ef-4a20-8775-96d66411bdb7 on /mnt/test type ext3 (rw,relatime,errors=remount-ro,barrier=1,data=ordered)\r\n/dev/disk/by-uuid/641c7238-38ef-4a20-8775-96d66411bdb7 on /mnt/test type ext3 (rw,relatime,errors=remount-ro,barrier=1,data=ordered)\r\n\r\n"}}