VirtualBox and Ansible

If you are interested in learning Ansible and\or just creating an Ansible test environment, VirtualBox can help you.

Steps to spinning up a VirtualBox Ansible test environment.  So easy!!!!

  1. Download and install VirtualBox
  2. Download your preferred Linux flavor.  In my case, I decided to us Red Hat Enterprise Linux (RHEL) 7.  The following link will show you how to download and install a RHEL iso with VirtualBox.  Remember the Ansible “controller” is not supported on Windows yet.
  3. Since I used RHEL in step #2, I needed to perform the following command before proceeding with the Ansible install.  (Based on my experience)
    • Run the dhclient command to reconfigure the network interfaces
      • After this command, verify the contents of /etc/resolv.conf
    • Next, I needed to register and apply a subscription to my new test server.  The login\pw I used in step #2 will be used here when prompted.
      • subscription-manager register
      • subscription-manager attach –auto
  4. Net you will need to install Ansible on your new VM.  The following commands will prep your server and then install Ansible as needed.

Its really that easy!  I executed my commands via root, but if I were to have used another account, I may have needed to sudo the commands.

Another gotcha I an encountered was around proxy servers, so be aware that if your rpm\yum commands fail, you may need set your specific proxy server accordingly.

va