Ansible is an Infrastructure-as-Code tool that can automate almost any task on a Linux server. Learn how to use it manage your cloud computing resources like a pro. 

#linux #programming #100secondsofcode 

💵 Sign up for a Linode account at https://linode.com/fireship using the link below and get a free $100 60-day credit on a new Linode account

💬 Chat with Me on Discord

https://discord.gg/fireship

🔗 Resources

Ansible Docs https://www.ansible.com
Ansible Linode Tutorial https://www.linode.com/docs/guides/deploy-linodes-using-linode-ansible-collection/
Terraform in 100 Seconds https://youtu.be/tomUWcQ0P3k

🔥 Get More Content - Upgrade to PRO

Upgrade at https://fireship.io/pro
Use code YT25 for 25% off PRO access 

🎨 My Editor Settings

- Atom One Dark 
- vscode-icons
- Fira Code Font

🔖 Topics Covered

- What is Ansible?
- Ansible basics tutorial
- What is Ansible used for?
- How do I automate cloud servers?
- Best Linux automation tools
- Ansible vs Terraform
2024-02-04T05:09:56.214Z
nova-2
2-general-nova
2024-01-09.29447
30089e05-99d1-4376-b32e-c263170674af
304125de-dce2-428f-ba5b-ef81d35ade45
17f33db3c65bad3c31a0110d1bfaf9062aad6109c0486f81fccd47c2dfcc28c0
67875a7f-c9c4-48a0-aa55-5bdb8a91c34a
deprecated
Ansible, an open source automation tool that can describe your IT infrastructure with simple declarative code.
It was created by Michael DeHaan in 2012, then acquired by Red Hat a few years later, and today is one of the most popular configuration management tools.
Most importantly, it uses declarative, push based YAML code that allows DevOps teams to easily automate their Linux servers, increasing efficiency while reducing the likelihood of human error.
It works by making at least one machine a Troll node.
It then connects to multiple managed nodes and sends them an Ansible module over SSH, which can configure that machine's dependencies, Update network settings, provision databases, or really any job that you might need to do more than once.
Developers write playbooks that contain a series of jobs called Plays.
Each play is a set of instructions that can be executed on 1 or more target hosts.
It will execute each task in order against all machines in parallel.
In addition, a playbook is item potent, which means it won't actually make any changes unless it has to.
An excellent real world use case for Ansible, is to manage your Linux servers on a platform like Linode.
We start by provisioning a server running Ubuntu as the control node, then Hash Intuit from the terminal.
From there, we can install Ansible on this machine.
This machine needs permission to create and modify other servers, so we'll get an access token for the Linode API, and store it somewhere securely.
Now what's awesome about Ansible is that it has a massive ecosystem of prebuilt Playbooks that can be accessed on Ansible Galaxy.
Install the collection for Linode using the Ansible Galaxy command.
From there, it's It's a good practice to use Ansible Vault to store sensitive information, like a password, securely.
So it's not required to be directly in a YAML File, and we'll want to encrypt our personal access token here.
And now we're ready to write our first playbook.
Create a file in the development directory ending in dotyml, then create First Play by giving it a name, like create Linode instance.
Then the host property is a pattern that defines 1 or more machines that will run this play, or where they can be listed in a dedicated inventory file.
Next, we can define reusable variables or point to files that contain multiple variables.
And then we can create a task list that contains instructions that actually do something.
Here, we're using a fully qualified collection name of linode.cloud.instance, which is a special namespace that tells Linode to create a new server instance.
From there, we describe the configuration details like our API token, region, disk image, and so on.
And now all we have to do is run the Ansible playbook command to create a new server automatically, and that's how you automate infrastructure with code using Ansible.
Shout out to Linode, Cloud Computing from Akamai for sponsoring this awesome tool.
Thanks for watching, and I will see you in the next one.

