Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
f17c4ca4
Commit
f17c4ca4
authored
Feb 24, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added an 'ohai' module. Some weird JSON hackage to get it to work.
parent
c8fe53c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
README.md
+1
-0
library/ohai
+12
-0
No files found.
README.md
View file @
f17c4ca4
...
...
@@ -146,6 +146,7 @@ Modules include:
*
command -- runs commands, giving output, return codes, and run time info
*
ping - just returns if the system is up or not
*
facter - retrieves facts about the host OS
*
ohai - similar to facter, but returns structured data
*
copy - add files to remote systems
Playbooks
...
...
library/ohai
0 → 100644
View file @
f17c4ca4
#!/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
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment