This project automates the installation of Grafana on specified servers using Ansible and allows for interactive configuration of server details through a Python script. Grafana is an open-source platform for monitoring and observability, enabling you to query, visualize, alert on, and understand your metrics. Requirements
Ansible
Python 3.x
Access to the target servers with SSH
- Clone the Repository
Clone this repository to your local machine to get started.
git clone https://github.com/gnubyte/grafana_loki
- Set Up Ansible
Ensure Ansible is installed on your machine. Refer to the Ansible Installation Guide for instructions. 3. Run the Python Script for Configuration
Navigate to the cloned directory and run the Python script to configure your target servers.
python generate_inventory.py
Follow the prompts to enter the IP addresses, usernames, and passwords of your Grafana servers. 4. Execute the Ansible Playbook
Run the Ansible playbook to install Grafana on the configured servers.
ansible-playbook -i inventory.ini grafana_install.yml
grafana_install.yml: Ansible playbook for installing Grafana.
generate_inventory.py: Python script for interactively generating an Ansible inventory file.
inventory.ini: An example inventory file generated by the script.
It's crucial to handle server credentials securely. Avoid storing plain text passwords in the inventory.ini file for production environments. Consider using Ansible Vault for encrypting sensitive data. Customization
You can modify the Ansible playbook to suit your specific Grafana configuration needs, such as setting up data sources, dashboards, or enabling additional security features. Support
For support, open an issue in the repository, or contact the maintainers at support@openmobo.com