So friends in the previous video we just ran our playbook which was going to
effectively
make some configuration changes to our networking on both of our target devices
. Now when we ran
our verification check it didn't quite seem like the actual configurations had
actually changed.
Now let me just quickly verify that the configurations were indeed pushed to
the devices and we can do
that by going to one of the devices right here. Again whilst the IP adder does
not actually show
any IP address configuration change if I happen to say nmcli con show we can WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
any IP address configuration change if I happen to say nmcli con show we can
see both of the
connections let me target the ens 160 right here. Now if I just space bar down
and we go to this
option right here ipv4 addresses we can see right here look at the
corresponding address this is
actually the IP address that we pushed out to the device similar left we slide
on over to the
blue box and I just say nmcli con show and do ens 160 and to enter hit spacebar
similarly down here
the configuration is also present so the big reveal is that quite simply we WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
the configuration is also present so the big reveal is that quite simply we
have to activate
the connection so what I can also do now is if I just say nmcli con up and then
say ens 160 that's
effective going to refresh the configs now when I do this we can see it has
been successfully
activated and if I now run an IP adder I'll look at this right here the actual
configurations have
now been applied now of course if we happen to be managing many many devices it
doesn't really WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
doesn't really
make much sense if we happen to be running an automation system to be logging
into each device
one by one by one and manually typing in that command as such what we could do
is simply modify
or playbook to perform that task so let's maybe go in and let's change the IP
address to let's
maybe say I don't know let's go with 192 168 55.1 slash 24 okay now at this
point right here we have
a role and like I say that's going to push out that particular change once that WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
is done we want
to run a particular task now what is that task actually going to be well we'll
give it a name
and we'll just say reload the connection now what are we going to use here well
if I just want to
run a command I can say Ansible built-in command and then I can specify the
command that I want
to run which in my case right here is going to be in NMCLI corn up ENS and that
should be optimal
IP apologizing with that ENS 160 and if I just save this watch what happens now
let's clear the WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
let's clear the
screen and obviously Ansible Playbook Play 2.YML answer insert give it a moment
it's going to run
through the configurations we make the changes to the particular device now
what is actually
happening right here it's saying reload the connection so quite simply what is
happening is
that the connection is now hanging now what does this actually mean well it
means that the change
was indeed successful now think of the implication of the change that we happen
to just meet there
so right now what we'll do is press ctrl C to interrupt the execution and like WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
so right now what we'll do is press ctrl C to interrupt the execution and like
I say if I go to my
devices if I clear the screen I just say IP adder look at this right here we
actually have the IP
address now configured on the device it was directly applied straight away now
think about it if we
consult our inventory we have blue box and yellow box now what are they
actually resolving to in
terms of IP addressing well within our it's a host file we can see we have
statically mapped the
blue box to be this particular IP address and the yellow box to be this
particular IP address now WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
particular IP address now
what we did by virtue of pushing out those changes and automatically activating
them immediately
we changed this IP address and as soon as that changed the connection between
answer ball the
control nodes with the blue box device and the yellow box device well those
connections are going
to be severed and terminated because the connection has been established over
this particular IP address
for the yellow box and this particular IP address for the blue box and now
those IP addresses have
been changed on both of those devices so the connection just effectively is WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
been changed on both of those devices so the connection just effectively is
stripped this is
really more of a real world problem as opposed to a labbing issue because it's
very very easy to
fix in a lab but of course we learn these skills to be able to perform in the
real world so it is
important to understand that when we do make interface modifications particular
via automation
systems understand that if we happen to change the IP address and activate that
change immediately
whilst the automating system is running then we can potentially lock ourselves
out of the device
because right now if you try to ping the blue box we have no connection and WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
because right now if you try to ping the blue box we have no connection and
similarly if i try to
ping the yellow box also no connection so we can't even log in remotely so just
be aware of the
consequences of potentially wiping those primary addresses on those interfaces
what is often the
case is in the world of automation we may actually have a dedicated interface
on each of the devices
simply used to manage the device quite simply this would be known as an out-of-
band management system
so effectively these particular interfaces would be dedicated just for WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
so effectively these particular interfaces would be dedicated just for
connectivity between the
automation system and the device to be managed you wouldn't want to be changing
those IP addresses
they would just be there for that particular purpose so if i run my nnclicon
show command and
i great for ipv4 addresses we can see the actual address which is configured
here so what i will
do here is i will say nnclicon mod ens 1/60 ipv4.method auto that should
configure the device to run
DHCP which will get a dynamic address from the server and i now say nnmsli con WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
DHCP which will get a dynamic address from the server and i now say nnmsli con
down ens 1/60
and bring it back up again we should now actually be able to get the ip address
automatically and
look at this right here we're back to the original address similarly let's do
the same thing on the
other device we do nnmsli con mods ens 1/60 ipv4.methods open that should be at
1/60 not 1/50 apologies about
the mistype then we'll bring the interface down and bounce it back up if i now
do an ip adder
ingrate for 1.92 as we can see we have the ip address back once again so that WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
ingrate for 1.92 as we can see we have the ip address back once again so that
is how we can
make sure that the interface configurations actually do apply just be aware of
that little trap if
we do make interface modifications just be aware if that is the primary way you
're interacting with
your device via automation you do run the risk of locking yourself out just a
little real world
tip for you to take home.