6 | Ansible Hello World

  Рет қаралды 7,924

Automation Step by Step

Automation Step by Step

Күн бұрын

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
AWS Linux VM - • Create Free Linux on A...
Vagrant Linux VM - • Vagrant Beginner Tutorial
---------------------------------------
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
Vagrant.configure("2") do |config|
config.vm.define "ansible-controller" do |controller|
controller.vm.hostname = "controller"
end
config.vm.box = "centos/7"
config.vm.provision "shell", inline: -SHELL
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
Step 3 - Create a new file called playbook1.yml. This file will contain the tasks you want to perform on your machine
Step 4 - Add the following data in the playbook1.yml file
---
name: Basic playbook
hosts: localhost
tasks:
name: Print a message
debug:
msg: "Hello, World!"
Step 5 - Run the playbook ansible-playbook playbook1.yml
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
AutomationStep...
-

Пікірлер: 26
@btrees
@btrees Жыл бұрын
Thanks for making and sharing this video Raghav. It’s very good and appreciated.
@RaghavPal
@RaghavPal Жыл бұрын
Glad you liked it Bill
@ruhi203
@ruhi203 Жыл бұрын
Thanks Raghav for the amazing ansible videos. It is good for beginners :)
@RaghavPal
@RaghavPal Жыл бұрын
Glad you like them Ruhi
@nitishsharma-og2fy
@nitishsharma-og2fy 2 ай бұрын
Thanks Raghav for the very informative series.. !!! You said in the sessions that we will also cover complex example in the later sessions.. so are there any other video contents also available which will cover advance examples?
@RaghavPal
@RaghavPal 2 ай бұрын
Yes, definitely Nitish.. i created this series for beginners to get started. Will plan to add more lectures
@nitishsharma-og2fy
@nitishsharma-og2fy 2 ай бұрын
@RaghavPal , Thanks Raghav !! Any videos on groovy scripting?
@RaghavPal
@RaghavPal 2 ай бұрын
Yes can find Groovy playlist here - automationstepbystep.com/
@Cherry_105
@Cherry_105 10 ай бұрын
Very nice series on Ansible, good job
@RaghavPal
@RaghavPal 10 ай бұрын
Glad you like them
@sangativamsikrishna1691
@sangativamsikrishna1691 Жыл бұрын
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
@RaghavPal
@RaghavPal Жыл бұрын
Hi Sangati, sure I will do it
@dixit_404
@dixit_404 3 ай бұрын
are you creating ansible folder on the virtual machine which you are running via virtual box?
@RaghavPal
@RaghavPal 3 ай бұрын
Dixit I may not recall, let me know the timestamp in the video related to this
@shrikantAmbekar-q2g
@shrikantAmbekar-q2g 7 ай бұрын
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
@RaghavPal
@RaghavPal 7 ай бұрын
I will check on this Shrikant.. may be i may have done this for continuity of the topic.. do not remember exactly now
@loginlogin4307
@loginlogin4307 Жыл бұрын
Great work bhaiya this really helps!!!!
@RaghavPal
@RaghavPal Жыл бұрын
Glad to hear that
@alea9140
@alea9140 11 ай бұрын
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!
@RaghavPal
@RaghavPal 11 ай бұрын
Sure thing Alea
@sanjayjadhav5529
@sanjayjadhav5529 Жыл бұрын
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.
@RaghavPal
@RaghavPal Жыл бұрын
Sanjay Thanks for your kind words Have not yet created lectures on the web version of Ansible You can check all available lectures here - automationstepbystep.com/
@Irsathk
@Irsathk 4 ай бұрын
Hi bro I am followed this method but my virtual machine not running
@RaghavPal
@RaghavPal 4 ай бұрын
Israth will need more details and steps you followed with logs
@vipinsachan111
@vipinsachan111 11 ай бұрын
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
@RaghavPal
@RaghavPal 11 ай бұрын
Sure Vipin.. thanks
3 | Ansible Hands-On Demo Project | Step by Step for Beginners
55:52
Automation Step by Step
Рет қаралды 54 М.
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
How the Best Hackers Learn Their Craft
42:46
RSA Conference
Рет қаралды 2,6 МЛН
Automate EVERYTHING with Ansible! (Ansible for Beginners)
18:31
Techno Tim
Рет қаралды 254 М.
Getting started with Ansible 13 - Adding Users & Bootstrapping
24:35
Learn Linux TV
Рет қаралды 50 М.
2 | Getting started with Vagrant Setup for beginners
34:08
Automation Step by Step
Рет қаралды 35 М.
x86 Assembly: Hello World!
14:33
John Hammond
Рет қаралды 1,4 МЛН
you need to learn Ansible RIGHT NOW!! (Linux Automation)
21:21
NetworkChuck
Рет қаралды 914 М.
What is Ansible?
11:06
IBM Technology
Рет қаралды 192 М.
SSH Connections With Ansible - How To Create & Share SSH Keys
23:51
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН