This is the third time we're doing this now. It's a simple process: we define our
.gitlab-ci.yml file and then we come into the GitLab UI and we execute the pipeline.
We've written the
.gitlab-ci.yml file, so now let's put it to use:
- Navigate to the
http-cats/configuration/ansiblerepository in the GitLab console
- Use the menu on the left to go to
Run pipelinein the top right of the screen
Now Ansible is going to execute.
If you remember from when we defined our infrastructure using Terraform we defined a few DNS records in our Route53 DNS Zone. This meant we can hard code our Ansible inventory with DNS records and use those to target the remote hosts. This is how our Ansible pipeline can remain so simple and only require a single CI variable.
We already know how-to review the results of the pipeline at this point in time, so let's bring up the logs from our
playbook stage and see what's happening:
We can see the stage was successful and our application has been deployed.
At this point in time you've now deployed the application and it can be viewed in the web browser.
Let's finalise this section by triggering the CI pipeline with a change to a file.