https://github.com/darkwizard242/ansible-role-virtualbox
Ansible role for VirtualBox. Available on Ansible Galaxy.
https://github.com/darkwizard242/ansible-role-virtualbox
ansible ansible-galaxy ansible-role system virtualbox virtualization
Last synced: 5 months ago
JSON representation
Ansible role for VirtualBox. Available on Ansible Galaxy.
- Host: GitHub
- URL: https://github.com/darkwizard242/ansible-role-virtualbox
- Owner: darkwizard242
- License: mit
- Created: 2020-05-02T18:48:26.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-02T21:44:09.000Z (almost 2 years ago)
- Last Synced: 2025-02-27T05:23:54.423Z (over 1 year ago)
- Topics: ansible, ansible-galaxy, ansible-role, system, virtualbox, virtualization
- Language: Python
- Homepage: https://galaxy.ansible.com/darkwizard242/virtualbox
- Size: 28.3 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/darkwizard242/ansible-role-virtualbox/actions?query=workflow%3Abuild-and-test) [](https://github.com/darkwizard242/ansible-role-virtualbox/actions?query=workflow%3Arelease)  [](https://sonarcloud.io/dashboard?id=ansible-role-virtualbox) [](https://sonarcloud.io/dashboard?id=ansible-role-virtualbox) [](https://sonarcloud.io/dashboard?id=ansible-role-virtualbox)  
# Ansible Role: virtualbox
Role to install (_by default_) [virtualbox-6.1](https://www.virtualbox.org/) package for Debian based systems or uninstall (_if passed as var_).
## Requirements
None.
## Role Variables
Available variables are listed below (located in `defaults/main.yml`):
### Variables list:
```yaml
virtualbox_version: 7.0
virtualbox_app_name: virtualbox
virtualbox_desired_state: present
virtualbox_gpg_key: https://www.virtualbox.org/download/oracle_vbox_2016.asc
virtualbox_repo_debian: "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian {{ ansible_lsb['codename'] }} contrib"
virtualbox_repo_debian_filename: {{ virtualbox_app_name }}
```
### Variables table:
Variable | Description
------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------
virtualbox_version | Version of virtualbox to append to the virtualbox_app variable during the installation task.
virtualbox_app | Defines the app to install i.e. **virtualbox**
virtualbox_desired_state | Defined to dynamically set whether to install (i.e. either `present` or `latest`) or uninstall (i.e. `absent`) the package. Defaults to `present`
virtualbox_gpg_key | GPG key for Virtualbox
virtualbox_repo_desired_state | State for repo to download Virtualbox from. Can either be 'present' or 'absent'.
virtualbox_repo_debian | Virtualbox's repo link for Debian based systems.
virtualbox_repo_debian_filename | Name of file to save for virtualbox's repo in `/etc/apt/sources.list.d/`
## Dependencies
None
## Example Playbook
For default behaviour of role (i.e. installation of **virtualbox-6.1** package) in ansible playbooks.
```yaml
- hosts: servers
roles:
- darkwizard242.virtualbox
```
For customizing behavior of role (i.e. installation of latest **virtualbox-6.1** package) in ansible playbooks.
```yaml
- hosts: servers
roles:
- darkwizard242.virtualbox
vars:
virtualbox_desired_state: latest
```
For customizing behavior of role (i.e. un-installation of **virtualbox-6.1** package) in ansible playbooks.
```yaml
- hosts: servers
roles:
- darkwizard242.virtualbox
vars:
virtualbox_desired_state: absent
```
## License
[MIT](https://github.com/darkwizard242/ansible-role-virtualbox/blob/master/LICENSE)
## Author Information
This role was created by [Ali Muhammad](https://www.alimuhammad.dev/).