Skip to content

Commit

Permalink
Optionnal password
Browse files Browse the repository at this point in the history
  • Loading branch information
HanXHX committed Oct 4, 2016
1 parent 4aab699 commit 5297dbc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Each row have few keys:
Each row have few keys:

- `name`: (M) username on system
- `password`: (O) password
- `shell`: (O) default is /bin/bash
- `comment`: (O) default is an empty string
- `sudo`: (O) boolean (true = can sudo)
Expand Down
5 changes: 3 additions & 2 deletions tasks/user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
- name: USER | Add users to the system
user: >
name={{ item.name }}
shell={{ item.shell | default('/bin/bash') }}
shell={{ item.shell | default(omit) }}
comment={{ item.comment | default('') }}
groups={{ item.groups | default('') }}
home={{ item.home | default('/home/' + item.name) }}
home={{ item.home | default(omit) }}
createhome={{ item.createhome | default('yes') }}
system={{ item.system | default('no') }}
state={{ item.state | default('present') }}
password={{ item.password | default(omit) }}
with_items: "{{ dbs_users }}"
register: u

Expand Down
1 change: 1 addition & 0 deletions tests/test-travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
sudo: true
ssh_keys:
- 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSps/VDsZlUfhCunjC15A8kYa1zn3hjLAk4M1NwBvQzRYoaOKpUnBJaCo+xGduYh+zfCyHWcycvZfZXeh2nmuzvhlvyeGAcX5ZCoRaGiXA+uhXNViZInYiKqfXZjPUrJXHqXJ6wl6dLPGCPdnDhMyp7v8eQKRIr0ejzrSPrmj7k8xU065HF56xO7DNpCs3b+W3WeutzcTE4rXVTrxLKmVaW+m+9IPCM/6eK2sH7ok4xkN8U73+KGAVtJDFLisu8E1LD+Kp/f3orpV3KFfJ2nfHhWghM24SrQsok0JJAzdWQMKDOzJXCFWQHL2TlZyfqcr56+xB2yn/HneU8wKLlBxh hanx@emantel'
password: '1a2b3c'
- name: 'hx'
group: 'www-data'
groups: 'superdaemon'
Expand Down
1 change: 1 addition & 0 deletions tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
shell: '/usr/sbin/nologin'
sudo: false
ssh_keys: []
password: '1a2b3c'
- name: 'regis'
ssh_keys: []
state: 'absent'
Expand Down

0 comments on commit 5297dbc

Please sign in to comment.