Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the deletion of /mnt while unmount Guest ISO #2

Merged
merged 1 commit into from
Jul 28, 2022

Conversation

LKHN
Copy link
Contributor

@LKHN LKHN commented Jul 21, 2022

Using the "state: absent" for ansible.posix.mount module
on "Unmount VBoxGuestAdditions.iso" task, deletes the mounpoint,
in this case, it's the /mnt directory.
On the other hand, using the "state: unmounted" results stuck
the Vagrant box while the creation of the VMs.

Propose: Since it's a temporary ISO mount and unmount procedure,
let's use a temporary fstab and do not touch the /etc/fstab at all.

There's a long-awaited PR for adding "state: ephemeral"
support to the ansible.posix.mount module1.
We can switch to use this option after the PR merged to the upstream.

This patch can be tested on
https://app.vagrantup.com/almalinux/boxes/8/versions/8.6.20220715
and https://app.vagrantup.com/almalinux/boxes/9/versions/9.0.20220715
Vagrant boxes.

Fixes: AlmaLinux/cloud-images#72

Signed-off-by: Elkhan Mammadli [email protected]

Footnotes

  1. https://github.com/ansible-collections/ansible.posix/pull/267

Using the "state: absent" for ansible.posix.mount module
on "Unmount VBoxGuestAdditions.iso" task, deletes the mounpoint,
in this case, it's the `/mnt` directory.
On the other hand, using the "state: unmounted" results stuck
the Vagrant box while the creation of the VMs.

Propose: Since it's a temporary ISO mount and unmount procedure,
let's use a temporary fstab and do not touch the /etc/fstab at all.

There's a long-awaited PR for adding "state: ephemeral"
support to the ansible.posix.mount module[^1].
We can switch to use this option after the PR merged to the upstream.

This patch can be tested on
https://app.vagrantup.com/almalinux/boxes/8/versions/8.6.20220715
and https://app.vagrantup.com/almalinux/boxes/9/versions/9.0.20220715
Vagrant boxes.

Fixes: AlmaLinux/cloud-images#72

[^1]: ansible-collections/ansible.posix#267

Signed-off-by: Elkhan Mammadli <[email protected]>
@ezamriy ezamriy merged commit dffae47 into ezamriy:master Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vagrant image does not have /mnt path
2 participants