r/ansible • • May 15 '26

windows My experience learning Ansible with Claude and need suggestions going fwd!

0 Upvotes

Hi, I am a network engineer and new to Ansible.

I installed WSL 2 on Windows and tried some things. What happened is I soon ran into a lot of issues, like some Python issues and then some Azure environment issues, because I was trying to integrate secrets management with Azure Key Vault. I am not sure if AI is teaching me good practices.

The next thing I am trying to get set up is Semaphore because I think that's one of the ways to actually learn production practices.

I am just putting my workflow here, what I did so far, but I want to know if this is a good idea or maybe I'm going down a wrong path and learning bad practices.

  • Verified Ansible was installed via apt on Ubuntu WSL2 — no /etc/ansible/ created, used project-based ansible.cfg in ~/ansible/ instead

  • Reinstalled Az CLI natively in WSL (was running Windows Az CLI via PATH passthrough) and authenticated with az login --use-device-code

  • Created Service Principal sp-ansible-akmlabs in Entra ID, assigned Key Vault Secrets Officer role on the vault, stored credentials in ~/ansible/.env

  • Created Azure Key Vault akmlab-az-kv in portal with RBAC mode enabled, stored a test secret via Az CLI

  • Created Python venv, installed azure.azcollection requirements plus hidden dependencies, installed ansible-core inside the venv so Ansible runs from venv Python

  • Wrote and tested playbook that authenticates as the SP and pulls the secret from Key Vault — confirmed hello-from-akmlabs returned successfully

