mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-22 03:53:59 -07:00
Added an 'ohai' module. Some weird JSON hackage to get it to work.
This commit is contained in:
parent
c8fe53c4b9
commit
f17c4ca4b2
2 changed files with 13 additions and 0 deletions
12
library/ohai
Normal file
12
library/ohai
Normal file
|
@ -0,0 +1,12 @@
|
|||
#!/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))
|
Loading…
Add table
Add a link
Reference in a new issue