Sanitize node configs via script, and do it automatically in a Git hook #633

Closed
raucao wants to merge 24 commits from dev/sanitize_nodes into feature/prometheus_cookbook
Showing only changes of commit 08f0ba667f - Show all commits
@@ -67,8 +67,14 @@ node_targets = search(:node, "role:base").map { |n| n["knife_zero"]["host"] }
.sort_by { |ip| ip.split(".").map(&:to_i) } .sort_by { |ip| ip.split(".").map(&:to_i) }
.map { |ip| "#{ip}:9100" } .map { |ip| "#{ip}:9100" }
garage_targets = search(:node, "role:garage_node").map { |n| n["knife_zero"]["host"] }
.compact
.sort_by { |ip| ip.split(".").map(&:to_i) }
.map { |ip| "#{ip}:3903" }
jobs = node["kosmos_prometheus"]["jobs"].merge( jobs = node["kosmos_prometheus"]["jobs"].merge(
"node" => { "targets" => node_targets } "node" => { "targets" => node_targets },
"garage" => { "targets" => garage_targets }
) )
template "/etc/prometheus/prometheus.yml" do template "/etc/prometheus/prometheus.yml" do