How to install Ansible in Fedora 41
By Luca Berton · Published 2024-01-01 · Category: installation
Step-by-step guide to install Ansible on Fedora 41. Learn how to install, configure, and verify Ansible automation tool using dnf package manager on Fedora 41.

How to Install Ansible in Fedora 41
In this guide, I'll walk you through installing Ansible on Fedora 41 Linux. I'm Luca Berton, and I'll show you the step-by-step process using the dnf package manager.
See also: How to Run Linux Fedora Workstation 39 on an Apple Mac
Prerequisites
• Fedora 41 system (Workstation or Server) • SSH access or terminal • Root or sudo privileges • Internet connectionStep-by-Step Installation
Step 1: Connect via SSH
ssh devops@fedora41.yournetwork.com
Step 2: Become Root
sudo su -
Step 3: Update the System
dnf update -y
Step 4: Check Available Ansible Packages
dnf list ansible*
Expected output:
Available Packages
ansible-core.x86_64 2.17.x-1.fc41 updates
ansible-collection-*.noarch various fedora
Step 5: Install Ansible
dnf install ansible-core -y
Step 6: Verify Installation
ansible --version
Expected output:
ansible [core 2.17.x]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules']
ansible python module location = /usr/lib/python3.13/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.13.x
Step 7: Test Ansible
ansible localhost -m ping
Expected output:
localhost | SUCCESS => {
"changed": false,
"ping": "pong"
}
See also: How to install Ansible in Fedora 34 - Ansible install
Configuration and First Steps
Create Ansible Configuration
mkdir -p /etc/ansible
cat > /etc/ansible/ansible.cfg << 'EOF'
[defaults]
inventory = /etc/ansible/hosts
remote_user = devops
host_key_checking = False
[privilege_escalation]
become = True
become_method = sudo
become_user = root
become_ask_pass = False
EOF
Create Initial Inventory
cat > /etc/ansible/hosts << 'EOF'
[local]
localhost ansible_connection=local
[webservers]
# Add your web servers here
[databases]
# Add your database servers here
EOF
Install Additional Collections
ansible-galaxy collection install community.general
ansible-galaxy collection install ansible.posix
Install Full Ansible Package (Optional)
If you need the full Ansible package with all collections:
pip3 install ansible
See also: How to install Ansible in Fedora 35 - Ansible install
FAQ
What is the difference between ansible-core and ansible?
ansible-core includes the engine and builtin modules. The full ansible package adds many community collections. Start with ansible-core and add collections as needed.
Can I install Ansible via pip instead?
Yes:pip3 install ansible. The pip version is often newer than the dnf package.
Does Fedora 41 use Python 3.13?
Yes, Fedora 41 ships with Python 3.13. Ansible is fully compatible.Conclusion
You've successfully installed Ansible on Fedora 41. You're now ready to start automating your infrastructure.
For more installation guides and Ansible tutorials, visit AnsiblePilot.
Related Articles
• Ansible Galaxy authentication • the Ansible become reference • static and dynamic Ansible inventoryCategory: installation