def render_runbooks(runbook, facts): ''' Render a runbook with given facts and return dictionary ''' template = Template(runbook) yml = template.render(facts=facts) return yaml.load(yml)