Skip to content

A very minimal ansible module to query/change user account expiration date on Linux

License

Notifications You must be signed in to change notification settings

aduzsardi/ansible-chage-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Module: chage

A very minimal module to query/change user account expiration date on Linux

Inspired from John Buxton's chage module , but changed most of the code for my needs and to learn something along the way.

Features

  • query and change user account expiration on Linux
  • returns user expiration date

Examples

# remove an account expiration date.
- chage: user=john expire_date=-1

# display user account expiration date
- chage: user=john
  register: user
- debug: msg={{user.info.expire_date}}

Options

Most of the option names follow the fields documented in /usr/include/shadow.h and pydoc spwd.

See also man chage.

argument alias required default comments
user yes user name
expire_date no None chage -E, --expiredate
days since 1970-01-01 until account expires or date in format YYYY-MM-DD , -1 to clear the expiration date

Requirements

  • chage command
  • /etc/shadow file (read pwconv man page if /etc/shadow does not exist)
  • root access (to read /etc/shadow file)

License

Apache 2.0

Author Information

Alex Duzsardi

About

A very minimal ansible module to query/change user account expiration date on Linux

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages