WEBVTT

1
00:00.000 --> 00:03.040
Okay so let's walk through the solution then. So the very first time we're

2
00:03.040 --> 00:03.760
going to have to do

3
00:03.760 --> 00:07.440
is a right-day playbook that is going to use the NNC-ally module to configure

4
00:07.440 --> 00:07.920
the system's

5
00:07.920 --> 00:14.480
ethernet connection to use a DNS server with the IPv6 address of 2001 DB8, ABCD

6
00:14.480 --> 00:15.680
, colon colon 1.

7
00:15.680 --> 00:19.040
So with that said what I will do here is I will go in and I'll create a

8
00:19.040 --> 00:19.840
playbook let's just call

9
00:19.840 --> 00:25.580
us maybe validation1.yml and I'm going to insert mode have my three hyphens and

10
00:25.580 --> 00:26.080
I'll give this

11
00:26.080 --> 00:29.920
playbook a name and just call it let's just say validation1. Now the host

12
00:29.920 --> 00:31.040
within your network
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

12
00:29.920 --> 00:31.040
within your network

13
00:31.040 --> 00:35.120
that was not specified so you can target a particular device in your topology

14
00:35.120 --> 00:36.320
or if you so wish you

15
00:36.320 --> 00:40.770
can just target every device you're managing. Now I'll set my gather facts to

16
00:40.770 --> 00:42.240
be false and now I

17
00:42.240 --> 00:47.970
will define my tasks. The task name can just be configure IPv6 DNS settings and

18
00:47.970 --> 00:48.880
now I'm going to

19
00:48.880 --> 00:53.080
have to utilize the NMC-ally module. So recall if you want to use this

20
00:53.080 --> 00:54.480
particular module you're

21
00:54.480 --> 00:57.960
going to have to install it via Ansible Galaxy so make sure you've done that

22
00:57.960 --> 00:59.200
before attempting to

23
00:59.200 --> 01:05.250
use this particular module. So it's going to be community.general.nncally and
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

23
00:59.200 --> 01:05.250
use this particular module. So it's going to be community.general.nncally and

24
01:05.250 --> 01:05.760
now I'm going to have

25
01:05.760 --> 01:10.230
to specify the colon name which is a required parameter recall. Now in my case

26
01:10.230 --> 01:11.200
here the devices

27
01:11.200 --> 01:14.920
which I'm managing they both have an ethernet interface off and if I just go

28
01:14.920 --> 01:15.680
here to one of my

29
01:15.680 --> 01:20.540
devices if I don't IP adder we can see on my device it is ENS16. If that is

30
01:20.540 --> 01:21.840
different for your

31
01:21.840 --> 01:25.880
particular configuration then be aware to change that value. So I'm going to

32
01:25.880 --> 01:28.000
target ENS16. The

33
01:28.000 --> 01:31.630
type of the connection is an ethernet interface and now here is a part that we
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

33
01:28.000 --> 01:31.630
type of the connection is an ethernet interface and now here is a part that we

34
01:31.630 --> 01:32.400
're going to have to

35
01:32.400 --> 01:37.770
configure the DNS for IPv6. Now recall if we look at the actual documentation

36
01:37.770 --> 01:38.400
if we search for

37
01:38.400 --> 01:42.820
Ansible NMC-ally let's go to the docs here. If I just run a search for DNS we

38
01:42.820 --> 01:43.760
can see we have

39
01:43.760 --> 01:48.800
the option for DNS4 that is going to be for IPv4 we do not want that but look

40
01:48.800 --> 01:50.160
at this right here

41
01:50.160 --> 01:55.600
we have this option for DNS6. This is going to allow to specify DNS servers

42
01:55.600 --> 01:57.120
with an IPv6 address

43
01:57.120 --> 02:01.760
and it's going to take a list as a value which is going to be comprised of
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

43
01:57.120 --> 02:01.760
and it's going to take a list as a value which is going to be comprised of

44
02:01.760 --> 02:03.840
subsequent string values.

