ansible/examples/playbooks/user_commands.yml

24 lines
796 B
YAML
Raw Normal View History

2012-03-22 19:36:11 +01:00
---
# this is a demo of how the user commands work and how to reference salted passwords
# in vars sections. You could also use vars_files if you like (see other examples)
2012-03-22 19:36:11 +01:00
- hosts: all
user: root
vars:
# created with:
# crypt.crypt('This is my Password', '$1$SomeSalt')
password: $1$SomeSalt$UqddPX3r4kH3UL5jq5/ZI.
tasks:
# Walk through account creation, modification, and deletion
- name: test basic user account creation
action: user name=tset comment=TsetUser gid=100 shell=/sbin/nologin createhome=no
# the following is just a simple example of how you don't have to include
# the 'name' element for each task
2012-03-22 19:36:11 +01:00
- action: user name=tset comment=NyetUser
- action: user name=tset password=$password
- action: user name=tset state=absent