So in this first demo,
we're going to examine Ansible Tower and GitHub integrations.
You know that having your playbooks under source
control is a big win for governance, but you want to take this one step further,
and you want to add additional granularity to the repository and have
better security for authenticating to the repository.
Here we will use personal access tokens and connect this to
the Ansible Tower to improve your security.
So in my GitHub, I have a number of repositories, and these are all public.
So at the moment I have a public repository for all my YAML playbooks.
So when Ansible Tower's running job templates,
there is no authentication required.
So as you can see in Ansible Tower, I just need to enter the SCM URL,
and once all other automation objects are in place,
you can run an automation job successfully.
So let's quickly create a new template and connect to this project,
and you will see that we have all the playbooks on
my public repository available.
So let us go back to GitHub, and I want to make this public repository private.
So we go to repository, then we click on Settings,
we scroll down to the bottom of the screen,
and under the section Danger Zone, we select Change repository visibility.
I will need to confirm this by typing in the full repository name.
Now let us go back to Tower and click on the project,
and I want to up this to get the latest version.
However, notice we have an Update failed status.
So let me click on the red button to get additional
information about this failure.
So Ansible is really good at telling you what's wrong,
and it's explicitly telling me that I have an authentication failure.
So to remedy this,
we need to create a new credential that incorporates
our new personal access token.
But first, we need to create the personal access token.
For this I go back to my GitHub account,
and on the upper right‑hand side I go to Settings,
then I scroll down to Developer settings,
then on the Personal access token I can select Generate new token.
You may be asked to confirm your email address here.
And I'll give a token a note here.
So as you can see,
there's quite a large scope that could be defined for your token,
but for now I will give it full control of the private repo.
So once you're happy with all of these settings,
you can copy and paste the token.
And now I want to go back into my Ansible Tower and
connect this token to our credential type.
So in the Tower dashboard we go to Credentials,
and we click on New Credentials,
we fill out the standard details such as name and the type of a credential type.
But for this, we're going to select Source Control.
Let us go back to the project, and I want to run an SCM update.
However, as you can see, we still have a failure.
The one thing I forgot to do is I forgot to connect
the credential type to the project.
So let me go back into the project and add the SCM
credentials that I've just created.
Now I can go back and click on update SCM.
As you can see, we have a green success.
And if we go further to get additional information,
and on the left‑hand side you will see the credential
type that we have just created.
Now for one final test,
if we just go back into the template and we do some basic settings,
you will see we now have full access to the playbooks
that are now on my private repository.