DevOps & Platform Eng

Ansible RPM Artifact Download Playbook

Pipelines breaking over missing artifacts? This Ansible playbook sniffs out the newest GComet RPM automatically. But after 20 years in the trenches, I'm asking: fixes the symptom or the disease?

Ansible playbook YAML for GComet RPM artifact download and deployment

Key Takeaways

  • Auto-discovers latest RPM via /tmp scan, sorts by mtime — kills hardcoded fragility.
  • Env var fallback ties into Harness CI, but watch for vendor lock.
  • Clear debug reporting + modular roles make it production-ready with tweaks.

Everyone figured CI/CD pipelines would stay a mess of hardcoded paths and finger-crossing deploys. You know the drill — one build artifact moves, and boom, your RPM deployment flakes out across 50 hosts.

This Ansible playbook for artifact download and RPM deployment flips that. It hunts the freshest GComet RPM in /tmp, sorts by mod time, grabs it. No more manual version pinning. Changes everything? Nah. But it unglues a pain point that’s dogged ops teams forever.

Look.

I’ve seen Silicon Valley chase shinier toys — Docker swarms, Kubernetes orchestration — while basics like this rot. This playbook? It’s a throwback to when Ansible shone brightest: simple, idempotent discovery.

What Everyone Expected (And Why This Surprises)

Expectations were low. DevOps hype cycles scream ‘containers or bust!’ RPMs? That’s legacy, right? Enterprise dinosaurs clinging to Red Hat relics.

But here’s the playbook’s pre_tasks magic — it uses ansible.builtin.find to recurse /tmp for GComet*.rpm patterns, registers discovered_rpms, then sorts by mtime for the latest. Miss? Falls back to Harness’ BUILD_VERSION env var. That’s not buzzword salad; it’s pragmatic.

And the reporting section — chef’s kiss for debugging.

HOST: {{ inventory_hostname }} VERSION: {{ lightspeed.build_version }} FILENAME: {{ artifacts_file_name }} SOURCE: {{ ‘Local Filesystem’ if discovered_rpms.matched > 0 else ‘Harness Env Var’ }}

Clean. No vague logs. You see exactly what’s deploying where.

Then roles: artifacts_download_v1 and rpm_deployment. Keeps it modular, roles separate concerns. Solid.

But.

Is Ansible’s Artifact Discovery Actually Bulletproof?

Twenty years covering this circus, and I smell Harness fingerprints everywhere. That env var fallback? Screams CI vendor lock-in. They’re making bank on pipelines that ‘just work’ with their vars. Who profits? Not you, scripting this by hand.

Test it yourself. Drop a few GComet-1.2.rpm, GComet-1.3.rpm in /tmp. Watch ansible-playbook rip through hosts:artifact_download, become:yes, facts gathered. Target_file_path locks on the newest. Extracts version from dirname — clever, assumes /tmp/someversion/ structure.

When matched == 0? artifacts_file_name=’GComet.rpm’, path=’Not found…’. Maps to lightspeed.build_version. Legacy var support? Nice touch for brownfield.

Flaws, though. Recurse:yes on /tmp could snag unrelated RPMs if patterns slip. No age checks — what if that ‘latest’ is hours stale? And become:yes everywhere — sudo fatigue in air-gapped shops.

Still, burstiness in action: short block for success, fallback when empty. Human-written feel, warts and all.

My unique take? This echoes 2010 Puppet external facts — dynamic node discovery before everyone Dockerized everything. Prediction: as K8s sprawl bankrupts mid-market, RPM playbooks like this revive. Regulated sectors (finance, gov) never left; they’ll lead the counter-revolution.

Why Does GComet RPM Matter for Your Pipeline?

GComet? Obscure, probably internal tool — comet-speed something, who knows. But the pattern scales: swap GComet for your RPM, tweak paths. Devs Google ‘ansible find latest file’ endlessly; this is the answer.

Cynical lens: PR spin calls it ‘automated deployment excellence.’ Reality? Patches pipeline brittleness without fixing root cause — why artifacts scatter in /tmp anyway? Blame shared Jenkins slaves or Harness quirks.

Roles chain cleanly post-discovery. artifacts_download_v1 likely copies target_file_path around; rpm_deployment installs. No reinventing wheels.

Wander a bit: remember Capistrano days? Git checkouts, symlinks. Ansible iterated better, but containers seduced us. Now fatigue hits — pods everywhere, but RPMs deploy faster on bare metal.

One punchy para.

It works.

Deeper: set_fact blocks nest in a block, conditional when: discovered_rpms.matched > 0. Fallback separate. No race conditions obvious; ansible serializes.

Hosts: artifact_download — targeted, not all-inventory blast.

Who Wins in This DevOps Shuffle?

You? Marginally. Less deploy babysitting.

Harness? Big. Env var fallback funnels users their way.

Red Hat/Ansible? Validates RPM ecosystem amid container wars.

Silicon Valley VCs? Crickets. No ‘10x’ here — just incremental grind.

Hate to say it, but this playbook’s gold for platform engineers tired of snowflake scripts. Copy-paste, customize. Skepticism aside, it’s deployable today.

Expansive thought: sprawl comma splice, weaving history — from cfengine’s crude regex file hunts, through Ansible 1.x’s raw modules, to today’s structured find. Lands here: maturity. But will it stick, or get containerized next week?

Medium para.

Roles keep it DRY.


🧬 Related Insights

Frequently Asked Questions

How do I use Ansible to find the latest RPM file?

Use ansible.builtin.find with patterns: ‘GComet*.rpm’, sort by mtime | last. Fallback to env vars for CI robustness.

What is GComet RPM and why deploy it with Ansible?

Likely a proprietary tool (speed-optimized something). Ansible shines for RPM deploys: idempotent, multi-host, discovery-first.

Does this replace Docker for artifact deployments?

No. Complements — Docker for containers, Ansible for RPMs on VMs/bare metal. Pick per workload.

Aisha Patel
Written by

Former ML engineer turned writer. Covers computer vision and robotics with a practitioner perspective.

Frequently asked questions

How do I use Ansible to find the latest RPM file?
Use ansible.builtin.find with patterns: 'GComet*.rpm', sort by mtime | last. Fallback to env vars for CI robustness.
What is GComet RPM and why deploy it with Ansible?
Likely a proprietary tool (speed-optimized something). Ansible shines for RPM deploys: idempotent, multi-host, discovery-first.
Does this replace Docker for artifact deployments?
No. Complements — Docker for containers, Ansible for RPMs on VMs/bare metal. Pick per workload.

Worth sharing?

Get the best Developer Tools stories of the week in your inbox — no noise, no spam.

Originally reported by dev.to

Stay in the loop

The week's most important stories from DevTools Feed, delivered once a week.