Okay friends, so let's walk through the validation solution.
Okay, so the very first thing I'm going to have to do is to go down to my
organizations.
Let's click on this here, then I will choose Add, I'll give this a name, and it
's going to be called Validation -org.
So let's just save this. Then I'm going to have to create an inventory called
Validation -inf.
So we go to my inventory, let's add a new one, and it's going to be called Val
idation -inf.
And let's make this a member of our new organization.
And all we'll do now is I will choose Save.
Now what I want to do is I want to include both of my hosts, that happen to be WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Now what I want to do is I want to include both of my hosts, that happen to be
my Blue Box and my Yellow Box within this inventory.
So I will go to my hosts, and I will just choose Add, and the name will be the
Blue Box, and I will choose Save.
And I'll go back to Hosts, choose Add again, and this time I will add my Yellow
Box as well.
Again, choose whatever names are appropriate for your environment.
If you don't have a Blue Box in Yellow Box, use the names you happen to have
chosen throughout this course.
Now what I want to do is I want to have a group called Nuggets, and both of
these managed devices, it should be a member of that group. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
these managed devices, it should be a member of that group.
So if I look at my Validation -inf, this time if I go to the Groups tab, and I
choose Add, I will have a group called Nuggets.
And I will just choose Save.
If I then go to my hosts that are going to be within this particular group, if
I choose Add, and add an existing host,
and I add both the Yellow Box and the Blue Box to this particular group and
choose Save,
now we can see here within my Groups I have the Nugget Group, and inside of
here we have two hosts called Blue Box and Yellow Box.
Now what I want to do is I want to create the appropriate credentials to log WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Now what I want to do is I want to create the appropriate credentials to log
into these devices, so I'll go to Credentials, and I'll choose Add.
Let's just give this a name of my credit, it doesn't actually matter the name,
and the type is going to be a Machine Type,
because after all we're going to be logging into two real devices.
How do I actually manage the devices where they have an Ansible username on
both devices, and the corresponding password for that account is Ansible once
again.
Now it's going on down, our Privilege_Escolation method is going to be pseudo,
the user name will be root, and in my case here the root password is just
simply password 1. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Whatever the root password is for you, you would supply that value here too,
and now I will just choose Save.
So with that now done, what I want to do is to create a private repository on
GitHub that is going to have a playbook called ValidationPlay.YML.
So over on my GitHub account, all I will do is I will choose New from New Rep
ository, give this a name of anything you so wish, I would just call this Val
idation repo, and again I'm going to make this a private repository as per the
instructions,
and I will also add a Ruby file to initialize this, and I will just choose
Create Repository. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Now inside of here we should have a playbook called ValidationPlay.
Let's go to Add, I'll create a new file, I'll just say ValidationPlay.YML, and
now what I will do is I will write a playbook that is going to target the
repository.
So it is going to target the nuggets root, I'll give this a name, just call
this maybe ValidationPlay.
The host I should be targeting the nuggets root, I'll just say gather facts to
be false to save time, we don't need those.
And now I will define my tasks, and the task here is going to simply create a
file on all devices, and I will use the Ansible built-in shell module, and all WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
file on all devices, and I will use the Ansible built-in shell module, and all
I will do is issue the command touch/tmp, and the file should be called aap-
validation.txt.
So this actually commit these changes, and now what I want to do is I want to
ensure that the project is going to source playbooks from this repository, and
I have to ensure that I have created source control credentials to access this
private repo.
So let me click my little icon here, I will go down to Settings, I'll scroll
down the left to Developer Settings, choose Personal Access Tokens, then Tokens
Classic, and now I will generate a new token, and click this here. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Classic, and now I will generate a new token, and click this here.
So I can call this token, anything used to wish, I will just call this Val
idation Token, and I'll make it available for seven days, and all I will do is I
will click Fill Control of Private Repositories, and then I'll scroll all the
way down and generate the token.
Now what I want to do is I want to copy this token, and make sure I keep a copy
of it.
Now what I will do is I will go and create more credentials for the repo, so
let's add a new credential, let's just call this a repo-cred.
Credential type, this time is going to be source control, the user name, well WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Credential type, this time is going to be source control, the user name, well
my log and user name for my personal get-tob is my email address of ipv0@gmail.
com, and the password here is simply going to be that token I just generated, so
if I just paste this in, we can see that it is, and all I will do now is scroll
all the way down and save these credentials.
Perfect, so with that now saved, what I want to do is create a project that is
going to source the playbooks from this repository, so let's add a new project,
which is called as Validation Project, the name itself doesn't matter so much.
The organization, again we'll use the Validation org, the source control type
is going to be get, and now the source control URL, so what I will do here is I
'll go back to my repository, so I'll go to my Repos, let's go to Validation WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
'll go back to my repository, so I'll go to my Repos, let's go to Validation
repo, then I'll go into Code here and just copy the URL, and I will paste in
this URL right here, and now specify
the source control credential to log in here, so I will choose as the repo
credits right here and select, and now I will choose Save.
So with that now done, I want to effectively run the Validation Playbook from
within a template, so let's go to my templates, and I'll add a new template, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
let's go to Add Job Template, give this a name, which is called as Validation
Job.
The inventory is going to be targeting the Validation Inf, the project is going
to be the Validation Project, and the playbook is going to be the Validation
Hive and Play, now the credentials to log into the machine is going to be MyC
reds, select that, then I will just tick Privilege Escalation, and then select
Save.
Once I've done that, I can scroll on down and click Launch, and that should now
launch the playbook.
The open appears I happen to have some type of syntax error within my playbook, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
The open appears I happen to have some type of syntax error within my playbook,
so that's my fault right there, let me go and correct that.
Let's go back to the actual repository, let's go into Validation Play.
Open, I can see actually here, but I've done wrong, I have my quotation mark
here, and I didn't actually open it, so if I go in and edit this file, let me
just get rid of that, and now I'll just commit the changes.
Let me just go back to Answerable, let's go to My Templates once again, so I'll
just delete this temporarily, okay.
And in fact before I do that, I want to go to my projects in my Validation
Project, and I actually want to synchronize the change because there has been
an update, so let's go and click Sync here, and that will pull down any changes WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
an update, so let's go and click Sync here, and that will pull down any changes
, including any differences in the syntax, and now if I go to My Templates, I
will just add the Job Template, again just a Validation Job, Infantory, is Val
idation Inf, Project is Validation Project, which is now being synchronized and
updated.
We use the same playbook, choose the credentials of My Creds, scroll on down,
choose privilege escalation, and save, scroll on down, and then choose launch.
So we can see the job happens to be successful, we can go to the details and
then look at the output, there we have all the output right here, if we go to WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
then look at the output, there we have all the output right here, if we go to
our devices, so in the case of the yellow box, if I go into the temp directory
and do an LS, we can see we actually have the AAP hyphen Validation Text file,
and again over on the blue box, which was also part of the nuggets group.
If I see the n to the temp directory and do an LS, indeed we can see we also
have that same text file, so that is us for our validation challenge on the Ans
ible Automation Platform Automation Control Learn, I hope it has been
informative for you, and I'd like to thank you for viewing.