Created
July 12, 2016 19:08
-
-
Save jacoelho/bdbfc98a2d2e4e83631a954e5aec0ca5 to your computer and use it in GitHub Desktop.
custom resource alter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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