Fix virtualbox tools install (#9)

Ubuntu 22.04 has the tools available and does not need to install from
ISO. This was hanging, though no output seemed to indicate why. So we're
avoiding the ISO altogether and going with the Ubuntu packages
This commit is contained in:
Greg Hellings
2022-06-19 15:15:35 -05:00
committed by GitHub
parent 92c4b67ded
commit 214b1974ca
2 changed files with 18 additions and 9 deletions
+17 -7
View File
@@ -27,17 +27,27 @@
- name: Run commands to install from ISO - name: Run commands to install from ISO
when: virtualbox_from_iso when: virtualbox_from_iso
become: true
block: block:
- name: Mount iso file - name: Mount ISO file
become: true ansible.posix.mount:
ansible.builtin.command: "{{ item }}" fstype: auto
path: /mnt
src: "{{ virtualbox_iso_location }}"
state: mounted
boot: false
opts: loop
- name: Install additions
ansible.builtin.command: /mnt/VBoxLinuxAdditions.run --nox11 2>&1 > /root/vbox_addon_install.log
changed_when: false changed_when: false
failed_when: _cmd.rc not in [0, 2] failed_when: _cmd.rc not in [0, 2]
register: _cmd register: _cmd
loop:
- mount -o loop,ro {{ virtualbox_iso_location }} /mnt - name: Unmount ISO file
- /mnt/VBoxLinuxAdditions.run --nox11 ansible.posix.mount:
- umount /mnt path: /mnt
state: absent
- name: Remove packages - name: Remove packages
become: true become: true
@@ -4,6 +4,5 @@ virtualbox_packages:
- tar - tar
- build-essential - build-essential
virtualbox_services: [] virtualbox_services: []
virtualbox_from_iso: true virtualbox_from_iso: false
virtualbox_iso_location: /home/vagrant/VBoxGuestAdditions.iso
virtualbox_remove_packages: [] virtualbox_remove_packages: []