Advertisement
Guest User

Untitled

a guest
Jul 19th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. # TO CREATE USERS
  2. - hosts: '{{host_name}}'
  3. remote_user: ec2-user
  4. become: yes
  5. vars:
  6. user_password: "{{ password }}"
  7. user_name: "{{ username }}"
  8. tasks:
  9.  
  10. #Adding a new user with the user module and jinja2 filters
  11. - name: Creating user "{{ user_name }}" with admin access
  12. user: name={{ user_name }} password={{ user_password|password_hash('sha512') }}
  13.  
  14. ansible-playbook xxx.yml -e "host_name=xxx username=xxx password=xxx"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement