Transform your one-liner Ansible tasks into beautiful, readable YAML format
🚀 Live Demo • 📖 Documentation • 🐳 Quick Start • 🤝 Contributing
Ansible Beautify is a web-based tool that transforms condensed, hard-to-read Ansible task syntax into clean, properly formatted YAML. Perfect for:
- 📚 Learning Ansible: Understand task structure better
- 🔧 Code Review: Make tasks more readable for your team
- 📝 Documentation: Generate clean examples for documentation
- 🎯 Best Practices: Follow Ansible YAML formatting standards
- name: Insert trololo
lineinfile: dest=/etc/trololo state=present regexp="{{ trololo }}" insertafter="trololo" line="trololo"
notify: restart trololo- name: Insert trololo
lineinfile:
dest: /etc/trololo
regexp: "{{ trololo }}"
insertafter: trololo
line: trololo
state: present
notify: restart trololo-
Clone the repository
git clone https://github.com/Courouge/ansible-beautify.git cd ansible-beautify -
Start the application
docker-compose up -d --force-recreate --build
-
Open your browser
http://localhost:3000
That's it! 🎉
Click to expand manual installation steps
cd backend
pip install -r requirements.txt
python api.pycd react-api
npm install
npm start- Input: Paste your one-liner Ansible tasks in the left panel
- Process: Click the "Process" button
- Output: Get beautifully formatted YAML in the right panel
- Copy: Use the formatted code in your playbooks
- ✅ All Ansible Modules Supported: Works with any Ansible module
- ✅ Custom Modules: Add your own modules via
modules.txt - ✅ Real-time Processing: Instant transformation
- ✅ Docker Ready: One-command deployment
- ✅ Responsive Design: Works on desktop and mobile
- ✅ Syntax Validation: Detects and reports syntax errors
- Frontend: React 16.9, Bootstrap 4, Axios
- Backend: Python Flask, Ansible Parser
- Infrastructure: Docker, Docker Compose
- CI/CD: Travis CI
ansible-beautify/
├── 🐳 docker-compose.yml # Docker orchestration
├── 📱 react-api/ # React frontend
│ ├── src/
│ ├── public/
│ └── package.json
├── 🐍 backend/ # Python Flask API
│ ├── api.py
│ ├── modules.txt # Supported Ansible modules
│ └── requirements.txt
└── 📚 docs/ # Documentation
We love contributions! Here's how you can help:
- 🍴 Fork the repository
- 🌿 Create a feature branch (
git checkout -b feature/amazing-feature) - 💾 Commit your changes (
git commit -m 'Add amazing feature') - 📤 Push to the branch (
git push origin feature/amazing-feature) - 🔄 Open a Pull Request
To add support for custom Ansible modules:
- Add module names to
backend/modules.txt - One module per line
- Submit a PR with your additions
- 🎨 Modern UI/UX redesign
- 🌙 Dark mode support
- 💾 Save/Load functionality
- 📥 Batch processing
- 🔗 API endpoints
- 🧪 Unit tests
- 📱 Mobile app
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with ❤️ for the Ansible community
- Inspired by the need for readable automation code
- Thanks to all contributors and users
⭐ Star this repository if you find it useful!
Made with ❤️ by Florian Courouge
