Skip to content

Instantly share code, notes, and snippets.

@sanguis

sanguis/loop.rb Secret

Last active December 21, 2015 00:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sanguis/bde89eb3405f6307faad to your computer and use it in GitHub Desktop.
Save sanguis/bde89eb3405f6307faad to your computer and use it in GitHub Desktop.
{
:blocks=>{
"listen-HAProxyLocalStats"=>{
"type"=>"listen",
"name"=>"HAProxyLocalStats",
"attributes"=>[
"bind 127.0.0.1:2200 name localstats", "mode http", "stats enable", "stats refresh 5", "stats admin if TRUE", "stats uri /"
]
},
"frontend-goog-fr"=>{
"type"=>"frontend",
"name"=>"goog-fr",
"attributes"=>[
"bind *:80 name 80", "mode http", "option http-keep-alive", "default_backend google"
]
},
"backend-google"=>{
"type"=>"backend",
"name"=>"google",
"attributes"=>[
"mode http", "option httpchk GET /", "http-request set-header Host www.google.com", "server google-srv google.com:443 ssl check inter 10000 verify none"
]
}
}
}
blocks.each |block|
# How do I print
puts block[]["type"]
puts block[]["name"]
block[]['attributes'].each |attr|
puts attr
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment