Ansible Hello World on Windows 10 Automation — let’s sail together.
IAC : Infrastructure as a code — Ansible is an open-source software provisioning, configuration management and application-deployment tool enabling infrastructure as code.
Ansible uses playbook to describe automation jobs and playbook uses very simple language i.e. YAML
Before you proceed,
I highly recommend the below tutorial from “TechWorld with Nana”
What is Ansible and Yaml Tutorial
Let’s begin our journey with 8 simple steps on running our first Ansible “Hello World” playbook on windows 10
Step 1: Go to Windows features, select the “Windows Subsystem for Linux” to activate it.
Step 2: Go to the Microsoft app store and Search for Linux. I selected “Ubuntu 20.04”
Step 3: Once Ubuntu is installed you can select Ubuntu which will take you to the bash shell. Set your username/password.
Once your Operating system is ready, let’s begin the fun with Ansible
Step 4: Ensure system is up to date
and
Install required software-properties-common
sudo apt-get update
sudo apt-get install software-properties-common
Step 5:
Add the official ansible Linux repository.
Update again post repository addition
Install Ansible.
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible
Step 6: Confirm Ansible is Installed
Let’s continue……to play around with Ansible now..more 5 steps to go….
Step 7: Let’s build our first ansiblehelloworld playbook.
nano ansiblehelloworld.yml
---
- name: Hello World!
hosts: localhosttasks:- name: Hello World!
debug:
msg: Hello World, Welcome to Ansible!!
ctrl+x then y to save it in current working directory
Step 8: To test, run your first ansible playbook using below command
ansible-playbook ansiblehelloworld.yml
Will continue this journey, by adding more Ansible use cases…..keep sailing…..!!