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
5646bc27
Commit
5646bc27
authored
Feb 13, 2013
by
James Martin
Committed by
Michael DeHaan
Feb 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for amazon linux distribution facts.
parent
0cd0a7fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
+9
-1
lib/ansible/module_common.py
+3
-0
library/setup
+6
-1
No files found.
lib/ansible/module_common.py
View file @
5646bc27
...
...
@@ -97,6 +97,9 @@ def get_distribution():
if platform.system() == 'Linux':
try:
distribution = platform.linux_distribution()[0].capitalize()
if distribution == 'NA':
if os.path.is_file('/etc/system-release'):
distribution = 'Amazon'
except:
# FIXME: MethodMissing, I assume?
distribution = platform.dist()[0].capitalize()
...
...
library/setup
View file @
5646bc27
...
...
@@ -76,7 +76,8 @@ class Facts(object):
# For the most part, we assume that platform.dist() will tell the truth.
# This is the fallback to handle unknowns or exceptions
OSDIST_DICT
=
{
'/etc/redhat-release'
:
'RedHat'
,
'/etc/vmware-release'
:
'VMwareESX'
}
'/etc/vmware-release'
:
'VMwareESX'
,
'/etc/system-release'
:
'Amazon'
}
SELINUX_MODE_DICT
=
{
1
:
'enforcing'
,
0
:
'permissive'
,
-
1
:
'disabled'
}
# A list of dicts. If there is a platform with more than one
...
...
@@ -132,6 +133,10 @@ class Facts(object):
if
os
.
path
.
exists
(
path
):
if
self
.
facts
[
'distribution'
]
==
'Fedora'
:
pass
elif
name
==
'Amazon'
:
self
.
facts
[
'distribution'
]
=
'Amazon'
data
=
get_file_content
(
path
)
self
.
facts
[
'distribution_version'
]
=
data
.
split
()[
-
1
]
elif
name
==
'RedHat'
:
data
=
get_file_content
(
path
)
if
'Red Hat'
in
data
:
...
...
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