Open NathanDotTo opened 3 years ago
Hi @NathanDotTo , it seems to me there are some lack of consistency in the examples provided in the report. In the first case, you use:
path: "iso"
src: src="/tmp/ubuntu-20.04.1-live-server-amd64.iso"
fstype: cd9660
then, mount_cd9660: No such file or directory
. I guess that the mount helper mount_cd9660
is unable to find the iso image at this location: src="/tmp/ubuntu-20.04.1-live-server-amd64.iso"
. Why this src=
prepending the path ?
In the second case, the values provided are:
path: "/tmp/ubuntu20/iso"
src: "/tmp/ubuntu-20.04.1-live-server-amd64.iso"
fstype: iso9660
and then, mount: exec /Library/Filesystems/iso9660.fs/Contents/Resources/mount_iso9660 for /private/tmp/ubuntu20/iso: No such file or directory
. This time, the mount
command complains that there is no helper command for iso9660
filesystem type.
Could you please retry with your last playbook (the one that is working on Ubuntu), and adjust fstype=cd9660
for Mac OS X ?
hmmm... I think this is not a bug. Or at least this report needs more info, since the two examples provided fail because each embeds a value error (once for src
, once for fstype
).
# First failure reported with:
- name: Mount Ubuntu ISO
ansible.posix.mount:
path: "iso"
src: src="/tmp/ubuntu-20.04.1-live-server-amd64.iso" # no such file or directory
fstype: "cd9660" # valid fstype on Mac OS X
opts: "auto"
state: mounted
and:
# Second failure reported with:
- name: Mount Ubuntu ISO
ansible.posix.mount:
path: "/tmp/ubuntu20/iso"
src: "/tmp/ubuntu-20.04.1-live-server-amd64.iso" # this time, the file exists
fstype: "iso9660" # invalid fstype on Mac OS X
opts: "loop"
state: mounted
Also, opts
change between examples, making more difficult to follow what happens (it's easier to compare things that can be compared, rather than modifying any parameter randomly).
Again, this must be tested on Mac OS X with the proper parameter values (valid fstype cd9660
rather than iso9660
, and a valid file path, not starting with a typo) before stating there is a bug here. What I see here is that the module fails as expected, nothing more.
@NathanDotTo , could you try again, please ? Or someone else ?
@NathanDotTo Could you please try @quidame's suggestion and let us know if it works?
Thanks,
needs_info
Apologies for the delay. This is part of a project to which I am unable to dedicate time now. We plan to have a person full time on this project from April.
On 24 Mar 2021, at 09:04, Abhijeet Kasurde @.***> wrote:
@NathanDotTo https://github.com/NathanDotTo Could you please try @quidame https://github.com/quidame's suggestion and let us know if it works?
Thanks,
needs_info
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ansible-collections/ansible.posix/issues/107#issuecomment-805592146, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGFXFR67PYGFWGVB7XUI73TFGMKXANCNFSM4TDSQPKA.
@NathanDotTo ping ?
I followed @quidame 's suggestions. I now get
"changed": false,
"invocation": {
"module_args": {
"backup": false,
"boot": true,
"dump": null,
"fstab": null,
"fstype": "cd9660",
"opts": "ro,noauto",
"passno": null,
"path": "/tmp/ubuntu20/iso",
"src": "/tmp/ubuntu-20.04.3-live-server-amd64.iso",
"state": "mounted"
}
},
"msg": "Error mounting /tmp/ubuntu20/iso: mount_cd9660: Block device required\nmount: /private/tmp/ubuntu20/iso failed with 1\n"
}
SUMMARY
The CLI commands to mount an ISO with macOS 10.15.7 are illustrated below:
Note that this is a two step process. Also note the type of
cd9660
. The type ofcd9660
is not documented here:https://docs.ansible.com/ansible/latest/collections/ansible/posix/mount_module.html
An equivalent in Ansible would appear to be:
That results in:
I suspect that this is because the
hdiutil
stage illustrated above is not executed.ISSUE TYPE
COMPONENT NAME
ansible.posix.mount
ANSIBLE VERSION
CONFIGURATION
Note that there was no output from
ansible-config dump --only-changed
.OS / ENVIRONMENT
macOS 10.15.7 (19H2)
STEPS TO REPRODUCE
1 - Have a ISO file in
/tmp
, e.g. /tmp/ubuntu-20.04.1-live-server-amd64.iso 2 - Create a directoryiso
, e.g.mkdir iso
2 - Run the playbook below, e.g.sudo ansible-playbook -vvv mount.yml
EXPECTED RESULTS
I expect to see the ISO mounted, as it is with the commands illustrated in the summary above.
ACTUAL RESULTS
The mount fails with file not found.
For the purposes of compare and contrast between macOS and Ubuntu, I have reduced the playbook to the following structure, and I provide examples of execution on macOS, and then Ubuntu.
macOS 10.15.7:
Ubuntu 20.04.1