Update pam_limits.py

Add version 2.0
Remove default: from documentation for required values
use atomic_move from ansible module API
reviewable/pr18780/r1
Sebastien ROHAUT 10 years ago
parent 9cb97b2898
commit 44423e4a65

@ -1,3 +1,4 @@
#!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# (c) 2014, Sebastien Rohaut <sebastien.rohaut@gmail.com> # (c) 2014, Sebastien Rohaut <sebastien.rohaut@gmail.com>
@ -25,7 +26,7 @@ import re
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: pam_limits module: pam_limits
version_added: "historical" version_added: "2.0"
short_description: Modify Linux PAM limits short_description: Modify Linux PAM limits
description: description:
- The M(pam_limits) module modify PAM limits, default in /etc/security/limits.conf. - The M(pam_limits) module modify PAM limits, default in /etc/security/limits.conf.
@ -35,24 +36,20 @@ options:
description: description:
- A username, @groupname, wildcard, uid/gid range. - A username, @groupname, wildcard, uid/gid range.
required: true required: true
default: null
limit_type: limit_type:
description: description:
- Limit type : hard or soft. - Limit type : hard or soft.
required: true required: true
choices: [ "hard", "soft" ] choices: [ "hard", "soft" ]
default: null
limit_item: limit_item:
description: description:
- The limit to be set : core, data, nofile, cpu, etc. - The limit to be set : core, data, nofile, cpu, etc.
required: true required: true
choices: [ "core", "data", "fsize", "memlock", "nofile", "rss", "stack", "cpu", "nproc", "as", "maxlogins", "maxsyslogins", "priority", "locks", "sigpending", "msgqueue", "nice", "rtprio", "chroot" ] choices: [ "core", "data", "fsize", "memlock", "nofile", "rss", "stack", "cpu", "nproc", "as", "maxlogins", "maxsyslogins", "priority", "locks", "sigpending", "msgqueue", "nice", "rtprio", "chroot" ]
default: null
value: value:
description: description:
- The value of the limit. - The value of the limit.
required: true required: true
default: null
backup: backup:
description: description:
- Create a backup file including the timestamp information so you can get - Create a backup file including the timestamp information so you can get
@ -222,10 +219,7 @@ def main():
nf.close() nf.close()
# Copy tempfile to newfile # Copy tempfile to newfile
shutil.copy(nf.name, f.name) module.atomic_move(nf.name, f.name)
# delete tempfile
os.unlink(nf.name)
res_args = dict( res_args = dict(
changed = changed, msg = message changed = changed, msg = message

Loading…
Cancel
Save