Guest User

Untitled

a guest
Aug 14th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. ---
  2. - name: Install python-pip
  3. become: true
  4. apt:
  5. name: python-pip
  6. state: installed
  7.  
  8. - name: Install PIP packages for API use
  9. become: true
  10. pip:
  11. name: proxmoxer, requests
  12. state: present
  13.  
  14. - name: Create vmdeploy group
  15. become: true
  16. group:
  17. name: vmdeploy
  18. state: present
  19.  
  20. - name: Add PVE deploy user
  21. become: true
  22. user:
  23. name: pveautodeploy
  24. shell: /bin/bash
  25. groups: vmdeploy
  26. password: "<<HASHED PASSWORD>>"
  27. register: create_user
  28.  
  29. - name: "Add Proxmox User account (1/4)"
  30. become: true
  31. command: "pveum useradd pveautodeploy@pam -comment 'API user for VM autodeploy'"
  32. ignore_errors: True
  33. when: create_user.changed
  34.  
  35. - name: "Add Proxmox User account (2/4)"
  36. become: true
  37. command: "pveum groupadd vmdeploy -comment 'VM Auto Deploy'"
  38. ignore_errors: True
  39. when: create_user.changed
  40.  
  41. - name: "Add Proxmox User account (3/4)"
  42. become: true
  43. command: "pveum aclmod / -group vmdeploy -role Administrator"
  44. ignore_errors: True
  45. when: create_user.changed
  46.  
  47. - name: "Add Proxmox User account (4/4)"
  48. become: true
  49. command: "pveum usermod pveautodeploy@pam -group vmdeploy"
  50. ignore_errors: True
  51. when: create_user.changed
Add Comment
Please, Sign In to add comment