So friends, the best way I thought to begin this skill would be to begin first
talking
about the concept of networking within Linux.
Quite simply when you happen to be making networking changes via Linux, you can
actually
implement these changes in a number of different ways.
So if we can effectively configure networking in all these different ways on
Linux, how
should we actually manage this utilising Ansible?
Now you may recall on Linux we have this utility known as NetWork Manager, this WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Now you may recall on Linux we have this utility known as NetWork Manager, this
is basically
used to simplify the configuration of all the networking settings on your
device.
Now the way in which you can actually interact with network manager actually
varies.
Quite simply there are three different ways that we can interact with this
utility.
So the first way in which we can interact with NetWork Manager is using NMTUI.
This is the NetWork Manager text user interface.
So much this is going to give you this nice little text based interactive menu
that is
going to allow you to interact with the utility directly. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
going to allow you to interact with the utility directly.
Next we can also interact with NetWork Manager directly via the NOM graphical
user interface.
So that we just be using the graphical user interface as we can see right here.
So we go to Wire Connections, Wire Settings, click on the options and we can
see everything
we have right here.
Now as you may suspect, these first two options, the text user interface or the
graphical user
interface, well this is not the way we're going to interact with our device if
we happen
to be utilizing Ansible.
However, the third way in which we can interact with NetWork Manager is via NMC WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
However, the third way in which we can interact with NetWork Manager is via NMC
LI.
Very, very similar to NMTUI.
This time though we interact via the command line interface.
So say for example I wanted to see my connections, I could say NMCLI,
connection show and BAM
as we can see as per the output we have two different connections.
One for my ethernet interface here with the corresponding universal unique
identifier
as well as we have our software look back interface primarily used for testing WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
as well as we have our software look back interface primarily used for testing
connections.
All of these types of commands can effectively be invoked utilizing the Ansible
command module
which was seen before.
That is one particular way we can interact with our device.
Now if you recall from a previous scale, one thing we have to understand is
that when
we utilize this particular module, the playbook is not going to be idempotent
by nature.
Remember this very important term, if we happen to push a command utilizing
this particular
module and the command doesn't actually make a change on the device pretty much WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
module and the command doesn't actually make a change on the device pretty much
we push
the same configuration over and over and over again Ansible is not going to
have the intelligence
to know that the configuration already exists and it's going to seek to impose
that configuration
change over and over and over again redundantly.
So of course this isn't really ideal to be honest with you.
Now as we're going to learn we can actually utilize NMCLI in a much nicer way.
As opposed to just pushing these commands directly what we can do is we can
just utilize
the NMCLI module that is dedicated for that particular task. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
the NMCLI module that is dedicated for that particular task.
So really what we're talking about here is managing network via network manager
and
whilst there are three traditional methods to interact with the utility NNTUI
as well
as the actual graphical user interface, the only way we are interested in is to
interact
with network manager via NMCLI.
Now like I say this is just if we want to interact with network manager.
What we can also do though is we can make these modifications to our networking WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
What we can also do though is we can make these modifications to our networking
without
the use of network manager.
Now if you want to use Ansible to do this particular task there are two
different ways
we can do such a thing.
The first way is to actually modify the interface configuration files
themselves.
Now when you happen to make these changes these changes are going to be
persistent.
Meaning that if you happen to reboot the system the changes that you define
within
these configuration files are still going to remain.
Now the other way in which we can modify networking configurations without
using network
manager is also via the IP command. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
manager is also via the IP command.
The big distinction here though is that the changes we make here are not going
to persist
a reboot.
So once again this gives us a little bit of a choice here.
If we want to use the configuration files, well a good idea to handle this
would be to
actually template out these particular configurations.
So that could be things like using the ginger to templating language.
All we have to do is to specify which configuration fails we want to target and
then we can effectively
generate the configurations and push them into the correct location.
Or if we so wish we can perhaps just make a subtle modification to a particular WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Or if we so wish we can perhaps just make a subtle modification to a particular
configuration
file utilizing one of the many utilities such as the line and file option.
However if we just want to push out simple commands using the IP command, well
of course
once again we can use that same module we talked about just before.
That is the Ansible built in command module.
Again it's not going to be idempotent however.
So you know all those commands that we can just run such as IP adder, IP route,
that
type of thing.
As well as all the available modifications we can make with this particular WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
As well as all the available modifications we can make with this particular
commands.
We can just push out those commands directly if we so wish straight from our
Ansible Playbooks.
Now just to make a point on the RETA Enterprise Linux distribution, if you want
to be making
the configuration file changes, the location you will be looking in will be in
the Etsy
directory and then in a directory called sysconfig and then within that we're
going to have a
directory called network scripts.
Inside of here what you can do is create a new file for every single interface
and within
that particular file that is where the configurations would be. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
that particular file that is where the configurations would be.
So say for example you happen to have an interface called ens150 for example.
The actual format you would do would be to create the file called ifcfg, hyphen
and then
the name of the corresponding interface so ens150 for example.
And of course I would have to use a sub-user privileges, that type of thing.
And then inside this particular configuration file you would just have some
basic configurations
specifying the name of the device and some particular options such as you know
the IP
address like you know 10, 10, 10, 1, that type of thing. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
address like you know 10, 10, 10, 1, that type of thing.
This is the type of configurations that we would template out or perhaps even
modify
via the line and file or block and file options.
So as you can see there are a lot of different ways to handle networking on
Linux and as
such we have lots of different ways to handle this particular problem utilizing
Ansible.
However whilst it is important to understand all of these different ways we can
handle
this particular problem one way I'm really going to recommend to you is to
utilize these
dedicated Ansible modules. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
dedicated Ansible modules.
So the very first module that we're going to be looking at is the nncli module
and well
that's what we're talking about in the very next video.
[BLANK_AUDIO]