Creating a playbook to deploy a new VM with kickstart
Creating playbooks for Ansible is a relatively easy task as most considerations are handled by the modules. All modules are made as "idempotently" as possible, meaning that a module first checks what it is supposed to do with what has been done on the system and only then applies the changes if they are different.
Getting ready
We don't need any additional facts for this recipe.
For this to work, we need to have a web server and a location to store the kickstart
files, which will be served by the web server.
For the sake of convenience, our web server is called web.domain.tld
, the location on this web server is /var/www/html/kickstart
, and this directory can be accessed through http://web.domain.tld/kickstart
.
We also need a KVM host (refer to Chapter 1, Working with KVM Guests, on how to set up a KVM server). In this case, we'll call our KVM server kvm.domain.tld
.
How to do it…
Let's create the playbook that will provision new systems via the...