Setup & Provision Fedora Server using Ansible
This tutorial walks you through how to setup & provision a Fedora Server using Vagrant and Ansible. Ansible will be used to automatically install and configure a Vagrant box (virtual machine) for us.
Writing our Vagrantfile
Writing our Playbook
Playbooks is what Ansible uses for configuration management.
The yaml code below is a simple playbook that installs a Fedora Server, then installs a python package in order to disable SELinux.
This .yml is specficially runs the Fedora Server in headless mode, which is handy for testing purposes.
So when we open the newly created Fedora Vagrant box we can see it’s ran without a GUI interface.
Configuring Fedora to become a workstation
Now that our headless Fedora Server is working correctly, we can rewrite our .yml file to enable a graphical interface, as well as install a few packages.
After using vagrant provision, we can reboot our vm, and be greeted with a graphical interface.
Enabling the Docker daemon
Next, we’re going to add additional plays to our Playbook but installing the Docker daemon onto our Fedora server.
Voila, we can now see any list of docker containers.
This is a simple walk-through on how to use Ansible to spin up a Vagrant box. We wrote a basic playbook that doesn’t do all that much other than enabling services, and installing a bunch of packages.
Ansible Official Documentation
Vagrant Official Documentation