6 | Ansible Hello World

preview_player
Показать описание
Create and run a basic Playbook with Ansible
Install ansible
Create a hello world playbook
Run playbook on local system

Step 1 - Install ansible on your system and check check ansible is installed - ansible --version
Ansible is generally installed on Linux systems

---------------------------------------
Steps to install Ansible on a Linux VM created with Vagrant

Step 1 - Install VirtualBox and Vagrant on your local machine.
Step 2 - Open a terminal and navigate to the directory where you want to set up your Ansible project.
Step 3 - Create a new directory for your Ansible controller VM by running the command mkdir ansible-controller
Step 4 - Navigate to the directory and create a new file called Vagrantfile by running the command vagrant init centos/7
Step 5 - Edit the Vagrantfile and add the lines to the end of the file to provision Ansible on the VM:

Vagrantfile for creating VM for Ansible Controller

end
sudo yum install epel-release -y
sudo yum install ansible -y
SHELL
end

Step 6 - Save & check its a valid vagrantfile vagrant validate Then run command vagrant up to start the VM
Step 7 - Once the VM is up and running, connect to it using SSH by running the command vagrant ssh
Check ansible is installed - ansible --version
---------------------------------------

Step 2 - Create a new directory mkdir ansible-project

---
- name: Basic playbook
hosts: localhost
tasks:
- name: Print a message
debug:
msg: "Hello, World!"

Master Ansible basics with step-by-step Hello World playbook
Learn how to create your first Ansible playbook with this Hello World tutorial

▬▬▬▬▬▬▬

Every Like & Subscription gives me great motivation to keep working for you
You can support my mission for education by sharing this knowledge and helping as many people as you can

If my work has helped you, consider helping any animal near you, in any way you can

Never Stop Learning
Raghav Pal


Рекомендации по теме
Комментарии
Автор

Thanks for making and sharing this video Raghav. It’s very good and appreciated.

billvvoods
Автор

Very nice series on Ansible, good job

Cherry_
Автор

Thanks Raghav for the amazing ansible videos. It is good for beginners :)

ruhi
Автор

Thank you Raghav for the series and please take a ubuntu os instance in any cloud and make one video with one playbook example.
Thank you

sangativamsikrishna
Автор

Great work bhaiya this really helps!!!!

loginlogin
Автор

This videos is almost similar to the 3rd video of this playlist >> 3 | Ansible Hands-On Demo Project - 55:52 minutes

Anyways Thank You Raghav Bhai

yrnlxlr
Автор

Raghav your explanation for a product from scratch to Beginners are very Good for Ansible and as well Github Actions Videos which i have refered. Is there course [videos]of your's on Ansible Web based version with API calls to execute the playbook where Input of Host will varies from post provision perspective, considering the hostname will be passed by some inventory based [Asset Management] .i.e SNOW when there is request and a call to ansible will be triggered for post configure of Windows / Linux VM. Obvios the module explanation with few example. Once again thanks for such videos presented by you which are sweet and simple to start from scratch.

sanjayjadhav
Автор

Excellent presentation again! Could you cover Ansible to a Windows client? Also, I would love to see how to integrate Github, Jenkins, and Ansible as one Jenkins job.
Thanks again for all your advice!

alea
Автор

Very good and informative video Raghav. Your content is too good.

please modify the commands in vagrant file provided in the description:
the change would be to include << before -SHELL
config.vm.provision "shell", inline: <<-SHELL

vipinsachan