Last active
January 13, 2019 13:53
-
-
Save mpdehaan/c0d8f3381a729a4b04c711f92ab3e856 to your computer and use it in GitHub Desktop.
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
# BEFORE | |
class FooRole(Role): | |
def set_variables(self): | |
return dict( | |
x=5 | |
) | |
def set_resources(self): | |
return Resources( | |
File(name="/etc/blorp.cfg", from_template="./blorp.cfg.j2", ..., notifies="restart_blorp") | |
) | |
def set_handlers(self): | |
return Handlers( | |
restart_blorp = Service(name="blorp", restarted=True) | |
) | |
# AFTER | |
class FooRole(Role): | |
def main(self): | |
x = 5 | |
blorp_result = File(name="/etc/blorp.cfg", from_template="./blorp.cfg.j2") | |
if blorp_result.changed(): | |
Service(name="blorp", restarted=True) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment