Created
July 12, 2016 19:05
-
-
Save jacoelho/35d9c2e91f4771e7f760d5cd1721c926 to your computer and use it in GitHub Desktop.
custom resource create improved
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
| action :create do | |
| # calls the block if current_resource does not exist | |
| # or values are different from current_resource | |
| converge_if_changed do | |
| if current_resource | |
| action_update | |
| else | |
| converge_by "Create topic #{new_resource.topic}" do | |
| create! new_resource.directory, | |
| new_resource.zookeeper, | |
| new_resource.topic, | |
| new_resource.partitions, | |
| new_resource.replicas | |
| end | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment