Role to run containerized monitoring stack via standalone Docker containers.
Deploys the following:
- Prometheus
 - Alertmanager
 - Prometheus node-exporter
 - Grafana
 
!! WARNING: !! This role installs Python 3 and Docker SDK for Python packages to the target host(s) automatically!
N/A
See defaults/main.yml for the full variable list and their description
See meta dir
Clone this repo to your local role path or install via Ansible Galaxy
Create my_playbook.yml with the following contents:
- hosts: my-awesome-host
  roles:
    - role: monitoring_stack
      # Uncomment the key below to override role vars
      # vars:
      #   prometheus_version: v2.26.0And then run playbook - this will run node-exporter container on the awesome host:
ansible-playbook -v my_playbook.ymlContainer restart and/or re-creation can be forced by overriding role default vars. Example for the Prometheus:
ansible-playbook -v my_playbook.yml --extra-vars "prometheus_container_restart=true prometheus_container_recreate=true"Specific services deployment could be switched on/off using tags. For example to install only required packages and node_exporter run:
ansible-playbook --tags "packages,node_exporter" my_playbook.ymlScript test.sh activates Python virtualenv, installs all the required Python packages and executes linter.
More comprehensive functional tests could be executed like following:
source venv/bin/activate
molecule test