Advertisement
PandaAcademy

Ansible 2 - user role

Apr 6th, 2022
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. ---
  2. - name: Create panda group
  3. group:
  4. name: panda
  5. state: present
  6.  
  7. - name: Create panda user belonging to sudo and panda groups
  8. user:
  9. name: panda
  10. shell: /bin/bash
  11. groups:
  12. - panda
  13. - sudo
  14.  
  15. - name: Set authorized key for user panda copying it from vagrant user
  16. authorized_key:
  17. user: panda
  18. state: present
  19. key: "{{ lookup('file', '/home/vagrant/.ssh/authorized_keys') }}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement