Project case study
Configuration Automation Lab
Using automation concepts to make repeatable systems tasks more reliable.
Goal
Reduce repetitive manual configuration steps.
Approach
-
In Linode, StackScripts allow you to deploy preconfigured VMs, run custom script during the initial boot of a new compute instance, helping to automate system configurations, such as installing software, configuring settings or adding users.

-
Create three Linode instance.

-
Specify the inventory calls to target host in file named hosts and ping to the ansible VM instances. Ansible_facts gathers information about your machines. VM was ping-able.

-
Run linux command on both VMs ie. run os-release to check the os information of both vms.

-
Ansible Playbook is comprised of Ansible plays/roles/tasks (and as many as you like). It will execute each role defined in the playbook in yaml. Use roles to split a playbook into meaningful parts, and the way you do it is by choice. It may be a small tweak to the system or deploying a large complicated application. Create Ansible playbook aplay.yml that makes sure nano is there.

-
Run the ansible playbook aplay.yml.

-
Initializing Terraform in AWS

-
Terraform plan: plans all the tasks it will complete, so VM instance will be created.

-
Terraform apply: validates and actually applies the tasks to create the VM instance and resource from the main.tf file.
-
Terraform show: to view all the components, networking, resources, etc which matches what ec2 dashboard you see in aws > exact same instance is running

Lessons learned
I learned that Ansible manages unix-like OS and Windows. It’s agentless, minimal, consistent and secure. It’s idempotent, which means playbooks can run multiple times and push changes when changes are there, as well as repeat the same playbook.
In Terraform, you can control and secure your environment, spin it and deploy it from your terminal/CLI. A typical terraform workflow follows: init, plan, apply, (show) and destroy.
I got familiar with Ansible/Terraform, using the AWS CLI to access the containers, and setting them up in my Linode account.