45
02:03.840 --> 02:07.880
So this is the option we're going to have to use. So we'll type DNS6 in this

46
02:07.880 --> 02:08.800
case here we'll have

47
02:08.800 --> 02:13.000
a colon and we're going to have to specify a list so here is our hyphen. Now

48
02:13.000 --> 02:14.000
the value is going to be

49
02:14.000 --> 02:23.670
2001 colon DB8 colon ABCD colon colon 1 and all I'm going to do is say that the

50
02:23.670 --> 02:24.480
state should be

51
02:24.480 --> 02:29.040
present. So if I just save this right here and I try to run the actual playbook

52
02:29.040 --> 02:30.240
and to enter give
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

52
02:29.040 --> 02:30.240
and to enter give

53
02:30.240 --> 02:33.930
it a moment and as we can see we do have a change on the devices. So let's go

54
02:33.930 --> 02:34.960
to our devices let's

55
02:34.960 --> 02:39.370
say NMC-ally corn show here is interface I'm going to target so let's be a

56
02:39.370 --> 02:39.840
little bit more

57
02:39.840 --> 02:44.410
specific and say ens 160 we get all of this information and if I scroll

58
02:44.410 --> 02:46.160
throughout it when I get to

59
02:46.160 --> 02:50.440
ipv6.dns look at what we actually have here we have the value that we just

60
02:50.440 --> 02:51.440
configured and the

61
02:51.440 --> 02:55.280
same is going to be true on the other device as well. So with that now done let

62
02:55.280 --> 02:56.000
's now write

63
02:56.000 --> 03:00.940
the second playbook so let's create a new one called validation 2.yml again let
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

63
02:56.000 --> 03:00.940
the second playbook so let's create a new one called validation 2.yml again let

64
03:00.940 --> 03:01.360
's follow the

65
03:01.360 --> 03:04.830
same structure three hyphens give it a name let's just say validation to once

66
03:04.830 --> 03:05.440
again we're not

67
03:05.440 --> 03:08.280
specified who we need to target so I'll just target the all group and once

68
03:08.280 --> 03:09.280
again I'm going to set

69
03:09.280 --> 03:13.920
gather facts to be false. Now we're going to have to use the rail system role

70
03:13.920 --> 03:14.480
to configure the

71
03:14.480 --> 03:20.700
network ethernet connection to insert a static route of 172. 2010.0/24 with the

72
03:20.700 --> 03:23.760
next hop of 172.61.1

73
03:23.760 --> 03:26.810
and ensure the playbook is going to immediately activate this change so the

74
03:26.810 --> 03:27.760
role we're going to

75
03:27.760 --> 03:31.390
use is rail system role network and the first thing we're going to have to do
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

75
03:27.760 --> 03:31.390
use is rail system role network and the first thing we're going to have to do

76
03:31.390 --> 03:32.480
is to insert some

77
03:32.480 --> 03:37.360
variable values so we will define our vars and the first vars is going to be

78
03:37.360 --> 03:39.200
the network provider

79
03:39.200 --> 03:43.490
remember we're going to have to use nm for our particular version and we'll

80
03:43.490 --> 03:44.800
specify the network

81
03:44.800 --> 03:49.960
connections variable so once again I'm going to target ens at 160 the type is

82
03:49.960 --> 03:51.360
ethernet and what

83
03:51.360 --> 03:55.110
I'm going to do is I'm going to specify the IP key and then the route key and

84
03:55.110 --> 03:55.920
now here I'm going

85
03:55.920 --> 04:00.260
to provide a list and now I specify the network I want to connect to or rather
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

85
03:55.920 --> 04:00.260
to provide a list and now I specify the network I want to connect to or rather

86
04:00.260 --> 04:01.280
the route that I

87
04:01.280 --> 04:06.670
want to insert should I say so it's going to be the 172. 2010.0 and now I

88
04:06.670 --> 04:08.560
specify its prefix

89
04:08.560 --> 04:13.270
which is going to be a slash 24 mask and then I specify the next hop via the

