Files
vms/ansible/roles/virtualbox/tasks/main.yml
T
Greg HellingsandGitHub dea5487a3c Add virtualbox-iso target
Lots of other, small quality of life improvements to build process
Output of build serial console to artifacts upon failure
Reducing verbosity of Packer, now that serial output is captured
Fixed sizing problems with the boot partitions of Ubuntu versions
Use of Mac builders for Virtualbox targets
Updating Ubuntu builders to 22.04, as well
2022-06-08 01:39:37 -05:00

46 lines
1.3 KiB
YAML

- name: Load version information
ansible.builtin.include_vars: "{{ item }}"
loop:
- "{{ role_path }}/vars/{{ ansible_facts['os_family'] }}.yml"
- "{{ role_path }}/vars/{{ ansible_facts['distribution'] }}.yml"
- "{{ role_path }}/vars/{{ ansible_facts['distribution'] }}_{{ ansible_facts['distribution_major_version'] }}.yml"
- "{{ role_path }}/vars/{{ ansible_facts['distribution'] }}_{{ ansible_facts['distribution_version'] }}.yml"
when: item is file
- name: Install build deps for virtualbox addons
become: true
ansible.builtin.package:
name: "{{ virtualbox_packages }}"
state: present
update_cache: true
register: _pkg_install
retries: 3
until: _pkg_install is success
- name: Start services
become: true
ansible.builtin.service:
name: "{{ item }}"
state: started
enabled: true
loop: "{{ virtualbox_services }}"
- when: virtualbox_from_iso
block:
- name: Mount iso file
become: true
ansible.builtin.command: "{{ item }}"
changed_when: false
failed_when: _cmd.rc not in [0, 2]
register: _cmd
loop:
- mount -o loop,ro {{ virtualbox_iso_location }} /mnt
- /mnt/VBoxLinuxAdditions.run --nox11
- umount /mnt
- name: Remove packages
become: true
ansible.builtin.package:
name: "{{ virtualbox_remove_packages | default([]) }}"
state: absent