Recently, I decided to take on a project to write an Ansible role/playbook combo for quick deployment of networking services required for VMware Tanzu. Today, I'm delighted to announce it's first (working!) version 1.0 - https://gitlab.com/sshguru/aio-appliance
What is it?
The AIO Appliance is a Linux VM with two NICs which you can configure with my Ansible code. Once configured, this system can be used to provide your lab with the following:
- routing between management and workload networks;
- DNS for all clients;
- DHCP for all clients (incl. Tanzu worklaods);
- NTP for all clients (incl. vCenter, ESXi etc.);
The VM used for deploying the appliance, must meet the following requirements:
- DNF/YUM-based distribution (CentOS, Fedora, RHEL*);
- 2x virtual NICs connected to two different portgroups connected to two different VLANs (or separated on layer 2; i.e. connected to two separate physical switches);
- SSH enabled (default on CentOS and RHEL);
- Python installed (default on most YUM/DNF distros);
*RHEL requires a developer or enterprise license
Great, how can I use it?!
Before getting started, make sure you understand the basics of Ansible. One of the ways to do that, is to read my blog series: Ansible for Dummies or watch my recent session Get Stuff Done Quicker With Ansible.
Once you know how to use Ansible, head over to my GitLab repo and clone it.
1) Deploy a Linux VM with a distro such as Fedora Server, CentOS or RHEL;
2) Configure the VM with two NICs, one of which has to be connected to a network reahable by your client machine over port 22;
3) Configure an IP address on the management NIC (this can be done during OS installation);
4) Generate (if you haven't already) an SSH key on your client machine and copy it onto the newly installed OS (172.21.0.254 in this example);
email@example.com # ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa Your public key has been saved in /root/.ssh/id_rsa.pub The key fingerprint is: SHA256:Y7mlbBchkNb8e9rz2kgUtqkLZo6fQdALCT0lTJWY2RY root@LT-PWILK The key's randomart image is: +---[RSA 3072]----+ | .++@Eo | | .X=* | | .+oo.. o | | o +.o + | | S o.+ | | + =.+. | | X o+. | | * =.ooo | | ..+ . o+o | +----[SHA256]-----+ firstname.lastname@example.org # ssh-copy-id email@example.com
5) Clone the AIO-Appliance repo to the working directory (make sure you've got git installed!):
firstname.lastname@example.org # git clone https://gitlab.com/sshguru/aio-appliance.git
6) Edit the following files and configure the variables, such as IPs, networks etc., to your needs:
- all DNS zone files in: aio-appliance/roles/aio-dns/templates
7) Finally, run the main playbook:
email@example.com # ansible-playbook aio-appliance.yml