Okay friends, so before we begin actually tempotizing some configurations, what
I first want to do is to create some variable files
and we're going to be able to call those variables when rendering the actual
template itself.
So what we'll do here is, and let me just get my pen up, is we'll write some
really simple group files.
Or rather should I say group_verse variables, as well as some host_verse, and
we'll actually have some of these in a nested form.
Now to keep things fun and light, we're not going to be concerned about
rendering Linux configurations quite just yet. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
rendering Linux configurations quite just yet.
We'll just create some dummy config and render the actual template itself.
You'll get to see what I mean. So let's go and do that then. So what I will do
here is if I do an LS, we can see the contents of our directory structure.
If I go in and do a CD into host_verse. So inside of this particular file, what
I'm going to do is just make sure I've got some host variables.
They're just align with the information in my inventory. So I have a blue box
and a yellow box machine. So what I will do is I'll just say touch blue box dot
yml,
as well as touch yellow box dot yml as well. So the first one I will go into WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
as well as touch yellow box dot yml as well. So the first one I will go into
will be the blue box right here.
Let's do i for insert mode, have a 3- to denote our yaml file.
So let's just create a key called, oh I don't know let's say device_roll. It
doesn't actually matter quite so much.
And we'll just give it a name and we'll just say blue box web. We'll also have
a type key and this specifies that this is a web server.
So let's do a similar thing over on the other device here. So let's go into
yellow box. In insert mode, have our free hyphens at the top. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
yellow box. In insert mode, have our free hyphens at the top.
We'll have our device_roll key, have a name, and I'll just say yellow_db. Okay.
And the type here in this case is going to be a database. So basically we're
pretending that the yellow box is our database and the blue box is a web server
.
Really quite simple. So to escape colon wq to write and quit, what I'm now
going to do is go into my group file right here.
If I do an ls, what I want to do is to create a group variable for one of my
groups. In this case here, I will just use the all group.
So I'll say touch all dot yml and we'll just go into that particular file. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So I'll say touch all dot yml and we'll just go into that particular file.
And we'll have a three hyphens at the top. Once again, I'll just create a key
called let's maybe say domain info.
And then I'll have the name, let's just call this CBT nuggets land and the
location is going to be in Oregon and the United States.
So really super basic information right now. We have created some very, very
simple host and group variable files.
What we now want to do is to learn how we can actually populate the values
within these files by utilizing our ginger two templates.
So let's talk about that in the very next video. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So let's talk about that in the very next video.