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
dcb22d17
Commit
dcb22d17
authored
May 08, 2013
by
lonerr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FreeBSD group operations is now supported properly.
parent
e075607c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
library/system/group
+37
-0
No files found.
library/system/group
View file @
dcb22d17
...
@@ -210,6 +210,43 @@ class AIX(Group):
...
@@ -210,6 +210,43 @@ class AIX(Group):
# ===========================================
# ===========================================
class
FreeBsdGroup
(
Group
):
"""
This is a FreeBSD Group manipulation class.
This overrides the following methods from the generic class:-
- group_del()
- group_add()
- group_mod()
"""
platform
=
'FreeBSD'
distribution
=
None
GROUPFILE
=
'/etc/group'
def
group_del
(
self
):
cmd
=
[
self
.
module
.
get_bin_path
(
'pw'
,
True
),
'groupdel'
,
self
.
name
]
return
self
.
execute_command
(
cmd
)
def
group_add
(
self
,
**
kwargs
):
cmd
=
[
self
.
module
.
get_bin_path
(
'pw'
,
True
),
'groupadd'
,
self
.
name
]
if
self
.
gid
is
not
None
:
cmd
.
append
(
'-g
%
d'
%
int
(
self
.
gid
))
return
self
.
execute_command
(
cmd
)
def
group_mod
(
self
,
**
kwargs
):
cmd
=
[
self
.
module
.
get_bin_path
(
'pw'
,
True
),
'groupmod'
,
self
.
name
]
info
=
self
.
group_info
()
cmd_len
=
len
(
cmd
)
if
self
.
gid
is
not
None
and
int
(
self
.
gid
)
!=
info
[
2
]:
cmd
.
append
(
'-g
%
d'
%
int
(
self
.
gid
))
# modify the group if cmd will do anything
if
cmd_len
!=
len
(
cmd
):
return
self
.
execute_command
(
cmd
)
return
(
None
,
''
,
''
)
# ===========================================
def
main
():
def
main
():
module
=
AnsibleModule
(
module
=
AnsibleModule
(
argument_spec
=
dict
(
argument_spec
=
dict
(
...
...
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