Some AWX CLI docker images are already available on Docker Hub, but I have decided to create my own, since I needed the most recent version (that contained the exit code enhancement). Use or create a Docker container that has installed the AWX CLI.Make sure you have a job template in AWX that runs successfully. This is a very useful feature to combine with a Gitlab CI pipeline. Its “–monitor” flag allows the command to return error exit codes (as described in this Github issue). Last month a new enhancement was added to the AWX CLI command that runs job templates. Since going the curl way would definitely involve a small wrapper script to get the pipeline to fail if the AWX job fails, I have decided to try my luck with the AWX CLI tool. Use curl command and call the endpoint representing the deployment job.There are two ways to trigger the deployment job in AWX: The tricky part was getting the pipeline to fail if the playbook would end up with a failure. Since we now have a way to trigger this job through the REST API of AWX, we decided to include the deployment as well as a last step in our automated Gitlab CI pipelines. Afterwards we would go ahead and run the deployment playbook manually that would download the artifact from the local repository to the correct location, and start the service. The last step in the pipeline would be to publish the build artifact to our local Maven repository. So far we have not been deploying artifacts automatically as part of our automated pipelines (Gitlab CI). Among the tasks to automate there is also the question of automatic deployments. In an attempt to automate some processes, they have installed an instance of AWX (open source version of Tower) and now we’re playing around with all sorts of job/work templates and trying to come up with some preferred set of guidelines. They have been using Ansible for a while, but mostly they would run the playbooks manually. My organization is keen on adopting Ansible AWX. Earlier this week I stumbled on a small problem.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |