Guest User

Untitled

a guest
Apr 15th, 2025
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. ---
  2. - name: Create linux user with bash shell and passwordable login
  3. hosts: remote_nodes
  4. become: true
  5. vars_files:
  6. - gen_password.vars
  7. tasks:
  8. - name: create user
  9. ansible.builtin.user:
  10. name: "{{ static_username }}"
  11. shell: "/bin/bash"
  12. password: "{{ static_password | password_hash('sha512') }}"
  13. create_home: true
  14. state: present
  15.  
  16. - name: Unlock user account (if locked)
  17. ansible.builtin.user:
  18. name: "{{ static_username }}"
  19. state: present
  20. password_lock: no
Add Comment
Please, Sign In to add comment