r/ansible • u/Busy-Examination1148 • 3d ago
GitHub actions
When developers need to kick off their GitHub actions are you using ansible for this?
18
Upvotes
r/ansible • u/Busy-Examination1148 • 3d ago
When developers need to kick off their GitHub actions are you using ansible for this?
2
u/Busy-Examination1148 3d ago
I appreciate all of this input.
16
u/N7Valor 3d ago
No. I don't know about developers, but I generally use Github Actions to run Ansible.
If I were an IT guy doing weird things, I might try to use Ansible to run Github Actions as you can generally use the "uri" module to poke at any random API.
But if I were a developer (I'm not), I would think it's easier or simpler to use raw Python requests to do that. Certainly if I were using an LLM to get Github Actions to run Ansible, the LLM would probably do exactly what I described (use a short Python script or pure "curl" to interact with the GHA API).
11
u/onbiver9871 3d ago
…. no?
I mean, you could, sure. I’d be curious what Ansible or GHA use pattern would drive an interaction like that, though.
7
u/Rain-And-Coffee 3d ago
Our actions are kicked off by events, ex: a pull request, a merge to main, or a manual trigger.
We have a completely different system than runs ansible for us using a daily schedule. But it can also be triggered manually as well.
5
u/phxees 3d ago
Seems odd, but I wouldn’t avoid it if there was a good reason. Just make sure you aren’t using Ansible as a hammer to drive in a screw.
3
u/Mrh1d3z 3d ago
Not GitHub but Gitlab. In GitLab I trigger CD pipelines with dokerized Ansible on the workers to test or deploy on the infra stages https://www.alessioligabue.it/en/portfolio/devops-pipeline-gitlab-cicd-ansible-molecule
2
u/Kaussaq 3d ago
Github actions are just scripts you can do whatever you want as part of that. If you have a git runner you could have that trigger an ansible job via API I would say
2
u/tibmeister 3d ago
Typically no, there’s a number of other triggers like on push and cron for that.
1
u/kevdogger 3d ago
I'm still trying to figure out exactly what and how to use github actions honestly. Somewhere in the mix I'm using renovate, github actions and arcane to keep my containers up to date...I'm usually using the base image latest version but usually I upgrade all the base packages via docker build files to reduce some of the compromised packages that seem to get reported regularly.
1
u/Zolty 3d ago
Ansible is for managing configs for the iaas layer
1
u/knowone1313 2d ago
I don't think developers are kicking off GitHub actions from ansible. Probably just using a schedule inside GitHub...