Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aaamendes/collect-users
Ansible role for collecting information from /etc/passwd
https://github.com/aaamendes/collect-users
Last synced: about 2 months ago
JSON representation
Ansible role for collecting information from /etc/passwd
- Host: GitHub
- URL: https://github.com/aaamendes/collect-users
- Owner: aaamendes
- License: mit
- Created: 2023-03-19T14:17:03.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-19T14:40:58.000Z (almost 2 years ago)
- Last Synced: 2024-08-18T13:47:39.883Z (4 months ago)
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
collect-users
=========Collects user information from */etc/passwd*.
By default it uses all users with a home directory under */home* and *root* **if the shell is not *nologin*.**
You can still get specific users or simply all users on a system while providing an exclude list (see role variables).
Role Variables
--------------| Variable | Type | Default value | Comments
| :--- |:--- | :--- |:---
| `users_list_name` | string | "users_list" | A name for the variable name that will be populated with the user objects. This variable can also be set in an inventory and will then be used instead.
| `exclude_users_list` | list | empty | Users to be excluded from collecting data for.
| `single_users_list` | list | empty | Only users listed here will be processed execpt the users in `exclude_users_list`.
| `only_home_users` | bool | true | If not defined or set to false, all users will be processed except the ones in `exclude_users_list`.Example Playbook
----------------```
- hosts: server
become: yes
roles:
- role: collect-users
exclude_users_list:
- roottasks:
- name: Print user data.
debug:
msg: "{{ users_list }}"```
### Example output
```
TASK [Print user data.]
ok: [server] => {
"msg": [
{
"fullname": "Test User",
"gid": "1002",
"home": "/home/test",
"name": "test",
"shell": "/bin/bash",
"uid": "1002",
"userinfo": "Test User,,,"
}
]
}
```Dependencies
-------
NoneLicense
-------MIT