You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/library/ohai

13 lines
317 B
Plaintext

#!/usr/bin/python
# requires 'ohai' to be installed
import json
import subprocess
cmd = subprocess.Popen("/usr/bin/ohai", stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = cmd.communicate()
# try to cleanup the JSON, for some reason facter --json doesn't need this hack
print json.dumps(json.loads(out))