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
f0a4a17f
Commit
f0a4a17f
authored
Jun 01, 2013
by
Chris Gardner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Solaris O/S facts "distribution" and "distribution_*"
parent
9122efb2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
library/system/setup
+12
-2
No files found.
library/system/setup
View file @
f0a4a17f
...
...
@@ -102,7 +102,8 @@ class Facts(object):
'/etc/vmware-release'
:
'VMwareESX'
,
'/etc/openwrt_release'
:
'OpenWrt'
,
'/etc/system-release'
:
'OtherLinux'
,
'/etc/alpine-release'
:
'Alpine'
}
'/etc/alpine-release'
:
'Alpine'
,
'/etc/release'
:
'Solaris'
}
SELINUX_MODE_DICT
=
{
1
:
'enforcing'
,
0
:
'permissive'
,
-
1
:
'disabled'
}
# A list of dicts. If there is a platform with more than one
...
...
@@ -135,7 +136,7 @@ class Facts(object):
return
self
.
facts
# Platform
# patform.system() can be Linux, Darwin, Java, or Windows
# p
l
atform.system() can be Linux, Darwin, Java, or Windows
def
get_platform_facts
(
self
):
self
.
facts
[
'system'
]
=
platform
.
system
()
self
.
facts
[
'kernel'
]
=
platform
.
release
()
...
...
@@ -235,6 +236,15 @@ class Facts(object):
data
=
get_file_content
(
path
)
self
.
facts
[
'distribution'
]
=
'Alpine'
self
.
facts
[
'distribution_version'
]
=
data
elif
name
==
'Solaris'
:
data
=
get_file_content
(
path
)
.
split
(
'
\n
'
)[
0
]
if
'Oracle Solaris'
in
data
:
data
=
" "
.
join
(
data
.
split
()[
1
:
None
])
self
.
facts
[
'distribution'
]
=
data
.
split
()[
0
]
self
.
facts
[
'distribution_version'
]
=
data
.
split
()[
1
]
distribution_release
=
" "
.
join
(
data
.
split
()[
2
:
None
])
if
distribution_release
!=
'X86'
and
distribution_release
!=
'SPARC'
:
self
.
facts
[
'distribution_release'
]
=
distribution_release
else
:
self
.
facts
[
'distribution'
]
=
name
...
...
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