So friends, to close what I would like to do is to highlight how we can perform
this particular task, this time using an answerable role.
So with that said, let's just get to it.
So once again, we're going to be using the storage role.
So if we go back to the documentation that we were looking at before, let me go
back to the GitHub page for storage.
Now going back down to our storage volumes, previously we saw things such as
the name, the disk, the type, that type of thing,
as well as the file system type.
But if we scroll down a little bit further, notice we have other options such
as the mount point, which is going to allow us to specify the directory in WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
as the mount point, which is going to allow us to specify the directory in
which the file system is going to be mounted.
We can also specify things such as mount_user to denote which user is going to
be the owner of the mount directory.
So all I want to do here is I'm going to quickly write another playbook to
perform a similar action, this time just using the actual rail system roles,
storage role.
So let's go back to our control nodes.
And all I will do here is I'll create a playbook called Play4.yml.
So let's go into Incent mode, have our three hyphens at the top, you know the
drill, let's give it a name, let's say Play4. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
drill, let's give it a name, let's say Play4.
And I'm just saying mount using storage role.
So here we're going to target this time, let's go with the yellow box.
We'll have our gather facts configured to be false.
And once again, I'm going to define my vars like I did before.
So I'm going to specify my storage volumes.
And let's just go and see what we're trying to actually mount here.
So let's go to the yellow box and I'll do an lsbrk-f.
This here is the actual device and we can see the file system happens to be ext
4.
Now let's just create a little mount point here manually just for some place to WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Now let's just create a little mount point here manually just for some place to
there.
Let's just call this yellow mount.
Okay, so I'll do an ls.
This here is going to be the mount point within this particular directory.
So let's just give this a name, let's just again say testfs.
So the type is going to be a disk.
The disks that I'm going to be targeting is again going to be the nvm e zero n
two disk.
The fs type in this case here is going to be ext4.
Now I'm going to specify that the mount points is going to be in the home
directory of nugget user. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
directory of nugget user.
And it's going to be the yellow mount directory I just created.
Now again, if I wanted to add in more values, I could.
But for now, let's keep this very, very simple.
And all I will do is at the same level of indentation as the vars keyword and
go to specify my roles and just simply call the rel-system role dot storage.
So let's just save this right here.
And all I will do is I'll try to run the playbooks.
Let's hit enter, give it a moment.
And we can see the playbook kicks off.
As we can see, we have a change being made to the mount point right here. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
As we can see, we have a change being made to the mount point right here.
And the playbook completes.
Now if I go back to my yellow box right here, if I do an ls blk dash f notice
straight away.
That the file system has indeed been mounted in the mount points.
And if I happen to look at the ls a fsthab file, it has also been modified
within this particular file,
meaning that it will persist via reboots.
So that is how we can mount our file system using the rel-system roles storage
role.
Let's validate what we've learned within this skill.