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
6809b562
Commit
6809b562
authored
May 30, 2013
by
Chris Gardner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Solaris network facts. IPv6 details overwrite IPv4 per interface, needs further work.
parent
dbfad567
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletions
+19
-1
library/system/setup
+19
-1
No files found.
library/system/setup
View file @
6809b562
...
@@ -1259,7 +1259,7 @@ class GenericBsdIfconfigNetwork(Network):
...
@@ -1259,7 +1259,7 @@ class GenericBsdIfconfigNetwork(Network):
all_ipv4_addresses
=
[],
all_ipv4_addresses
=
[],
all_ipv6_addresses
=
[],
all_ipv6_addresses
=
[],
)
)
rc
,
out
,
err
=
module
.
run_command
([
ifconfig_path
])
rc
,
out
,
err
=
module
.
run_command
([
ifconfig_path
,
'-a'
])
for
line
in
out
.
split
(
'
\n
'
):
for
line
in
out
.
split
(
'
\n
'
):
...
@@ -1328,6 +1328,8 @@ class GenericBsdIfconfigNetwork(Network):
...
@@ -1328,6 +1328,8 @@ class GenericBsdIfconfigNetwork(Network):
def
parse_inet_line
(
self
,
words
,
current_if
,
ips
):
def
parse_inet_line
(
self
,
words
,
current_if
,
ips
):
address
=
{
'address'
:
words
[
1
]}
address
=
{
'address'
:
words
[
1
]}
# deal with hex netmask
# deal with hex netmask
if
re
.
match
(
'([0-9a-f]){8}'
,
words
[
3
])
and
len
(
words
[
3
])
==
8
:
words
[
3
]
=
'0x'
+
words
[
3
]
if
words
[
3
]
.
startswith
(
'0x'
):
if
words
[
3
]
.
startswith
(
'0x'
):
address
[
'netmask'
]
=
socket
.
inet_ntoa
(
struct
.
pack
(
'!L'
,
int
(
words
[
3
],
base
=
16
)))
address
[
'netmask'
]
=
socket
.
inet_ntoa
(
struct
.
pack
(
'!L'
,
int
(
words
[
3
],
base
=
16
)))
else
:
else
:
...
@@ -1401,6 +1403,22 @@ class DarwinNetwork(GenericBsdIfconfigNetwork, Network):
...
@@ -1401,6 +1403,22 @@ class DarwinNetwork(GenericBsdIfconfigNetwork, Network):
current_if
[
'media_options'
]
=
self
.
get_options
(
words
[
3
])
current_if
[
'media_options'
]
=
self
.
get_options
(
words
[
3
])
class
SunOSNetwork
(
GenericBsdIfconfigNetwork
,
Network
):
"""
This is the SunOS Network Class.
It uses the GenericBsdIfconfigNetwork unchanged
"""
platform
=
'SunOS'
# Solaris displays single digit octets in MAC addresses e.g. 0:1:2:d:e:f
# Add leading zero to each octet where needed.
def
parse_ether_line
(
self
,
words
,
current_if
,
ips
):
macaddress
=
''
for
octet
in
words
[
1
]
.
split
(
':'
):
octet
=
(
'0'
+
octet
)[
-
2
:
None
]
macaddress
+=
(
octet
+
':'
)
current_if
[
'macaddress'
]
=
macaddress
[
0
:
-
1
]
class
FreeBSDNetwork
(
GenericBsdIfconfigNetwork
,
Network
):
class
FreeBSDNetwork
(
GenericBsdIfconfigNetwork
,
Network
):
"""
"""
This is the FreeBSD Network Class.
This is the FreeBSD Network Class.
...
...
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