class Caco::Prometheus::InstallAlertManager

Public Instance Methods

build_url(ctx, version:, root:, **) click to toggle source
# File lib/caco/prometheus/install_alert_manager.rb, line 9
def build_url(ctx, version:, root:, **)
  ctx[:url] = "https://github.com/prometheus/alertmanager/releases/download/v#{version}/alertmanager-#{version}.linux-amd64.tar.gz"
  ctx[:dest] = "#{root}/alertmanager-#{version}.linux-amd64.tar.gz"
  ctx[:current_target] = "#{root}/alertmanager-#{version}.linux-amd64"
  ctx[:current_link] = "#{root}/alertmanager-current"
  ctx[:config_file_path] = "#{Settings.prometheus.config_root}/alertmanager.yml"
  ctx[:alerts_file_path] = "#{Settings.prometheus.config_root}/alerts.d/alerts.rules"
end
check_root(ctx, **) click to toggle source
# File lib/caco/prometheus/install_alert_manager.rb, line 3
def check_root(ctx, **)
  ctx[:root] = Settings.prometheus.root
  FileUtils.mkdir_p(Settings.prometheus.root)
end