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
c6733cc1
Commit
c6733cc1
authored
Aug 12, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9225 from qvicksilver/aix_unprivileged
AIX unprivileged facts collection
parents
5027f665
02294c52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
5 deletions
+30
-5
lib/ansible/module_utils/facts.py
+30
-5
No files found.
lib/ansible/module_utils/facts.py
View file @
c6733cc1
...
...
@@ -186,16 +186,21 @@ class Facts(object):
if
self
.
facts
[
'system'
]
==
'Linux'
:
self
.
get_distribution_facts
()
elif
self
.
facts
[
'system'
]
==
'AIX'
:
try
:
rc
,
out
,
err
=
module
.
run_command
(
"/usr/sbin/bootinfo -p"
)
# Attempt to use getconf to figure out architecture
# fall back to bootinfo if needed
if
module
.
get_bin_path
(
'getconf'
):
rc
,
out
,
err
=
module
.
run_command
([
module
.
get_bin_path
(
'getconf'
),
'MACHINE_ARCHITECTURE'
])
data
=
out
.
split
(
'
\n
'
)
self
.
facts
[
'architecture'
]
=
data
[
0
]
else
:
rc
,
out
,
err
=
module
.
run_command
([
module
.
get_bin_path
(
'bootinfo'
),
'-p'
])
data
=
out
.
split
(
'
\n
'
)
self
.
facts
[
'architecture'
]
=
data
[
0
]
except
:
self
.
facts
[
'architecture'
]
=
'Not Available'
elif
self
.
facts
[
'system'
]
==
'OpenBSD'
:
self
.
facts
[
'architecture'
]
=
platform
.
uname
()[
5
]
def
get_local_facts
(
self
):
fact_path
=
module
.
params
.
get
(
'fact_path'
,
None
)
...
...
@@ -2313,6 +2318,26 @@ class AIXNetwork(GenericBsdIfconfigNetwork, Network):
"""
platform
=
'AIX'
def
get_default_interfaces
(
self
,
route_path
):
netstat_path
=
module
.
get_bin_path
(
'netstat'
)
rc
,
out
,
err
=
module
.
run_command
([
netstat_path
,
'-nr'
])
interface
=
dict
(
v4
=
{},
v6
=
{})
lines
=
out
.
split
(
'
\n
'
)
for
line
in
lines
:
words
=
line
.
split
()
if
len
(
words
)
>
1
and
words
[
0
]
==
'default'
:
if
'.'
in
words
[
1
]:
interface
[
'v4'
][
'gateway'
]
=
words
[
1
]
interface
[
'v4'
][
'interface'
]
=
words
[
5
]
elif
':'
in
words
[
1
]:
interface
[
'v6'
][
'gateway'
]
=
words
[
1
]
interface
[
'v6'
][
'interface'
]
=
words
[
5
]
return
interface
[
'v4'
],
interface
[
'v6'
]
# AIX 'ifconfig -a' does not have three words in the interface line
def
get_interfaces_info
(
self
,
ifconfig_path
,
ifconfig_options
):
interfaces
=
{}
...
...
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