Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # TO CREATE USERS
- - hosts: '{{host_name}}'
- remote_user: ec2-user
- become: yes
- vars:
- user_password: "{{ password }}"
- user_name: "{{ username }}"
- tasks:
- #Adding a new user with the user module and jinja2 filters
- - name: Creating user "{{ user_name }}" with admin access
- user: name={{ user_name }} password={{ user_password|password_hash('sha512') }}
- ansible-playbook xxx.yml -e "host_name=xxx username=xxx password=xxx"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement