1 00:00:07,020 --> 00:00:08,810 - So in Ansible there's also 2 00:00:08,810 --> 00:00:11,000 this thing called Automation Hub. 3 00:00:11,000 --> 00:00:14,230 Automation Hub is a Red Hat subscription platform 4 00:00:15,240 --> 00:00:17,260 but it's used to work with collections as well. 5 00:00:17,260 --> 00:00:18,850 So I would like to talk about 6 00:00:18,850 --> 00:00:20,793 using collections from Automation Hub. 7 00:00:22,230 --> 00:00:24,270 So what is involved? 8 00:00:24,270 --> 00:00:26,960 Well, there are two types of collections. 9 00:00:26,960 --> 00:00:28,690 The community collections are provided 10 00:00:28,690 --> 00:00:30,610 through Ansible Galaxy. 11 00:00:30,610 --> 00:00:32,780 And there are Subscription-only collections 12 00:00:32,780 --> 00:00:37,523 which go through cloud.redhat.com/ansible/automation-hub. 13 00:00:38,570 --> 00:00:40,430 You will notice that on Automation Hub 14 00:00:40,430 --> 00:00:42,090 there is a lot of collections 15 00:00:42,090 --> 00:00:43,810 that you will also find on galaxy 16 00:00:43,810 --> 00:00:46,853 but there's also subscription-only collections. 17 00:00:47,770 --> 00:00:48,970 The difference is 18 00:00:48,970 --> 00:00:51,680 that if you find it on Automation Hub 19 00:00:51,680 --> 00:00:53,560 that it's supported. 20 00:00:53,560 --> 00:00:56,820 Now if you want to use collections from Automation Hub 21 00:00:56,820 --> 00:00:57,690 you need to go there 22 00:00:57,690 --> 00:00:59,517 and you need an authentication token. 23 00:00:59,517 --> 00:01:01,150 And this token needs to be stored 24 00:01:01,150 --> 00:01:03,030 in the ansible.cfg file 25 00:01:03,030 --> 00:01:04,210 to ensure that you have 26 00:01:04,210 --> 00:01:06,790 a smooth access to the collections 27 00:01:06,790 --> 00:01:08,250 on Automation Hub. 28 00:01:08,250 --> 00:01:09,320 So how does that work? 29 00:01:09,320 --> 00:01:10,810 Well, first you need to ensure 30 00:01:10,810 --> 00:01:11,910 that you have a token. 31 00:01:13,060 --> 00:01:15,530 And you can do that from Automation Hub 32 00:01:15,530 --> 00:01:16,363 connect to hub 33 00:01:16,363 --> 00:01:17,610 and you copy the token 34 00:01:17,610 --> 00:01:22,610 and you include it in your ansible.cfg file. 35 00:01:23,270 --> 00:01:25,260 Before we are moving on 36 00:01:25,260 --> 00:01:26,310 let me just show you. 37 00:01:28,100 --> 00:01:29,600 All right so I'm going to 38 00:01:29,600 --> 00:01:33,210 the Automation Hub platform. 39 00:01:33,210 --> 00:01:35,870 I'm doing that on the Fedora machine 40 00:01:35,870 --> 00:01:37,993 which is using Ansible 2.12. 41 00:01:39,735 --> 00:01:42,735 (keyboard clicking) 42 00:01:52,000 --> 00:01:54,070 This is an authenticated platform 43 00:01:54,070 --> 00:01:56,193 so I do need to log in. 44 00:01:59,421 --> 00:02:02,421 (keyboard clicking) 45 00:02:03,930 --> 00:02:07,120 So now we are in Automation Hub 46 00:02:08,100 --> 00:02:11,180 and in Automation Hub we can see 47 00:02:11,180 --> 00:02:12,070 the different options 48 00:02:12,070 --> 00:02:13,323 to connect to the hub. 49 00:02:15,097 --> 00:02:16,500 And what are we going to do? 50 00:02:16,500 --> 00:02:21,180 Well, I am going to load the token 51 00:02:22,940 --> 00:02:24,340 which you can read in the description 52 00:02:24,340 --> 00:02:26,240 use this token to authenticate clients 53 00:02:26,240 --> 00:02:31,180 that need to download information 54 00:02:31,180 --> 00:02:33,360 and you can also see the token will expire 55 00:02:33,360 --> 00:02:35,740 after 30 days of inactivity. 56 00:02:35,740 --> 00:02:37,740 So that's really something 57 00:02:37,740 --> 00:02:39,023 you need to be aware of. 58 00:02:40,470 --> 00:02:42,060 So here I have my token. 59 00:02:42,060 --> 00:02:44,500 I am going to copy the token 60 00:02:44,500 --> 00:02:45,790 that has been copied 61 00:02:45,790 --> 00:02:47,130 up to the clipboard. 62 00:02:47,130 --> 00:02:49,360 And now I can put in 63 00:02:49,360 --> 00:02:51,450 all the information that I need 64 00:02:51,450 --> 00:02:53,943 in my Ansible configuration file. 65 00:02:54,810 --> 00:02:57,100 So I'm opening my ansible.cfg 66 00:02:58,090 --> 00:03:00,200 and in the ansible.cfg 67 00:03:00,200 --> 00:03:02,060 you can see that I already have 68 00:03:02,060 --> 00:03:04,930 a lot of options that we need. 69 00:03:04,930 --> 00:03:07,760 So in the Galaxy option 70 00:03:07,760 --> 00:03:09,210 we have a server list. 71 00:03:09,210 --> 00:03:10,830 Server list is a list of servers 72 00:03:10,830 --> 00:03:13,350 which contains the Automation Hub 73 00:03:13,350 --> 00:03:14,913 as well as release galaxy. 74 00:03:15,930 --> 00:03:19,490 Then in the galaxy server Automation Hub part 75 00:03:19,490 --> 00:03:20,870 we have URL 76 00:03:20,870 --> 00:03:22,740 we have authentication URL 77 00:03:23,970 --> 00:03:25,970 and we have token. 78 00:03:25,970 --> 00:03:28,540 And I've used token as XXXX. 79 00:03:28,540 --> 00:03:33,170 Well, that needs to be replaced with your token. 80 00:03:33,170 --> 00:03:34,770 In the GIT repository 81 00:03:34,770 --> 00:03:36,280 to make it a little bit easier. 82 00:03:36,280 --> 00:03:38,630 I already put the appropriate information 83 00:03:38,630 --> 00:03:40,000 in the galaxy.cfg 84 00:03:40,000 --> 00:03:42,693 so that you only have to replace with your token. 85 00:03:44,040 --> 00:03:46,360 So here we have token number one 86 00:03:46,360 --> 00:03:48,993 and here we have token number two. 87 00:03:49,970 --> 00:03:53,530 And now I have set up my ansible.cfg 88 00:03:53,530 --> 00:03:55,625 and that means that my configuration 89 00:03:55,625 --> 00:03:56,830 should now be ready 90 00:03:56,830 --> 00:04:01,150 to reach out to the Ansible Automation Hub. 91 00:04:01,150 --> 00:04:03,010 So now I can continue 92 00:04:03,010 --> 00:04:05,810 and let's before we do that 93 00:04:05,810 --> 00:04:07,410 let's have a look at the slides. 94 00:04:09,020 --> 00:04:10,900 So now that we have set up 95 00:04:10,900 --> 00:04:12,910 the ansible.cfg 96 00:04:13,760 --> 00:04:16,260 we can work with the requirements file 97 00:04:16,260 --> 00:04:17,940 and in the requirements file 98 00:04:17,940 --> 00:04:21,950 you can refer to the Automation Hub. 99 00:04:21,950 --> 00:04:24,540 So this is really how it is working. 100 00:04:24,540 --> 00:04:27,610 And after installing collections 101 00:04:27,610 --> 00:04:30,080 from Automation Hub in this specific way 102 00:04:30,080 --> 00:04:32,990 you have your supported collections as well. 103 00:04:32,990 --> 00:04:34,670 Obviously what I'm doing right here 104 00:04:34,670 --> 00:04:36,010 I'm on Fedora 105 00:04:36,010 --> 00:04:37,850 and on Fedora using collections 106 00:04:37,850 --> 00:04:39,202 from Automation Hub 107 00:04:39,202 --> 00:04:40,970 that's not really going to bring you 108 00:04:40,970 --> 00:04:42,700 a supported environment. 109 00:04:42,700 --> 00:04:44,630 The idea is that 110 00:04:44,630 --> 00:04:47,610 you do it in a complete supported ecosystem 111 00:04:47,610 --> 00:04:50,960 preferably with a Red Hat Ansible binaries 112 00:04:50,960 --> 00:04:54,340 or some supported platform as well. 113 00:04:54,340 --> 00:04:57,240 Although this is opening an option 114 00:04:57,240 --> 00:04:59,950 to use supported collections 115 00:04:59,950 --> 00:05:01,700 on an unsupported platform. 116 00:05:01,700 --> 00:05:02,533 You know what 117 00:05:02,533 --> 00:05:03,670 let's see how far we get 118 00:05:03,670 --> 00:05:06,003 if you try to do this on Fedora. 119 00:05:07,410 --> 00:05:10,880 So let's have a look at the requirements.cfg 120 00:05:10,880 --> 00:05:12,900 where we can see the different collections. 121 00:05:12,900 --> 00:05:15,650 I don't care about the galaxy collections. 122 00:05:15,650 --> 00:05:18,320 It is the Automation Hub collection 123 00:05:18,320 --> 00:05:19,810 that we care about. 124 00:05:19,810 --> 00:05:21,400 As you can see in the source 125 00:05:21,400 --> 00:05:25,110 it clearly indicates the Automation Hub. 126 00:05:25,110 --> 00:05:25,943 And from there 127 00:05:25,943 --> 00:05:27,540 we can learn the requirements well 128 00:05:27,540 --> 00:05:32,540 so ansible-galaxy collection install -r requirements.yml. 129 00:05:39,733 --> 00:05:40,566 And there we go 130 00:05:40,566 --> 00:05:41,399 and as you can see 131 00:05:41,399 --> 00:05:44,620 it's processing the install dependency map. 132 00:05:44,620 --> 00:05:47,691 This is good news. 133 00:05:47,691 --> 00:05:52,343 You can ignore the galaxy server, galaxy.ansible.com. 134 00:05:53,420 --> 00:05:54,390 And you know what 135 00:05:54,390 --> 00:05:55,410 you should even wonder 136 00:05:55,410 --> 00:05:58,460 if you want to to use this galaxy server 137 00:05:58,460 --> 00:06:02,043 if you are working with the Automation Hub. 138 00:06:02,880 --> 00:06:04,160 Hey before we are continuing 139 00:06:04,160 --> 00:06:06,370 let's get back to the webpage 140 00:06:06,370 --> 00:06:09,195 because did we already have a look at 141 00:06:09,195 --> 00:06:13,480 the Automation Hub packages? 142 00:06:13,480 --> 00:06:14,840 So, here we see 143 00:06:14,840 --> 00:06:17,000 what Automation Hub is all about. 144 00:06:17,000 --> 00:06:18,070 In Automation Hub 145 00:06:18,070 --> 00:06:20,090 you can see all of these Red Hat partners. 146 00:06:20,090 --> 00:06:22,900 There are 56 in total at the moment 147 00:06:22,900 --> 00:06:25,790 and let's do 100 per page. 148 00:06:25,790 --> 00:06:26,623 And you can see 149 00:06:26,623 --> 00:06:28,480 all of the Red Hat partners. 150 00:06:28,480 --> 00:06:29,870 And if you're interested 151 00:06:29,870 --> 00:06:33,570 in whatever kind of Red Hat partner 152 00:06:33,570 --> 00:06:36,595 you go into that partner to figure out 153 00:06:36,595 --> 00:06:39,520 which collections are available. 154 00:06:39,520 --> 00:06:41,190 And there you can see that for instance 155 00:06:41,190 --> 00:06:43,480 OpenShift is available 156 00:06:43,480 --> 00:06:46,380 the OpenShift collection for Ansible. 157 00:06:46,380 --> 00:06:48,560 So what is in OpenShift? 158 00:06:48,560 --> 00:06:51,610 In OpenShift we have the contents option 159 00:06:51,610 --> 00:06:52,690 and in the contents option 160 00:06:52,690 --> 00:06:54,545 we can see there's a Kubernetes option. 161 00:06:54,545 --> 00:06:55,783 There's an OC option. 162 00:06:55,783 --> 00:06:57,750 There's an OpenShift, OpenShift, OpenShift. 163 00:06:57,750 --> 00:06:59,620 So that's the OpenShift collection. 164 00:06:59,620 --> 00:07:00,910 That is very interesting. 165 00:07:00,910 --> 00:07:04,170 Now the big question right here 166 00:07:04,170 --> 00:07:09,160 we are on the Fedora 212 machine. 167 00:07:09,160 --> 00:07:14,160 And if I'm going to use ansible-doc -L | grep openshift 168 00:07:15,840 --> 00:07:17,593 do we find any OpenShift? 169 00:07:20,530 --> 00:07:21,980 And there you can see 170 00:07:21,980 --> 00:07:23,800 that's an interesting one. 171 00:07:23,800 --> 00:07:26,620 We have community OpenShift stuff as well. 172 00:07:26,620 --> 00:07:28,000 Now what is the difference? 173 00:07:28,000 --> 00:07:29,180 The community stuff 174 00:07:29,180 --> 00:07:30,640 comes from the community. 175 00:07:30,640 --> 00:07:35,160 This is the good old Red Hat software model. 176 00:07:35,160 --> 00:07:37,720 There's community software that comes unsupported. 177 00:07:37,720 --> 00:07:40,160 You wanna use the supported software 178 00:07:40,160 --> 00:07:41,860 use the Red Hat model 179 00:07:41,860 --> 00:07:44,060 which requires a subscription license 180 00:07:44,060 --> 00:07:46,130 which is why Automation Hub 181 00:07:46,130 --> 00:07:48,060 and Ansible automation platform 182 00:07:48,060 --> 00:07:51,590 in a broader sense are interesting. 183 00:07:51,590 --> 00:07:52,840 This is how you use them.