cognifloyd.vm-tools
Ansible Role: Install VM Tools for RHEL/CentOS on VirtualBox/VMWare
This role installs VM tools on a RHEL/CentOS guest (minimal or full install) in VirtualBox or VMWare.
This role is based on the geerlingguy.packer-rhel version 1.2.2 (e392ebc).
Requirements
!!! warning "This information may be outdated!"
Before using this role with Packer, you need to ensure that Ansible is installed using a shell provisioner. You should also complete initial VM setup (like adding a vagrant user to the right group and the sudoers file), typically by using a Kickstart installation file (e.g., ks.cfg
) with Packer. An example of provisioners in your Packer .json template could be:
"provisioners": [
{
"type": "ansible",
"playbook_file": "ansible/main.yml",
"role_paths": [
"/home/cognifloyd/.galaxy/roles/cognifloyd.vm-tools",
]
}
],
The files must include at least:
ansible/main.yml:
---
- hosts: all
become: true
gather_facts: true
roles:
- cognifloyd.vm-tools
You may also want to add another shell provisioner for cleanup, like wiping free space with dd
, but this is optional (it only saves a bit of space in the Packer-produced .box file).
If you want to include more roles, remember to add them to the role_paths
array in the .json template, and then list them in main.yml
as usual. The Ansible setup will run locally within the Linux environment, so all necessary files should be transferred to the VM; this setup is specified in the .json template. Learn more: Ansible Local Provisioner.
Role Variables
None.
Dependencies
None.
Example Playbook
- hosts: all
roles:
- { role: cognifloyd.vm-tools }
License
MIT / BSD
Author Information
This role is based on the geerlingguy.packer-rhel role created in 2014 by Jeff Geerling, author of Ansible for DevOps.
VirtualBox/VMWare guest tools for RedHat/CentOS. (based on geerlingguy.packer-rhel)
ansible-galaxy install cognifloyd.vm-tools