I am a big fan of Ansible, as a good / lazy engineer, I love making everything automatic!
Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. Basically, you declare applications such as Helm release in a git repository, then argoCD will transform this as K8S object, pretty cool (and good for lazy people ^^).
In this story, I am going to show some recipes I use to interact with argocd API, from ansible. Using the ansible URI module https://docs.ansible.com/ansible/latest/collections/ansible/builtin/uri_module.html, actually a very powerful module!
argoCD API doc ==> https://github.com/argoproj/argo-cd/blob/master/assets/swagger.json
The Ansible tasks
- argocd_url => the URL to argoCD
- argocd_project => the argoCD project to filter with
- ARGO_TOKEN => env variable , the JWT token to use
This recipe is very useful to get all applications status, and click on application URL to see whats going on:
This recipe, to sync multiple applications and wait for result. For this one, we are going to use an ansible feature I love : “async”.
Asynchronous actions and polling - Ansible Documentation
By default Ansible runs tasks synchronously, holding the connection to the remote node open until the action is…
To run multiple task in //