Skip to content

Commit

Permalink
feat: add password and shell variables
Browse files Browse the repository at this point in the history
closes #10
  • Loading branch information
franklinkim committed May 9, 2016
1 parent 4fe8cd0 commit 93b48f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ Here is a list of all the default variables for this role, which are also availa

```yaml
---
# @see http://docs.ansible.com/ansible/user_module.html
#
# users:
# - username: foobar (required)
# name: Foo Bar
# uid: 1000
# group: staff
# password: xxxxx
# groups: ["adm", "www-data"]
# home_mode: "0750"
# home_create: yes
Expand All @@ -58,6 +60,7 @@ Here is a list of all the default variables for this role, which are also availa
# ssh_key_password: ""
# ssh_key_generate: no
# ssh_key: "xxx"
# shell: /bin/bash
#
# array of users to add
Expand Down Expand Up @@ -124,16 +127,17 @@ This is an example playbook:
```


## Testing

```shell
$ git clone https://github.com/weareinteractive/ansible-users.git
$ cd ansible-users
$ vagrant up
$ make test
```

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests and examples for any new or changed functionality.
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests and examples for any new or changed functionality.

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
# @see http://docs.ansible.com/ansible/user_module.html
#
# users:
# - username: foobar (required)
# name: Foo Bar
# uid: 1000
# group: staff
# password: xxxxx
# groups: ["adm", "www-data"]
# home_mode: "0750"
# home_create: yes
Expand All @@ -16,6 +18,7 @@
# ssh_key_password: ""
# ssh_key_generate: no
# ssh_key: "xxx"
# shell: /bin/bash
#

# array of users to add
Expand Down
2 changes: 1 addition & 1 deletion tasks/manage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
ssh_key_passphrase: "{{ item.ssh_key_password|default('') }}"
ssh_key_bits: "{{ item.ssh_key_bits|default(2048) }}"
createhome: "{{ item.home_create|default(omit) }}"
shell: "{{ item.shell|default('/bin/sh') }}"
shell: "{{ item.shell|default(omit) }}"
with_items: "{{ users }}"

- name: Setting user's home permission
Expand Down

0 comments on commit 93b48f0

Please sign in to comment.