This repository automates the setup and configuration of Development, Testing, and Production environments using Ansible.
The goal is to standardize and simplify infrastructure provisioning and configuration from a single control node, ensuring consistency, repeatability, and scalability across all environments.
Before running any playbooks, ensure you have:
- A control node (Ubuntu, RHEL, Fedora, CentOS, etc.)
- Target nodes reachable via SSH
- Python 3.10+
- Ansible 2.15+
I have provided a script to install ansible with comments as instruction .
Verify Connection to Managed Nodes Ensure your inventory file (for example inventory/servers.ini) is correctly configured:
[devservers]
ipaddress, hostname, ssh_remote_user, ssh_passwd
[testservers]
ipaddress, hostname, ssh_remote_user, ssh_passwd
[prodservers]
ipaddress, hostname, ssh_remote_user, ssh_passwd
ansible all -m ping -i inventory/servers.ini
Expected output: ip_address | SUCCESS => { "changed": false, "ping": "pong" }
1οΈβ£ Clone the Repository bash git clone https://github.com/blessin-bester/Ansible-Automation-Collection.git
cd Ansible-Automation-Collection
2οΈβ£ Update Inventories with your setups and Ip_addresses and Variables Modify inventory/ and group_vars/ files to match your environment.
3οΈβ£ Run Playbooks Run the Development setup:
π Using Ansible Vault (Optional) If your environment includes sensitive data such as passwords, keys, or tokens, use Ansible Vault to encrypt them.
Create an encrypted variable file: bash ansible-vault create group_vars/prod.yml
Run a playbook using a vault password: bash ansible-playbook -i inventory/prod.ini playbooks/prod.yml --ask-vault-pass
This repository includes a GitHub Actions workflow under .github/workflows/ansible-ci.yml.
Lints playbooks and YAML files using ansible-lint, Molecule and yamllint
Runs automatically on every push or pull request
Ensures consistent and clean code across environments
Contributions are welcome! Please read CONTRIBUTING.md for contribution guidelines.
You can contribute by:
- Adding new roles
- Improving playbooks
Extending support to more OS or cloud environments
π License This project is licensed under the MIT License. See the LICENSE file for details.
π‘ Author Blessing Phiri DevOps / OpenShift / Platform Engineer π GitHub Profile