mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-03 12:44:22 -07:00
Still seeing some weirdness from ohai but we can probably simplify
this until we figure out what that is.
This commit is contained in:
parent
e6a1acf756
commit
1420c49277
1 changed files with 2 additions and 15 deletions
17
library/ohai
17
library/ohai
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/python
|
#!/bin/bash
|
||||||
|
|
||||||
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
|
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
|
||||||
#
|
#
|
||||||
|
@ -18,17 +18,4 @@
|
||||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
# requires 'ohai' to be installed
|
/usr/bin/ohai
|
||||||
|
|
||||||
try:
|
|
||||||
import json
|
|
||||||
except ImportError:
|
|
||||||
import simplejson as 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