Speaker 0: Ansible, an open source automation tool that can describe your IT infrastructure with simple declarative code. It was created by Michael DeHaan in 2012, then acquired by Red Hat a few years later, and today is one of the most popular configuration management tools. Most importantly, it uses declarative, push based YAML code that allows DevOps teams to easily automate their Linux servers, increasing efficiency while reducing the likelihood of human error. It works by making at least one machine a Troll node. It then connects to multiple managed nodes and sends them an Ansible module over SSH, which can configure that machine's dependencies, Update network settings, provision databases, or really any job that you might need to do more than once.

Developers write playbooks that contain a series of jobs called Plays. Each play is a set of instructions that can be executed on 1 or more target hosts. It will execute each task in order against all machines in parallel. In addition, a playbook is item potent, which means it won't actually make any changes unless it has to. An excellent real world use case for Ansible, is to manage your Linux servers on a platform like Linode.

We start by provisioning a server running Ubuntu as the control node, then Hash Intuit from the terminal. From there, we can install Ansible on this machine. This machine needs permission to create and modify other servers, so we'll get an access token for the Linode API, and store it somewhere securely. Now what's awesome about Ansible is that it has a massive ecosystem of prebuilt Playbooks that can be accessed on Ansible Galaxy. Install the collection for Linode using the Ansible Galaxy command.

From there, it's It's a good practice to use Ansible Vault to store sensitive information, like a password, securely. So it's not required to be directly in a YAML File, and we'll want to encrypt our personal access token here. And now we're ready to write our first playbook. Create a file in the development directory ending in dotyml, then create First Play by giving it a name, like create Linode instance. Then the host property is a pattern that defines 1 or more machines that will run this play, or where they can be listed in a dedicated inventory file.

Next, we can define reusable variables or point to files that contain multiple variables. And then we can create a task list that contains instructions that actually do something. Here, we're using a fully qualified collection name of linode.cloud.instance, which is a special namespace that tells Linode to create a new server instance. From there, we describe the configuration details like our API token, region, disk image, and so on. And now all we have to do is run the Ansible playbook command to create a new server automatically, and that's how you automate infrastructure with code using Ansible.

