So friends in the previous video we learned how we could create our own Ansible
roles.
In this particular video we're going to learn how we can consume the roles
created by others.
So with that said let's just get to it. So all I've done is search for Ansible
Galaxy here and
if I click on this link this here is effectively the marketplace that I was
telling you about
whereby we can easily access other roles created by other Ansible community
members.
So if I just go down to roles right here and click on this as we can see here
we have a whole WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
we have a whole
bunch of other roles we can see when it was last updated this one here is going
to install
Grafana this can be used to graph metrics that type of thing but if you want to
search for a
particular function maybe you want to get some type of Rediserver or EngineX
whatever it may be
you can just search for a particular keyboard and have Ansible Galaxy go and
find that for you.
So if I just search say for example for EngineX check this out we have all of
these roles that
perform this particular action whether it's going to install it in Docker
whether it's just going
to install a regular EngineX website for that type of thing and as we can see WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
to install a regular EngineX website for that type of thing and as we can see
here we have a
ton of pages available to us six to eight pages just for EngineX so what I will
do is I will
change the download count and this here is the one that I'm going to download
as we can see here
10 million downloads this is a very stable and popular role so if I just click
on the role right
here pretty much we can click on the documentation explains everything about
what the role is going
to do and if we just want to install it well we just simply copy this
particular command
okay so let's copy this to clipboard and if I just paste this in and hit enter WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
okay so let's copy this to clipboard and if I just paste this in and hit enter
as we can see
here we have successfully installed the Gailing Guy EngineX role so check this
out if I say for
example go to my managed devices right now so here is my yellow box if I say
systemctl status on
EngineX notice we actually do not have an EngineX server on this device and if
we go to the blue
box systemctl status engineX once again we can see we do not have this
particular service let me
create a play called role test dot yml okay and let's go into this particular
file with them WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
file with them
have my three hyphens at the top all I will do is I'll give this a name and I
'll just say install
EngineX on real servers the host I'm going to target will be my all group and
all I will do is
I'll specify the roles keyword have my hyphen and then give the name of the
role that I just installed
which in this case here was Gailing Guy dot EngineX this is all I need to do
and if I want to build
upon this I can go and add my own custom task but as we can see here this is
actually not necessary
so right now if I just press escape colon wq to write and quits if I just say WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
so right now if I just press escape colon wq to write and quits if I just say
answerable playbook
on role test and to enter check this out right here answerable begins config
uring the EngineX
service on all of our devices see we can see that running through all the tasks
and as we can see
here everything is okay we have five changes on the device or rather five
changes on each device
so if I go back to the yellow box hit the up arrow check for the status of
EngineX notice now we
actually have an active and running EngineX web server similarly on the blue
box let's go here WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
arrow up check the status inside of this particular machine we also have the
same EngineX web server
now do you see how simple this was to get set up we have the power of
automation we could potentially
be connecting to a hundred of devices and to get all of these devices
configured with a web server
we just installed a role and just referenced the role in one line within a
playbook this shows us
the power and simplicity of the answerable role so we can go directly to answer
able galaxy however
another thing we can do is actually install system roles for Red Hat Enterprise WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
another thing we can do is actually install system roles for Red Hat Enterprise
Linux these are
actively being developed and maintained for the Red Hat Enterprise Linux system
so let's go back
to our control mode if I just clear the screen all I'm going to do is say sudo
dnf install rel
hyphen system hyphen roles and to enter if I just hit y and to enter again it's
going to begin
installing these system roles perfect now once you've done this if you go into
user share docs
and then rel system role if I do an LSP have all of these particular
directories and inside of WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
directories and inside of
these directories are these system roles for particular services things like
say for example a post
gracio server or perhaps you want to set up some type of seelanitz
configuration these roles are
all within these particular folders so in this case here let's go into say for
example the time
sync folder okay check this out right here we actually have these example play
books so we have
an example single pull playbook for a single ntp server and we also have a
playbook for multiple
ntp servers so if I just go into the single pull for example here check this WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
ntp servers so if I just go into the single pull for example here check this
out right here this
is an example playbook so what I'm going to do here is just go out temporarily
and all I'm going
to do is I'm going to copy the example single pull playbook from within this
directory and I'm
just going to copy it to my home directory using the tilde sign if I hit enter
do cd go back to
my home directory here doing ls now I have a copy of the example single pull
playbook so let's use
them to edit this all I'm going to do is I'm going to change the targets in
this case here
I'm going to target the all group and if I want to make some quick WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
I'm going to target the all group and if I want to make some quick
modifications of the
particular configurations then I have the ability to do that but right now I
will just save my
changes and all I will now do is say answerable playbook example single pull
playbook dot yml if I
enter answer will begin walking through all of the configuration necessary to
get the server up
and running and as we can see here we have a sifting task with four changes 24
have been skipped
and we have nothing failed so look at all the things that were actually done
enabling cronyd
restarting cronyd updating the network sis config file all of that was handled WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
restarting cronyd updating the network sis config file all of that was handled
automatically for
you simply by virtue of using the answerable role so now we've seen how to
create our own
roles as well as how to consume the roles created by other members of the
answerable community
let's now validate what we've learned within this skill