Skip to content

Instantly share code, notes, and snippets.

View 3hedgehogs's full-sized avatar

Serguei P. 3hedgehogs

  • München. Germany
View GitHub Profile
@3hedgehogs
3hedgehogs / ansible-runner-with-module.py
Created May 17, 2022 16:10
Runn ansible module from python script and print cache
#!/usr/bin/env python
import io
import os
import json
import sys
import ansible_runner
def finished_callback(runner):
import os
import json
import tempfile
import subprocess
import ansible_runner
def run():
# create an Ansible playbook as a native Python dict object. Currently