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
bd9c64e0
Commit
bd9c64e0
authored
Feb 28, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2245 from jmandel/add_user_fact
Add remote user_id to ansible facts
parents
b5ad1ce7
7c772c6a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
library/setup
+7
-0
No files found.
library/setup
View file @
bd9c64e0
...
@@ -27,6 +27,7 @@ import re
...
@@ -27,6 +27,7 @@ import re
import
socket
import
socket
import
struct
import
struct
import
datetime
import
datetime
import
getpass
DOCUMENTATION
=
'''
DOCUMENTATION
=
'''
---
---
...
@@ -119,6 +120,7 @@ class Facts(object):
...
@@ -119,6 +120,7 @@ class Facts(object):
self
.
get_pkg_mgr_facts
()
self
.
get_pkg_mgr_facts
()
self
.
get_lsb_facts
()
self
.
get_lsb_facts
()
self
.
get_date_time_facts
()
self
.
get_date_time_facts
()
self
.
get_user_facts
()
def
populate
(
self
):
def
populate
(
self
):
return
self
.
facts
return
self
.
facts
...
@@ -307,6 +309,11 @@ class Facts(object):
...
@@ -307,6 +309,11 @@ class Facts(object):
self
.
facts
[
'date_time'
][
'time'
]
=
now
.
strftime
(
'
%
H:
%
M:
%
S'
)
self
.
facts
[
'date_time'
][
'time'
]
=
now
.
strftime
(
'
%
H:
%
M:
%
S'
)
# User
def
get_user_facts
(
self
):
self
.
facts
[
'user_id'
]
=
getpass
.
getuser
()
class
Hardware
(
Facts
):
class
Hardware
(
Facts
):
"""
"""
This is a generic Hardware subclass of Facts. This should be further
This is a generic Hardware subclass of Facts. This should be further
...
...
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