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
49bef3f6
Commit
49bef3f6
authored
Sep 06, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1005 from dagwieers/cmdline
Add /proc/cmdline information to the default facts
parents
fa71237f
d158218c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
+13
-1
library/setup
+13
-1
No files found.
library/setup
View file @
49bef3f6
...
@@ -58,6 +58,7 @@ class Facts(object):
...
@@ -58,6 +58,7 @@ class Facts(object):
self
.
facts
=
{}
self
.
facts
=
{}
self
.
get_platform_facts
()
self
.
get_platform_facts
()
self
.
get_distribution_facts
()
self
.
get_distribution_facts
()
self
.
get_cmdline
()
self
.
get_public_ssh_host_keys
()
self
.
get_public_ssh_host_keys
()
self
.
get_selinux_facts
()
self
.
get_selinux_facts
()
...
@@ -103,6 +104,17 @@ class Facts(object):
...
@@ -103,6 +104,17 @@ class Facts(object):
else
:
else
:
self
.
facts
[
'distribution'
]
=
name
self
.
facts
[
'distribution'
]
=
name
def
get_cmdline
(
self
):
data
=
get_file_content
(
'/proc/cmdline'
)
if
data
:
self
.
facts
[
'cmdline'
]
=
{}
for
piece
in
shlex
.
split
(
data
):
item
=
piece
.
split
(
'='
,
1
)
if
len
(
item
)
==
1
:
self
.
facts
[
'cmdline'
][
item
[
0
]]
=
True
else
:
self
.
facts
[
'cmdline'
][
item
[
0
]]
=
item
[
1
]
def
get_public_ssh_host_keys
(
self
):
def
get_public_ssh_host_keys
(
self
):
dsa_filename
=
'/etc/ssh/ssh_host_dsa_key.pub'
dsa_filename
=
'/etc/ssh/ssh_host_dsa_key.pub'
rsa_filename
=
'/etc/ssh/ssh_host_rsa_key.pub'
rsa_filename
=
'/etc/ssh/ssh_host_rsa_key.pub'
...
@@ -204,7 +216,7 @@ class LinuxHardware(Hardware):
...
@@ -204,7 +216,7 @@ class LinuxHardware(Hardware):
MEMORY_FACTS
=
[
'MemTotal'
,
'SwapTotal'
,
'MemFree'
,
'SwapFree'
]
MEMORY_FACTS
=
[
'MemTotal'
,
'SwapTotal'
,
'MemFree'
,
'SwapFree'
]
# DMI bits
# DMI bits
DMI_DICT
=
dict
(
DMI_DICT
=
dict
(
form_factor
=
'/sys/devices/virtual/dmi/id/chassis_type'
,
form_factor
=
'/sys/devices/virtual/dmi/id/chassis_type'
,
product_name
=
'/sys/devices/virtual/dmi/id/product_name'
,
product_name
=
'/sys/devices/virtual/dmi/id/product_name'
,
product_serial
=
'/sys/devices/virtual/dmi/id/product_serial'
,
product_serial
=
'/sys/devices/virtual/dmi/id/product_serial'
,
product_uuid
=
'/sys/devices/virtual/dmi/id/product_uuid'
,
product_uuid
=
'/sys/devices/virtual/dmi/id/product_uuid'
,
...
...
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