Skip to content

Instantly share code, notes, and snippets.

@jacoelho
Created July 12, 2016 19:08
Show Gist options
  • Save jacoelho/bdbfc98a2d2e4e83631a954e5aec0ca5 to your computer and use it in GitHub Desktop.
Save jacoelho/bdbfc98a2d2e4e83631a954e5aec0ca5 to your computer and use it in GitHub Desktop.
custom resource alter
require "chef/log"
def alter!(directory, zookeeper, topic, partitions)
cmd = %W(
#{directory}/bin/kafka-topics.sh
--zookeeper #{zookeeper}
--alter
--topic #{topic}
--partitions #{partitions}
).join(" ")
result = shell_out(cmd)
Chef::Log.error(result.stderr) unless result.stdout =~ /Adding partitions succeeded!/
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment