Skip to content

Instantly share code, notes, and snippets.

@isaqueprofeta
Created June 27, 2024 16:21
Show Gist options
  • Save isaqueprofeta/cffe96efd2b8c2912693661f02c69bf0 to your computer and use it in GitHub Desktop.
Save isaqueprofeta/cffe96efd2b8c2912693661f02c69bf0 to your computer and use it in GitHub Desktop.
Grafana on Debian 12
Vagrant.configure("2") do |config|
config.vm.define "laboratorio" do |laboratorio|
# ======= OPCOES DO VIRTUALBOX =======
# VM BASE DO DEBIAN
laboratorio.vm.box = "debian/bookworm64"
# HOSTNAME DA VM
laboratorio.vm.hostname = "grafana-debian"
# REDE DA VM
laboratorio.vm.network "private_network", ip: "10.0.0.1", virtualbox__intnet: "vboxnet0"
laboratorio.vm.network "forwarded_port", guest: 3000, host: 3000, host_ip: "127.0.0.1"
# ======= PROVISIONAMENTO DO SISTEMA =======
laboratorio.vm.provision "shell", inline: <<-SHELL
# SEGUINDO A FONTE https://grafana.com/docs/grafana/latest/setup-grafana/installation/debian/
# ATUALIZACAO DE PACOTES
apt update
apt install -y apt-transport-https software-properties-common wget
# INSTALAÇÃO DE PRE-REQUISITOS
mkdir -p /etc/apt/keyrings/
wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
# INSTALACAO DO GRAFANA
apt update
apt install -y grafana
# HABILITANDO O SERVICO DO GRAFANA
sudo systemctl daemon-reload
systemctl enable --now grafana-server
SHELL
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment