Skip to content

Instantly share code, notes, and snippets.

@sanguis
Created February 10, 2017 15:11
Show Gist options
  • Save sanguis/90b580794f70e008dc4cdfa3a0549e89 to your computer and use it in GitHub Desktop.
Save sanguis/90b580794f70e008dc4cdfa3a0549e89 to your computer and use it in GitHub Desktop.
ruby mixin loop
ruby_block "checkcontroler" do
block do
pass_codes = [200, 302, 000]
Chef::Mixin::Shellout.send(:include Mixin::Shellout::ShellOut)
retcode = "curl --insecure --silent --output /dev/null --write-out '%{http_code}' https://#{node.private_ip}"
until pass.include?(retcode.std_out) do
execute 'cfn-signal'
# TODO: get info on this
command "/opt/aws/bin/cfn-signal --success true ' - Ref: WaitHandle02"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment