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

better support for CentOS; reboot if installer was unable to reload kernel module #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

xy2
Copy link

@xy2 xy2 commented Jan 17, 2021

Differences by OS family simplified and clarified. Role didn't work for me on CentOS as-is.

Kernel headers packages are removed quickly, so installation may fail if kernel is not updated. Added flag for it.

Detect if VM is still running old version of module and reboot.

@PeterMosmans
Copy link
Owner

Thanks for your additions! I'll be testing the PR shortly on other OS flavors...

@@ -79,12 +82,51 @@
ISO_path: "{{ file_path.stat.path if file_path.stat.exists else CD_path.stat.path }}"

- name: Check if VBoxGuest additions ISO is mounted
shell: mount -l 2>/dev/null|awk '/VBOXADDITIONS/{print $3}'
shell: mount -l 2>/dev/null|awk '/VBox_GAs/{print $3}'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem OS-independent. There should be a nicer way of checking whether it's mounted - the current function is bit clunky

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch, that's not about OS. Looks like VirtualBox ISO volume name changed. And yes, mount detection fails for me a lot, too.

For both Debian and RPM distributions I have:

$ iso-info /usr/share/virtualbox/VBoxGuestAdditions.iso | grep '^Volume'
Volume      : VBox_GAs_6.1.18

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for that info, that helps. I'll try to find a cleaner way to detect a mounted disk: Maybe just probing for the file/binary?

state: present
when: kernel is defined and kernel.stdout is defined
- name: Get running kernel version
shell: "uname -r"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When no output redirection is necessary, it's safer to use the command module instead of the shell module.

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.

2 participants