Webhook Between Ansible Controller & GitLab

In this article, we learn how to create a webhook in GitLab Repo to integrate it with Ansible Automation Platform.
Below are the steps involved


 

Create Gitlab Access Token:

You have to go to your GitLab project. You need to go to Settings → Access Token. Based on your requirement you need to select options and create an access token. once created you will see a token display on the GitLab page. Please save the token because you cannot edit the token. You can only delete tokens.


Create a new credential in AAP:

Next, we will use this token to create a new credential in Ansible Tower of type “GitLab Personal Access Token”. Please paste the saved token in the token field.

Upon saving, the Ansible controller now has API access to my GitLab account. 

JobTemplate:

When you are running a job template you need to check the webhook check in the job



Try Push coding using git push and Now you will see an ansible automation controller running the job.

meenakande

Hey there! I’m a proud mom to a wonderful son, a coffee enthusiast ☕, and a cheerful techie who loves turning complex ideas into practical solutions. With 14 years in IT infrastructure, I specialize in VMware, Veeam, Cohesity, NetApp, VAST Data, Dell EMC, Linux, and Windows. I’m also passionate about automation using Ansible, Bash, and PowerShell. At Trendinfra, I write about the infrastructure behind AI — exploring what it really takes to support modern AI use cases. I believe in keeping things simple, useful, and just a little fun along the way

Leave a Reply

Your email address will not be published. Required fields are marked *