-
Notifications
You must be signed in to change notification settings - Fork 22
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
base: master
Are you sure you want to change the base?
Conversation
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}' |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
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.