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
d0994cd1
Commit
d0994cd1
authored
Aug 28, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'setup-no-dash-facts' of
https://github.com/tima/ansible
into devel
Conflicts: library/setup
parents
f07772b7
8c32aefc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
library/setup
+14
-14
No files found.
library/setup
View file @
d0994cd1
...
@@ -684,7 +684,7 @@ def run_setup(module):
...
@@ -684,7 +684,7 @@ def run_setup(module):
facts
=
ansible_facts
()
facts
=
ansible_facts
()
for
(
k
,
v
)
in
facts
.
items
():
for
(
k
,
v
)
in
facts
.
items
():
setup_options
[
"ansible_
%
s"
%
k
]
=
v
setup_options
[
"ansible_
%
s"
%
k
.
replace
(
'-'
,
'_'
)
]
=
v
# if facter is installed, and we can use --json because
# if facter is installed, and we can use --json because
# ruby-json is ALSO installed, include facter data in the JSON
# ruby-json is ALSO installed, include facter data in the JSON
...
@@ -707,19 +707,19 @@ def run_setup(module):
...
@@ -707,19 +707,19 @@ def run_setup(module):
# templating w/o making a nicer key for it (TODO)
# templating w/o making a nicer key for it (TODO)
if
os
.
path
.
exists
(
"/usr/bin/ohai"
):
if
os
.
path
.
exists
(
"/usr/bin/ohai"
):
cmd
=
subprocess
.
Popen
(
"/usr/bin/ohai"
,
shell
=
True
,
cmd
=
subprocess
.
Popen
(
"/usr/bin/ohai"
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
out
,
err
=
cmd
.
communicate
()
out
,
err
=
cmd
.
communicate
()
ohai
=
True
ohai
=
True
try
:
try
:
ohai_ds
=
json
.
loads
(
out
)
ohai_ds
=
json
.
loads
(
out
)
except
:
except
:
ohai
=
False
ohai
=
False
if
ohai
:
if
ohai
:
for
(
k
,
v
)
in
ohai_ds
.
items
():
for
(
k
,
v
)
in
ohai_ds
.
items
():
if
type
(
v
)
==
str
or
type
(
v
)
==
unicode
:
if
type
(
v
)
==
str
or
type
(
v
)
==
unicode
:
k2
=
"ohai_
%
s"
%
k
k2
=
"ohai_
%
s"
%
k
.
replace
(
'-'
,
'_'
)
setup_options
[
k2
]
=
v
setup_options
[
k2
]
=
v
setup_result
=
{}
setup_result
=
{}
setup_result
[
'ansible_facts'
]
=
setup_options
setup_result
[
'ansible_facts'
]
=
setup_options
...
...
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