{"action":"closed","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/29929","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/29929/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/29929/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/29929/events","html_url":"https://github.com/ansible/ansible/issues/29929","id":256904740,"number":29929,"title":"Mount on OSX","user":{"login":"ansibot","id":6585283,"avatar_url":"https://avatars0.githubusercontent.com/u/6585283?v=4","gravatar_id":"","url":"https://api.github.com/users/ansibot","html_url":"https://github.com/ansibot","followers_url":"https://api.github.com/users/ansibot/followers","following_url":"https://api.github.com/users/ansibot/following{/other_user}","gists_url":"https://api.github.com/users/ansibot/gists{/gist_id}","starred_url":"https://api.github.com/users/ansibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansibot/subscriptions","organizations_url":"https://api.github.com/users/ansibot/orgs","repos_url":"https://api.github.com/users/ansibot/repos","events_url":"https://api.github.com/users/ansibot/events{/privacy}","received_events_url":"https://api.github.com/users/ansibot/received_events","type":"User","site_admin":false},"labels":[{"id":454885231,"url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.3","name":"affects_2.3","color":"5319e7","default":false},{"id":48276055,"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04","default":false},{"id":496359346,"url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":636352796,"url":"https://api.github.com/repos/ansible/ansible/labels/support:core","name":"support:core","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-09-12T03:15:35Z","updated_at":"2017-09-12T13:04:07Z","closed_at":"2017-09-12T13:04:07Z","author_association":"CONTRIBUTOR","body":"From @kpaleniu on 2016-01-25T07:41:01Z\r\n##### ISSUE TYPE\n\nBug Report\n##### COMPONENT NAME\n\nmount module\n##### ANSIBLE VERSION\n\nN/A\n##### SUMMARY\n\nI raised this issue on main Ansible project, where the response was to re-raise this in the modules-core project. I hope I do not piss anyone off by copy-pasting the same issue.\n\nAs far as I can tell, mount module works the same way on every POSIX-compatible OS. This means it writes entries to `/etc/fstab` and runs `mount` when appropriate. However, OSX seems to be a major pain in the ass if you try to mount stuff as you would normally. I am using latest OSX El Capitan for testing. I keep running into corner-cases when trying to mount smb shares that require authentication. For example, this works.\n\n```\n- mount:\n    state: mounted\n    fstype: smbfs\n    opts: soft\n    src: //some.user:pass@foo/bar\n    name: /mnt/bar\n```\n\nIt fails if `some.user` was `some-user` instead by giving `No route to host` error. I suspect this triggers some weird bug in `mount_smbfs`. Also, if you leave out `opts`, this defaults to `-o defaults` which for whatever reason does not exist as an option for `mount_smbfs`. Also, I am pretty sure that due to the way OSX handles mounts `/etc/fstab`, all opts are ignored anyway because of `automount`. If you bypass `/etc/fstab` altogether and just run from command line, this works.\n\n```\n$ sudo mount -t smbfs //some-user:pass/foo/bar /mnt/bar\n```\n\nThe less broken way seems to be to use `automount`. The simplified explanation how it works is that `automount` reads its configuration from `/etc/auto_master`. To add mounts, you create a mapping file, e.g `/etc/auto_ansible` that looks roughly like this.\n\n```\nbar        -fstype=smbfs,soft    smb://some-user:pass@foo/bar\n```\n\nThen you add this to `/etc/auto_master` by adding the following line.\n\n```\n/mnt      auto_ansible\n```\n\nThis entry maps that all mappings in `auto_ansible` are mounted under `/mnt`. Finally you invoke the following to do the equivalent of `mount -a`.\n\n```\n$ sudo automount -c\n```\n\nNow my question finally is, could this be implemented at some point?\n\r\nCopied from original issue: ansible/ansible-modules-core#2868\r\n"}}
{"actor":{"display_login":"ansibot"}}