r/ansible • u/Busy-Examination1148 • 6d ago
GitHub actions
When developers need to kick off their GitHub actions are you using ansible for this?
16
u/N7Valor 6d 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 6d ago
…. no?
I mean, you could, sure. I’d be curious what Ansible or GHA use pattern would drive an interaction like that, though.
4
u/slayem26 6d ago
True. I never came across a use case where I had to trigger an action using ansible.
7
u/Rain-And-Coffee 6d 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.
1
u/meangreenandunzeen 6d ago
What is the other system? I'm only familiar with CI/CD to automate this kind of thing.
1
u/Rain-And-Coffee 6d ago
AWX, it's a UI to kick off Ansible jobs.
https://www.redhat.com/en/technologies/management/ansibleWere moving towards Semaphore soon
https://semaphore.io
5
u/phxees 6d 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.
1
u/onbiver9871 6d ago
This :) like, pragmatism over dogmatism, right? If there’s a solid reason to do this, by all means go for it. Stable, pre-existing, legacy enterprise often has you doing things that on paper are a bit wonky but in reality are the best thing to do for reasons that aren’t purely technical.
The trick, as you say, is knowing when that’s true vs when you’re just doing things because the toolset will technically let you.
3
u/Mrh1d3z 6d 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/tibmeister 6d ago
Typically no, there’s a number of other triggers like on push and cron for that.
1
u/kevdogger 6d 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/knowone1313 5d ago
I don't think developers are kicking off GitHub actions from ansible. Probably just using a schedule inside GitHub...
2
u/Busy-Examination1148 6d ago
I appreciate all of this input.