Then ran into some crazy python issues which took 3 hrs to troubleshoot!

  • No /etc/ansible/ — modern apt install doesn't create it; used project-based ansible.cfg in ~/ansible/ instead

  • Az CLI using Windows Python — WSL was calling the Windows Az CLI via PATH passthrough; fixed by installing Az CLI natively in WSL via the Microsoft install script

  • Wrong collection module name (claude got these wrong) — used azure_keyvault_secret_info which doesn't exist; correct name is azure_rm_keyvaultsecret_info, found by listing the modules directory

  • Ubuntu blocked pip — PEP 668 prevents pip from modifying system Python; fixed by creating a venv and installing all packages there

  • Missing hidden dependencies — requirements.txt from the collection is incomplete; had to manually install msrestazure and others not listed (known upstream issue GitHub #1463) - This then took 3 hrs lol!

  • Venv packages being ignored — interpreter_python in ansible.cfg controls target host Python, not Ansible's own process; fixed by installing ansible-core inside the venv so Ansible itself runs from venv Python

  • Wrong env var names — azure.azcollection uses AZURE_SECRET and AZURE_TENANT, not AZURE_CLIENT_SECRET and AZURE_TENANT_ID; silent auth failure until corrected

  • Wrong secret field name — output dict uses .secret not .value; dumped raw output with var: kv_output to find the correct field name.

Feeling like all this was a waste of time and I did not learn anything that is done in a real production environment. If somebody can make a quick list of things that I could look into and actually learn something, it would be nice. Overall I think it's still fine. I did something I guess.


r/ansible • • Jul 07 '26

Automate Windows Certificate Rotation with Ansible + AI

Thumbnail
youtu.be
5 Upvotes

We've all had certificates expire at the worst possible time.

Aubrey put together a demo showing how you can use Ansible Automation Platform + AI to automate Windows IIS certificate rotation from end to end.

Instead of blindly replacing certificates, the workflow has an LLM evaluate the current situation before taking action. Depending on the context it can:

  • ✅ Rotate the certificate immediately

  • 📅 Defer the change until the next maintenance window

  • 🚨 Escalate to ServiceNow if a change freeze or other business constraint makes automation unsafe

The workflow starts with Event-Driven Ansible detecting an expiring certificate, performs AI-assisted risk analysis, executes the remediation over WinRM when appropriate, updates IIS bindings, removes the old certificate, and automatically closes the ServiceNow ticket with verification results.

It's a good example of using AI as a decision-making layer rather than having AI perform the automation itself.


r/ansible • • May 16 '24

Lazy Gen-Z Patching Systems with ansible

0 Upvotes

Here's a cool one-liner for you:

ansible all -i inventory -m command -a "yum update -y && reboot" -f 600

Thank you ansible


r/ansible • • Mar 03 '26

Stop Encrypting Entire Files with Ansible Vault. Use Vault Strings Instead.

Thumbnail ltscommerce.dev
5 Upvotes

controversial point of view or just common sense?

----------------
edit - so definitely controversial lol

sops seems like the thing that is suggested as better than either flavour of ansible vault maybe? https://github.com/getsops/sops


r/ansible • • Mar 26 '26

Has anyone seen if this affects Ansible in any way? #litellm

Thumbnail
youtu.be
0 Upvotes

I want to preface this by stating I haven't done any research at all in regards to whether or not it's affected the ansible community, but I assume some other people have. so I'm prematurely asking if anyone knows if this liteLLM issue has affected. ansible in any way and if these packages are used and ansible core at all?


r/ansible • • Feb 15 '23

linux ansible is a huge pain in the ass

2 Upvotes

When reusing lists of tasks/plays i cannot figure out when to use import_playbook, include_playbook, include_tasks, import_tasks. For insane reasons, some cannot work with "notify" others cant include tasks with vars, some do not work with dynamic vars. Its hell! Its not like a well designed programming language. Its crap. There should be a single include keyword. And it should behave like a single task. Therefore accepting notify and dynamic vars. I hate ansible for beeing so unbelievable complex and unlogical about variables. DRY Principle seems to bei ansibles toughest enemy.


r/ansible • • Nov 28 '24

playbooks, roles and collections How to Reverse Engineer an Ansible Playbook

4 Upvotes

Good morning,

I came across a project on GitHub that closely resembles what I wanted to implement in my environment—a PostgreSQL cluster. The project in question is postgresql-cluster.org, and their GitHub repository provides an Ansible playbook that automates the entire installation and configuration process for the cluster.

However, I’d like to explore the step-by-step process to learn more about the applications involved and to gain a deeper understanding of the setup, especially for when I need to perform maintenance in the future.

So, my question is: is there any way to perform automated reverse engineering? In other words, is there a tool or method that can take the playbook and its structure and export it into some format that provides the detailed step-by-step process and commands used for the entire setup?

P.S.: I think Ansible's debug mode might achieve this... Would that be the right approach?

P.S. 2: I was also considering running the playbook, watching the tasks, and manually reading through each one, haha. Is there a faster way?


r/ansible • • Jun 05 '20

Ansible team closing and locking valid bugs...

0 Upvotes

It came to my attention that too much effort was put into closing and locking**!?** bugs on the Ansible issue tracker, even if these bugs are valid, reproduce with latest stable release. Does this send the right message to the user community?

Lets look at one example: https://github.com/ansible/ansible/issues/69172 --- closed only two days after it was open even if Ansible itself is exposing annoying runtime warnings from inside an ancient netaddr package module (which is used by ansible core functionality). That library had last release more than 3 years ago and its maintainer declared on the issue tracker that he does not want to continue updating it, mainly because newer versions of python have right stuff in stdlib.

I do know that Ansible team supports needs to support a huge range of ansible versions, including even stuff like the py26, so they would not be able to just fully drop netaddr. Still, I did not see any ansible core engaging with the author and trying to persuade them to address the issue.

So far, all I seen is a blazing fast bug closing and locking. Since when the bugs in components are outsourced to /dev/null?

My take on this is that if you want to use Ansible 2.9.x with python3.8, you may better get used to seeing lots of lines like below, even repeated across multiple tasks.

```

lib/python3.8/site-packages/netaddr/strategy/__init__.py:189: SyntaxWarning: "is not" with a literal. Did you mean "!="?

```


r/ansible • • Sep 22 '26

Ansible dans un parc hétérogène

2 Upvotes

Bonjour,

J'ai pour mission d'implémenter Ansible pour le renouvellement des certificats dans mon entreprise.

J'ai donc choisi de faire porter le protocole ACME par Ansible (community.crypto.acme) et les clés privées restent sur les nœuds gérés.

Ma question est la suivante : si on a quatre environnements différents, puis-je créer deux serveurs Ansible, un pour la production et l'autre pour la non-production, pour segmenter les accès et empêcher qu'un seul serveur Ansible ait accès à tout le parc ?

Je ne vais pas utiliser AWX/AAP pour le moment.

Je débute avec ces outils, j'aimerais donc connaître les bonnes pratiques.

De plus, j'aurais aimé savoir si l'architecture que j'ai choisie est la bonne. Nous avons environ 900 hôtes.

À terme, nous aimerions ajouter d'autres automatisations à Ansible.


r/ansible • • Apr 20 '26

How to Connect VS Code to a Remote Ansible Server Step by Step

Thumbnail
youtube.com
2 Upvotes

I put together a quick walkthrough on how I connect VS Code to a remote Ansible server using Remote SSH.

This setup has made it much easier for me to manage playbooks, edit files, and work directly on the server without constantly switching contexts.

Curious how others are doing this — are you using VS Code Remote SSH, or sticking with terminal-based workflows?

Happy to hear any tips or better approaches.


r/ansible • • Sep 28 '20

RANT: wtf communities: community.general.nsupdate

2 Upvotes

are you fucking kidding me? so when im searching for a module nowadays a simple "module: nsupdate" is now called "community.general.nsupdate" and i need to install it first via ansible-galaxy?

wtf is this shit? i don't want to install and call every module with some cryptic names. the documentation suddenly refuses to show me the old module documentation and i need to update and migrate every single role i created in the last 2 years? who the fuck thought this is a good idea?

if ansible creates more work then it helps to avoid, im happily migrating my roles back to good old bash scripts that get run via gitlab-runner.

lol: https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.10.html i have better things to do with my time


r/ansible • • Feb 05 '26

developer tools Open sourced an AI that helps debug production incidents

Thumbnail
github.com
0 Upvotes

Built an AI that investigates when things break. Checks logs, metrics, recent changes, and posts findings in Slack.

Posting here because config changes are often the culprit. The AI can correlate incidents with recent automation runs - if something broke after a playbook ran, it'll flag that.

It reads your configs and codebase on setup to understand how your systems are wired. So when an alert fires it knows what to check.

GitHub: github.com/incidentfox/incidentfox

Would love to hear people's thoughts!


r/ansible • • Feb 07 '18

Ansible vs. Terraform

Thumbnail
linuxacademy.com
0 Upvotes

r/ansible • • Apr 30 '23

Ansible Linux Docker just accepted in Awesome Docker repository

Thumbnail
github.com
2 Upvotes

This Docker image allows to run Ansible from a Linux container. It supports Linux, Windows and MacOS target hosts.


r/ansible • • Jul 07 '21

Ansible Research Participation

3 Upvotes

Hi, everybody!

Red Hat User Experience Design (UXD) is on a mission to deliver quality user experiences inspired by and tailored to you — and for that, we need your input on the Ansible Automation Platform.

Ansible users of all technical backgrounds are invited to fill out a quick screener survey to join our user testing database. By answering some questions about yourself and your experience with Ansible in just a few minutes, we’ll be able to match you with applicable research study opportunities in the future. Any information you submit will be held privately within the Red Hat UXD team and will only be used for research purposes.

Join us in our effort to elevate Red Hat Ansible user experiences the open source way — fill out this screener survey to get started.

To learn more about Red Hat UXD and Ansible, check out our team website and Ansible home page.

We look forward to hearing from you!

Thanks,

Alexandra


r/ansible • • Feb 12 '25

I started a devops youtube channel and would love your feedback

Thumbnail
youtube.com
1 Upvotes

r/ansible • • Mar 27 '26

How can I use credentials in the Ansible Automation Platform (AAP) UI to prevent having to manually share SSH keys from the control node to all managed hosts?

1 Upvotes

Dear Team,

I am having trouble configuring credentials in the controller UI. I want to assign specific credentials to individual templates so they can run against their respective hosts.

Specifically, I want to avoid manually sharing or copying the SSH key from the controller to every host. Could someone provide a step-by-step guide on the best way to set this up?

Thanks in advance for your help!


r/ansible • • Jul 01 '24

No credit card. No problem: Setting Up Ansible Lightspeed with IBM watsonX Code Assistant free trial

Thumbnail
youtu.be
0 Upvotes

r/ansible • • Apr 12 '20

Install mysql on Debian 10

0 Upvotes

Hello,

I'm desperately trying to install mysql on my debian 10 vm with ansible. I know that mysql can't be installed through apt therefore I tried with the following task as advised by the oracle. But it still don't get why this won't work:

- name: Install mysql .deb package from mysql official website
  apt:
    deb: https://dev.mysql.com/get/mysql-apt-config_0.8.15-1_all.deb

- name: Install mysql-server
  apt:
    name: mysql-server

And I get the following error:

TASK [mysql : Install mysql .deb package from mysql official website.] ********************************************************
ok: [192.168.1.1]

TASK [mysql : Install mysql-server] **************************************************************************************************
fatal: [192.168.1.1]: FAILED! => {"changed": false, "msg": "No package matching 'mysql' is available"}

Thanks in advance

Edit: Thank you everyone for your help. I'll just use MariaDB, Mysql is just a pain to install on Debian buster anyway


r/ansible • • Sep 21 '23

A New Galaxy very very close.....

0 Upvotes

We hope to make more announcements next week, the big date is set.


r/ansible • • Jul 24 '18

Ansible Training - Configuring a Login Banner

Thumbnail
youtube.com
2 Upvotes

r/ansible • • Apr 02 '24

Migrate your VMs to Red Hat OpenShift Virtualization and Ansible Automation Platform

16 Upvotes

r/ansible • • Jun 23 '25

playbooks, roles and collections Stunned newbie

0 Upvotes

I just got started on Ansible a few days ago and I'm trying to get a server onboarding script to work. I'm already getting quite frustrated about it and thinking that it may be easier to program my own stuff.

I've been stunned by how difficult it is to find all the pieces that I need that works on just one version of Ansible. One piece won't work in newer versions, another piece won't work in an older version. The management of variables is very difficult. Obscure precedence rules. A lot of silent failures even with -vvv tag. Small changes in the inventory can trip up the scripts.

I get the sense that this is a dance of very delicate balances, in a sort of esoteric world and will only get more complex when I get beyond the onboarding script.

Does this seem familiar to anybody here?


2025-06-24

I had a major breakthrough today. I developed my own administrative procedure that I use with Visual Studio, KiloCode and DeepSeek, to almost fully automate administration and documentation. It's butter smooth and absolutely a perfect match for my purpose.


r/ansible • • Jul 11 '21

How to Disable or Enforcing Selinux through Ansible and Reboot Host

Thumbnail
techtransit.org
5 Upvotes