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
90e760ba
Commit
90e760ba
authored
Feb 20, 2015
by
Dagobert Michelsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add LDom support
parent
67fb3945
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
lib/ansible/module_utils/facts.py
+21
-0
No files found.
lib/ansible/module_utils/facts.py
View file @
90e760ba
...
...
@@ -2498,6 +2498,27 @@ class SunOSVirtual(Virtual):
if
'VirtualBox'
in
line
:
self
.
facts
[
'virtualization_type'
]
=
'virtualbox'
self
.
facts
[
'virtualization_role'
]
=
'guest'
# Detect domaining on Sparc hardware
if
os
.
path
.
exists
(
"/usr/sbin/virtinfo"
):
# The output of virtinfo is different whether we are on a machine with logical
# domains ('LDoms') on a T-series or domains ('Domains') on a M-series. Try LDoms first.
rc
,
out
,
err
=
module
.
run_command
(
"/usr/sbin/virtinfo -p"
)
# The output contains multiple lines with different keys like this:
# DOMAINROLE|impl=LDoms|control=false|io=false|service=false|root=false
# The output may also be not formated and the returncode is set to 0 regardless of the error condition:
# virtinfo can only be run from the global zone
for
line
in
out
.
split
(
'
\n
'
):
fields
=
line
.
split
(
'|'
)
if
(
fields
[
0
]
==
'DOMAINROLE'
and
fields
[
1
]
==
'impl=LDoms'
):
self
.
facts
[
'virtualization_type'
]
=
'ldom'
self
.
facts
[
'virtualization_role'
]
=
'guest'
hostfeatures
=
[]
for
field
in
fields
[
2
:]:
arg
=
field
.
split
(
'='
)
if
(
arg
[
1
]
==
'true'
):
hostfeatures
.
append
(
arg
[
0
])
if
(
len
(
hostfeatures
)
>
0
):
self
.
facts
[
'virtualization_role'
]
=
'host ('
+
','
.
join
(
hostfeatures
)
+
')'
def
get_file_content
(
path
,
default
=
None
,
strip
=
True
):
data
=
default
...
...
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