90
04:13.270 --> 04:14.400
gateway so the next

91
04:14.400 --> 04:20.680
hop is going to be 172.16.1.1 and now what I'm going to do is to call my answer

92
04:20.680 --> 04:22.000
able role so we just

93
04:22.000 --> 04:27.260
specify the roles key and the role is going to be rail hyphen system hyphen

94
04:27.260 --> 04:28.800
roles dot network so

95
04:28.800 --> 04:32.550
this role is going to consume these variables and make the configuration change
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

95
04:28.800 --> 04:32.550
this role is going to consume these variables and make the configuration change

96
04:32.550 --> 04:33.280
and now what we want

97
04:33.280 --> 04:38.060
to do is we want to as per the instructions ensure that the playbook is going

98
04:38.060 --> 04:39.520
to immediately activate

99
04:39.520 --> 04:43.500
this change so what I will do is I'll define some new tasks and the first task

100
04:43.500 --> 04:44.800
let's just call this

101
04:44.800 --> 04:49.010
activate the change and I will use the answerable built-in command module and

102
04:49.010 --> 04:50.080
the argument is going

103
04:50.080 --> 04:55.310
to be the command so the command is going to be nmcli corn up and again I could

104
04:55.310 --> 04:56.320
just hard code the

105
04:56.320 --> 04:59.900
value but if you so wish what you can do is use the better practice and that

106
04:59.900 --> 05:00.720
would be to insert
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

106
04:59.900 --> 05:00.720
would be to insert

107
05:00.720 --> 05:04.200
an actual variable so that would just be network connections we take the first

108
05:04.200 --> 05:05.120
element of the list

109
05:05.120 --> 05:09.550
and then grab the name key so that's going to activate the change but we also

110
05:09.550 --> 05:10.960
as per the instruction

111
05:10.960 --> 05:14.430
the last thing we're going to have to do is to write a task that is going to

112
05:14.430 --> 05:15.200
verify that the

113
05:15.200 --> 05:19.150
changes have taken effect so for the verification let's add a new task we'll

114
05:19.150 --> 05:20.960
just say send verification

115
05:20.960 --> 05:25.040
command and we'll use the answerable built-in command module again and the

116
05:25.040 --> 05:26.560
command I'm going to send

117
05:26.560 --> 05:31.440
is simply going to be ip route and I'll register this output as a variable and
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

117
05:26.560 --> 05:31.440
is simply going to be ip route and I'll register this output as a variable and

118
05:31.440 --> 05:32.640
let's just call ip

119
05:32.640 --> 05:37.310
route result and then we'll just finally print the result so use a debug module

120
05:37.310 --> 05:38.800
with the var parameter

121
05:38.800 --> 05:43.080
and I'm going to print out that result variable right here so let's save this

122
05:43.080 --> 05:43.600
and we'll give it a

123
05:43.600 --> 05:48.850
go so we'll run validation to dot yml and to enter the role begins to execute

124
05:48.850 --> 05:49.920
we make the changes

125
05:49.920 --> 05:53.160
and the playbook completes now if we scroll on up we can actually see the

126
05:53.160 --> 05:54.720
result of our commands

127
05:54.720 --> 05:59.580
here as the STD out printing the result of that particular command and inside

128
05:59.580 --> 06:00.400
that output we can
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

128
05:59.580 --> 06:00.400
that output we can

129
06:00.400 --> 06:07.710
actually see the presence of the route itself 172. 2010 /24 via 172.61.1 and if

130
06:07.710 --> 06:08.480
we scroll on up

131
06:08.480 --> 06:13.170
we'll get to the second device the blue box right here and similarly in the

132
06:13.170 --> 06:14.160
standard out we can

133
06:14.160 --> 06:17.840
also see the presence of the same route right there so that is us for our

134
06:17.840 --> 06:19.120
validation challenge

135
06:19.120 --> 06:22.400
on networking with Ansible I hope this has been informative for you and I'd

136
06:22.400 --> 06:23.440
like to thank you for
