Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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