Getting started

This pages covers getting started technically, to get more information about the technologies used, see Knowledge sharing.

This guide (and the rest of the documentation) is written with Fedora as the developers OS in mind. If you have a different OS, you might need to adapt a few commands.

Table of Contents

  1. Installing Ansible
  2. Setting up a development environment

Installing Ansible

  1. Install uv
  2. Install Ansible as uv tool:
     uv tool install ansible-dev-tools --with-executables-from ansible-builder,ansible-core,ansible-creator,ansible-dev-environment,ansible-lint,ansible-sign,molecule,ansible-navigator
    
  3. Upgrading is simply:
     uv tool upgrade ansible-dev-tools
    

You can also install Ansible in your preferred way. See the Ansible installation guide for other options.

Setting up a development environment

We want to set-up a VM to develop and test our Ansible code against. For that we will use libvirt and (optionally) virt-manager as a GUI. Please follow the Virtualization – Getting Started guide from the Fedora docs to install the required packages.

sudo dnf install @virtualization genisoimage wget
sudo systemctl enable libvirtd
sudo systemctl start libvirtd

Now you can create a new development VM by simply running the setup-vm.sh script from inside the iso directory:

cd iso/
./setup-vm.sh

It will

  1. download an Ubuntu Server ISO.
  2. create a seed ISO containing the user-data and meta-data cloud-init configuration files (see Ubuntu Intallation Documentation - Autoinstall quick start).
  3. create a VM with the name bertram-test and start it.

By default the script will create the VM with 4 vCPUs, 8 GB RAM and a 30 GB disk. You can adopt these values before you run the script. You can re-run the script at any point. It will ask you, if you want to delete any existing VM.

After the VMs creation you will need to open the graphical console either via the virt-manager GUI or with

virt-manager -c qemu:///system --show-domain-console bertram-test

You will be asked for confirmation about using autoinstall. Enter yes and Ubuntu will be installed according to the cloud-init configuration files.

Once the installation is finished, the VM will either reboot or shutdown. After booting it again you should be able to log in as the user bertram with the password bertram.