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
e2e10c19
Commit
e2e10c19
authored
May 23, 2013
by
Kristof Keppens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for facter being installed in a different location
parent
8f3b2b28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
library/system/setup
+18
-4
No files found.
library/system/setup
View file @
e2e10c19
...
@@ -1638,11 +1638,25 @@ def run_setup(module):
...
@@ -1638,11 +1638,25 @@ def run_setup(module):
for
(
k
,
v
)
in
facts
.
items
():
for
(
k
,
v
)
in
facts
.
items
():
setup_options
[
"ansible_
%
s"
%
k
.
replace
(
'-'
,
'_'
)]
=
v
setup_options
[
"ansible_
%
s"
%
k
.
replace
(
'-'
,
'_'
)]
=
v
# Look for the path to the facter and ohai binary and set
# the variable to that path.
facter_path
=
None
ohai_path
=
None
for
dir
in
os
.
environ
[
'PATH'
]
.
split
(
':'
):
facter
=
os
.
path
.
join
(
dir
,
'facter'
)
if
os
.
path
.
exists
(
facter
):
facter_path
=
facter
ohai
=
os
.
path
.
join
(
dir
,
'ohai'
)
if
os
.
path
.
exists
(
ohai
):
ohai_path
=
ohai
# 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
if
os
.
path
.
exists
(
"/usr/bin/facter"
)
:
if
facter_path
is
not
None
:
rc
,
out
,
err
=
module
.
run_command
(
"/usr/bin/facter
--json"
)
rc
,
out
,
err
=
module
.
run_command
(
facter_path
+
"
--json"
)
facter
=
True
facter
=
True
try
:
try
:
facter_ds
=
json
.
loads
(
out
)
facter_ds
=
json
.
loads
(
out
)
...
@@ -1656,8 +1670,8 @@ def run_setup(module):
...
@@ -1656,8 +1670,8 @@ def run_setup(module):
# because it contains a lot of nested stuff we can't use for
# because it contains a lot of nested stuff we can't use for
# templating w/o making a nicer key for it (TODO)
# templating w/o making a nicer key for it (TODO)
if
o
s
.
path
.
exists
(
"/usr/bin/ohai"
)
:
if
o
hai_path
is
not
None
:
rc
,
out
,
err
=
module
.
run_command
(
"/usr/bin/ohai"
)
rc
,
out
,
err
=
module
.
run_command
(
ohai_path
)
ohai
=
True
ohai
=
True
try
:
try
:
ohai_ds
=
json
.
loads
(
out
)
ohai_ds
=
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