Shout out to Linode, Cloud Computing from Akamai for sponsoring this awesome tool. Thanks for watching, and I will see you in the next one.
Ansible, an open source automation tool that can describe your IT infrastructure with simple declarative code. It was created by Michael DeHaan in 2012, then acquired by Red Hat a few years later, and today is one of the most popular configuration management tools. Most importantly, it uses declarative, push based YAML code that allows DevOps teams to easily automate their Linux servers, increasing efficiency while reducing the likelihood of human error. It works by making at least one machine a Troll node. It then connects to multiple managed nodes and sends them an Ansible module over SSH, which can configure that machine's dependencies, Update network settings, provision databases, or really any job that you might need to do more than once. Developers write playbooks that contain a series of jobs called Plays. Each play is a set of instructions that can be executed on 1 or more target hosts. It will execute each task in order against all machines in parallel. In addition, a playbook is item potent, which means it won't actually make any changes unless it has to. An excellent real world use case for Ansible, is to manage your Linux servers on a platform like Linode.
games
software development
software
computer science
systems
networking
video gaming
infrastructure
computers
We start by provisioning a server running Ubuntu as the control node, then Hash Intuit from the terminal. From there, we can install Ansible on this machine. This machine needs permission to create and modify other servers, so we'll get an access token for the Linode API, and store it somewhere securely. Now what's awesome about Ansible is that it has a massive ecosystem of prebuilt Playbooks that can be accessed on Ansible Galaxy. Install the collection for Linode using the Ansible Galaxy command.
From there, it's It's a good practice to use Ansible Vault to store sensitive information, like a password, securely. So it's not required to be directly in a YAML File, and we'll want to encrypt our personal access token here. And now we're ready to write our first playbook. Create a file in the development directory ending in dotyml, then create First Play by giving it a name, like create Linode instance. Then the host property is a pattern that defines 1 or more machines that will run this play, or where they can be listed in a dedicated inventory file. Next, we can define reusable variables or point to files that contain multiple variables. And then we can create a task list that contains instructions that actually do something. Here, we're using a fully qualified collection name of linode.cloud.instance, which is a special namespace that tells Linode to create a new server instance.
software development
cryptocurrency
databases
games
From there, we describe the configuration details like our API token, region, disk image, and so on.
And now all we have to do is run the Ansible playbook command to create a new server automatically, and that's how you automate infrastructure with code using Ansible. Shout out to Linode, Cloud Computing from Akamai for sponsoring this awesome tool. Thanks for watching, and I will see you in the next one.
software
software development
infrastructure
networking
internet
Ansible, an open source automation tool that can describe your IT infrastructure with simple declarative code. It was created by Michael DeHaan in 2012, then acquired by Red Hat a few years later, and today is one of the most popular configuration management tools. Most importantly, it uses declarative, push based YAML code that allows DevOps teams to easily automate their Linux servers, increasing efficiency while reducing the likelihood of human error. It works by making at least one machine a Troll node. It then connects to multiple managed nodes and sends them an Ansible module over SSH, which can configure that machine's dependencies, Update network settings, provision databases, or really any job that you might need to do more than once. Developers write playbooks that contain a series of jobs called Plays. Each play is a set of instructions that can be executed on 1 or more target hosts. It will execute each task in order against all machines in parallel. In addition, a playbook is item potent, which means it won't actually make any changes unless it has to. An excellent real world use case for Ansible, is to manage your Linux servers on a platform like Linode. We start by provisioning a server running Ubuntu as the control node, then Hash Intuit from the terminal. From there, we can install Ansible on this machine. This machine needs permission to create and modify other servers, so we'll get an access token for the Linode API, and store it somewhere securely. Now what's awesome about Ansible is that it has a massive ecosystem of prebuilt Playbooks that can be accessed on Ansible Galaxy. Install the collection for Linode using the Ansible Galaxy command. From there, it's It's a good practice to use Ansible Vault to store sensitive information, like a password, securely. So it's not required to be directly in a YAML File, and we'll want to encrypt our personal access token here. And now we're ready to write our first playbook. Create a file in the development directory ending in dotyml, then create First Play by giving it a name, like create Linode instance. Then the host property is a pattern that defines 1 or more machines that will run this play, or where they can be listed in a dedicated inventory file. Next, we can define reusable variables or point to files that contain multiple variables. And then we can create a task list that contains instructions that actually do something. Here, we're using a fully qualified collection name of linode.cloud.instance, which is a special namespace that tells Linode to create a new server instance. From there, we describe the configuration details like our API token, region, disk image, and so on. And now all we have to do is run the Ansible playbook command to create a new server automatically, and that's how you automate infrastructure with code using Ansible. Shout out to Linode, Cloud Computing from Akamai for sponsoring this awesome tool. Thanks for watching, and I will see you in the next one.
Ansible,
ansible
an
an
open
open
source
source
automation
automation
tool
tool
that
that
can
can
describe
describe
your
your
IT
it
infrastructure
infrastructure
with
with
simple
simple
declarative
declarative
code.
code
It
it
was
was
created
created
by
by
Michael
michael
DeHaan
dehaan
in
in
2012,
2012
then
then
acquired
acquired
by
by
Red
red
Hat
hat
a
a
few
few
years
years
later,
later
and
and
today
today
is
is
one
one
of
of
the
the
most
most
popular
popular
configuration
configuration
management
management
tools.
tools
Most
most
importantly,
importantly
it
it
uses
uses
declarative,
declarative
push
push
based
based
YAML
yaml
code
code
that
that
allows
allows
DevOps
devops
teams
teams
to
to
easily
easily
automate
automate
their
their
Linux
linux
servers,
servers
increasing
increasing
efficiency
efficiency
while
while
reducing
reducing
the
the
likelihood
likelihood
of
of
human
human
error.
error
It
it
works
works
by
by
making
making
at
at
least
least
one
one
machine
machine
a
a
Troll
troll
node.
node
It
it
then
then
connects
connects
to
to
multiple
multiple
managed
managed
nodes
nodes
and
and
sends
sends
them
them
an
an
Ansible
ansible
module
module
over
over
SSH,
ssh
which
which
can
can
configure
configure
that
that
machine's
machine's
dependencies,
dependencies
Update
update
network
network
settings,
settings
provision
provision
databases,
databases
or
or
really
really
any
any
job
job
that
that
you
you
might
might
need
need
to
to
do
do
more
more
than
than
once.
once
Developers
developers
write
write
playbooks
playbooks
that
that
contain
contain
a
a
series
series
of
of
jobs
jobs
called
called
Plays.
plays
Each
each
play
play
is
is
a
a
set
set
of
of
instructions
instructions
that
that
can
can
be
be
executed
executed
on
on
1
1
or
or
more
more
target
target
hosts.
hosts
It
it
will
will
execute
execute
each
each
task
task
in
in
order
order
against
against
all
all
machines
machines
in
in
parallel.
parallel
In
in
addition,
addition
a
a
playbook
playbook
is
is
item
item
potent,
potent
which
which
means
means
it
it
won't
won't
actually
actually
make
make
any
any
changes
changes
unless
unless
it
it
has
has
to.
to
An
an
excellent
excellent
real
real
world
world
use
use
case
case
for
for
Ansible,
ansible
is
is
to
to
manage
manage
your
your
Linux
linux
servers
servers
on
on
a
a
platform
platform
like
like
Linode.
linode
We
we
start
start
by
by
provisioning
provisioning
a
a
server
server
running
running
Ubuntu
ubuntu
as
as
the
the
control
control
node,
node
then
then
Hash
hash
Intuit
intuit
from
from
the
the
terminal.
terminal
From
from
there,
there
we
we
can
can
install
install
Ansible
ansible
on
on
this
this
machine.
machine
This
this
machine
machine
needs
needs
permission
permission
to
to
create
create
and
and
modify
modify
other
other
servers,
servers
so
so
we'll
we'll
get
get
an
an
access
access
token
token
for
for
the
the
Linode
linode
API,
api
and
and
store
store
it
it
somewhere
somewhere
securely.
securely
Now
now
what's
what's
awesome
awesome
about
about
Ansible
ansible
is
is
that
that
it
it
has
has
a
a
massive
massive
ecosystem
ecosystem
of
of
prebuilt
prebuilt
Playbooks
playbooks
that
that
can
can
be
be
accessed
accessed
on
on
Ansible
ansible
Galaxy.
galaxy
Install
install
the
the
collection
collection
for
for
Linode
linode
using
using
the
the
Ansible
ansible
Galaxy
galaxy
command.
command
From
from
there,
there
it's
it's
It's
it's
a
a
good
good
practice
practice
to
to
use
use
Ansible
ansible
Vault
vault
to
to
store
store
sensitive
sensitive
information,
information
like
like
a
a
password,
password
securely.
securely
So
so
it's
it's
not
not
required
required
to
to
be
be
directly
directly
in
in
a
a
YAML
yaml
File,
file
and
and
we'll
we'll
want
want
to
to
encrypt
encrypt
our
our
personal
personal
access
access
token
token
here.
here
And
and
now
now
we're
we're
ready
ready
to
to
write
write
our
our
first
first
playbook.
playbook
Create
create
a
a
file
file
in
in
the
the
development
development
directory
directory
ending
ending
in
in
dotyml,
dotyml
then
then
create
create
First
first
Play
play
by
by
giving
giving
it
it
a
a
name,
name
like
like
create
create
Linode
linode
instance.
instance
Then
then
the
the
host
host
property
property
is
is
a
a
pattern
pattern
that
that
defines
defines
1
1
or
or
more
more
machines
machines
that
that
will
will
run
run
this
this
play,
play
or
or
where
where
they
they
can
can
be
be
listed
listed
in
in
a
a
dedicated
dedicated
inventory
inventory
file.
file
Next,
next
we
we
can
can
define
define
reusable
reusable
variables
variables
or
or
point
point
to
to
files
files
that
that
contain
contain
multiple
multiple
variables.
variables
And
and
then
then
we
we
can
can
create
create
a
a
task
task
list
list
that
that
contains
contains
instructions
instructions
that
that
actually
actually
do
do
something.
something
Here,
here
we're
we're
using
using
a
a
fully
fully
qualified
qualified
collection
collection
name
name
of
of
linode.cloud.instance,
linode.cloud.instance
which
which
is
is
a
a
special
special
namespace
namespace
that
that
tells
tells
Linode
linode
to
to
create
create
a
a
new
new
server
server
instance.
instance
From
from
there,
there
we
we
describe
describe
the
the
configuration
configuration
details
details
like
like
our
our
API
api
token,
token
region,
region
disk
disk
image,
image
and
and
so
so
on.
on
And
and
now
now
all
all
we
we
have
have
to
to
do
do
is
is
run
run
the
the
Ansible
ansible
playbook
playbook
command
command
to
to
create
create
a
a
new
new
server
server
automatically,
automatically
and
and
that's
that's
how
how
you
you
automate
automate
infrastructure
infrastructure
with
with
code
code
using
using
Ansible.
ansible
Shout
shout
out
out
to
to
Linode,
linode
Cloud
cloud
Computing
computing
from
from
Akamai
akamai
for
for
sponsoring
sponsoring
this
this
awesome
awesome
tool.
tool
Thanks
thanks
for
for
watching,
watching
and
and
I
i
will
will
see
see
you
you
in
in
the
the
next
next
one.
one
success
In this video, a representative explains the benefits of using ante, an automation tool for managing IT infrastructure. The tool uses declarative, push-based YAML code and requires at least one machine to be a Troll node. It also uses a playbook for specific tasks and is recommended for a use case involving Linux servers. The tool is also used for creating a new server and sponsoring a tool called Cloud computing from Akamai.
Ansible in 100 Seconds
Ansible, an open source automation tool that can describe your IT infrastructure with simple declarative code. It was created by Michael DeHaan in 2012, then acquired by Red Hat a few years later, and today is one of the most popular configuration management tools. Most importantly, it uses declarative, push based YAML code that allows DevOps teams to easily automate their Linux servers, increasing efficiency while reducing the likelihood of human error. It works by making at least one machine a Troll node. It then connects to multiple managed nodes and sends them an Ansible module over SSH, which can configure that machine's dependencies, Update network settings, provision databases, or really any job that you might need to do more than once. Developers write playbooks that contain a series of jobs called Plays. Each play is a set of instructions that can be executed on 1 or more target hosts. It will execute each task in order against all machines in parallel. In addition, a playbook is item potent, which means it won't actually make any changes unless it has to. An excellent real world use case for Ansible, is to manage your Linux servers on a platform like Linode. We start by provisioning a server running Ubuntu as the control node, then Hash Intuit from the terminal. From there, we can install Ansible on this machine. This machine needs permission to create and modify other servers, so we'll get an access token for the Linode API, and store it somewhere securely. Now what's awesome about Ansible is that it has a massive ecosystem of prebuilt Playbooks that can be accessed on Ansible Galaxy. Install the collection for Linode using the Ansible Galaxy command. From there, it's It's a good practice to use Ansible Vault to store sensitive information, like a password, securely. So it's not required to be directly in a YAML File, and we'll want to encrypt our personal access token here. And now we're ready to write our first playbook. Create a file in the development directory ending in dotyml, then create First Play by giving it a name, like create Linode instance. Then the host property is a pattern that defines 1 or more machines that will run this play, or where they can be listed in a dedicated inventory file. Next, we can define reusable variables or point to files that contain multiple variables. And then we can create a task list that contains instructions that actually do something. Here, we're using a fully qualified collection name of linode.cloud.instance, which is a special namespace that tells Linode to create a new server instance. From there, we describe the configuration details like our API token, region, disk image, and so on. And now all we have to do is run the Ansible playbook command to create a new server automatically, and that's how you automate infrastructure with code using Ansible. Shout out to Linode, Cloud Computing from Akamai for sponsoring this awesome tool. Thanks for watching, and I will see you in the next one.
In this video, a representative explains the benefits of using ante, an automation tool for managing IT infrastructure. The tool uses declarative, push-based YAML code and requires at least one machine to be a Troll node. It also uses a playbook for specific tasks and is recommended for a use case involving Linux servers. The tool is also used for creating a new server and sponsoring a tool called Cloud computing from Akamai.