Skip to content

Commit 5297dbc

Browse files
committed
Optionnal password
1 parent 4aab699 commit 5297dbc

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Each row have few keys:
8383
Each row have few keys:
8484

8585
- `name`: (M) username on system
86+
- `password`: (O) password
8687
- `shell`: (O) default is /bin/bash
8788
- `comment`: (O) default is an empty string
8889
- `sudo`: (O) boolean (true = can sudo)

tasks/user.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
- name: USER | Add users to the system
1212
user: >
1313
name={{ item.name }}
14-
shell={{ item.shell | default('/bin/bash') }}
14+
shell={{ item.shell | default(omit) }}
1515
comment={{ item.comment | default('') }}
1616
groups={{ item.groups | default('') }}
17-
home={{ item.home | default('/home/' + item.name) }}
17+
home={{ item.home | default(omit) }}
1818
createhome={{ item.createhome | default('yes') }}
1919
system={{ item.system | default('no') }}
2020
state={{ item.state | default('present') }}
21+
password={{ item.password | default(omit) }}
2122
with_items: "{{ dbs_users }}"
2223
register: u
2324

tests/test-travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
sudo: true
2525
ssh_keys:
2626
- 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSps/VDsZlUfhCunjC15A8kYa1zn3hjLAk4M1NwBvQzRYoaOKpUnBJaCo+xGduYh+zfCyHWcycvZfZXeh2nmuzvhlvyeGAcX5ZCoRaGiXA+uhXNViZInYiKqfXZjPUrJXHqXJ6wl6dLPGCPdnDhMyp7v8eQKRIr0ejzrSPrmj7k8xU065HF56xO7DNpCs3b+W3WeutzcTE4rXVTrxLKmVaW+m+9IPCM/6eK2sH7ok4xkN8U73+KGAVtJDFLisu8E1LD+Kp/f3orpV3KFfJ2nfHhWghM24SrQsok0JJAzdWQMKDOzJXCFWQHL2TlZyfqcr56+xB2yn/HneU8wKLlBxh hanx@emantel'
27+
password: '1a2b3c'
2728
- name: 'hx'
2829
group: 'www-data'
2930
groups: 'superdaemon'

tests/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
shell: '/usr/sbin/nologin'
2323
sudo: false
2424
ssh_keys: []
25+
password: '1a2b3c'
2526
- name: 'regis'
2627
ssh_keys: []
2728
state: 'absent'

0 commit comments

Comments
 (0)