- So in Ansible there's also
this thing called Automation Hub.
Automation Hub is a Red Hat subscription platform
but it's used to work with collections as well.
So I would like to talk about
using collections from Automation Hub.
So what is involved?
Well, there are two types of collections.
The community collections are provided
through Ansible Galaxy.
And there are Subscription-only collections
which go through cloud.redhat.com/ansible/automation-hub.
You will notice that on Automation Hub
there is a lot of collections
that you will also find on galaxy
but there's also subscription-only collections.
The difference is
that if you find it on Automation Hub
that it's supported.
Now if you want to use collections from Automation Hub
you need to go there
and you need an authentication token.
And this token needs to be stored
in the ansible.cfg file
to ensure that you have
a smooth access to the collections
on Automation Hub.
So how does that work?
Well, first you need to ensure
that you have a token.
And you can do that from Automation Hub
connect to hub
and you copy the token
and you include it in your ansible.cfg file.
Before we are moving on
let me just show you.
All right so I'm going to
the Automation Hub platform.
I'm doing that on the Fedora machine
which is using Ansible 2.12.
(keyboard clicking)
This is an authenticated platform
so I do need to log in.
(keyboard clicking)
So now we are in Automation Hub
and in Automation Hub we can see
the different options
to connect to the hub.
And what are we going to do?
Well, I am going to load the token
which you can read in the description
use this token to authenticate clients
that need to download information
and you can also see the token will expire
after 30 days of inactivity.
So that's really something
you need to be aware of.
So here I have my token.
I am going to copy the token
that has been copied
up to the clipboard.
And now I can put in
all the information that I need
in my Ansible configuration file.
So I'm opening my ansible.cfg
and in the ansible.cfg
you can see that I already have
a lot of options that we need.
So in the Galaxy option
we have a server list.
Server list is a list of servers
which contains the Automation Hub
as well as release galaxy.
Then in the galaxy server Automation Hub part
we have URL
we have authentication URL
and we have token.
And I've used token as XXXX.
Well, that needs to be replaced with your token.
In the GIT repository
to make it a little bit easier.
I already put the appropriate information
in the galaxy.cfg
so that you only have to replace with your token.
So here we have token number one
and here we have token number two.
And now I have set up my ansible.cfg
and that means that my configuration
should now be ready
to reach out to the Ansible Automation Hub.
So now I can continue
and let's before we do that
let's have a look at the slides.
So now that we have set up
the ansible.cfg
we can work with the requirements file
and in the requirements file
you can refer to the Automation Hub.
So this is really how it is working.
And after installing collections
from Automation Hub in this specific way
you have your supported collections as well.
Obviously what I'm doing right here
I'm on Fedora
and on Fedora using collections
from Automation Hub
that's not really going to bring you
a supported environment.
The idea is that
you do it in a complete supported ecosystem
preferably with a Red Hat Ansible binaries
or some supported platform as well.
Although this is opening an option
to use supported collections
on an unsupported platform.
You know what
let's see how far we get
if you try to do this on Fedora.
So let's have a look at the requirements.cfg
where we can see the different collections.
I don't care about the galaxy collections.
It is the Automation Hub collection
that we care about.
As you can see in the source
it clearly indicates the Automation Hub.
And from there
we can learn the requirements well
so ansible-galaxy collection install -r requirements.yml.
And there we go
and as you can see
it's processing the install dependency map.
This is good news.
You can ignore the galaxy server, galaxy.ansible.com.
And you know what
you should even wonder
if you want to to use this galaxy server
if you are working with the Automation Hub.
Hey before we are continuing
let's get back to the webpage
because did we already have a look at
the Automation Hub packages?
So, here we see
what Automation Hub is all about.
In Automation Hub
you can see all of these Red Hat partners.
There are 56 in total at the moment
and let's do 100 per page.
And you can see
all of the Red Hat partners.
And if you're interested
in whatever kind of Red Hat partner
you go into that partner to figure out
which collections are available.
And there you can see that for instance
OpenShift is available
the OpenShift collection for Ansible.
So what is in OpenShift?
In OpenShift we have the contents option
and in the contents option
we can see there's a Kubernetes option.
There's an OC option.
There's an OpenShift, OpenShift, OpenShift.
So that's the OpenShift collection.
That is very interesting.
Now the big question right here
we are on the Fedora 212 machine.
And if I'm going to use ansible-doc -L | grep openshift
do we find any OpenShift?
And there you can see
that's an interesting one.
We have community OpenShift stuff as well.
Now what is the difference?
The community stuff
comes from the community.
This is the good old Red Hat software model.
There's community software that comes unsupported.
You wanna use the supported software
use the Red Hat model
which requires a subscription license
which is why Automation Hub
and Ansible automation platform
in a broader sense are interesting.
This is how you use them.