Advertisement
Guest User

Untitled

a guest
Aug 20th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. ---
  2. - name: Create render slaves on Rackspace Cloud
  3. hosts: renderslaves
  4. user: root
  5. connection: local
  6. gather_facts: False
  7. tasks:
  8. - name: Provision a set of instances
  9. local_action:
  10. module: rax
  11. creds_file: /home/tofarley/.pyrax
  12. region: DFW
  13. networks:
  14. - public
  15. - private
  16. - rendernet
  17. name: render-slave
  18. flavor: 2
  19. image: ubuntu-1204-lts-precise-pangolin
  20. count: 5
  21. exact_count: yes
  22. group: slaves
  23. # nova keypair-add --pub-key /home/tofarley/.ssh/id_rsa.pub render_keypair
  24. key_name: render_keypair
  25. wait: yes
  26. register: rax
  27.  
  28. # Add these servers (by public IP) to a group called slaves
  29. # so that we can ssh into them below.
  30. - name: Add new instance to host group
  31. local_action: add_host hostname={{item.accessIPv4}} groupname=slaves
  32. with_items: rax.instances
  33.  
  34. - name: Install Packages
  35. hosts: slaves
  36. user: root
  37. gather_facts: True
  38.  
  39. tasks:
  40. - name: Install apt packages
  41. action: apt state=installed pkg={{item}} update-cache=yes
  42. with_items:
  43. - vim
  44. - git
  45. - tmux
  46. - blender
  47. tags:
  48. - packages
  49.  
  50. - name: Create user
  51. hosts: slaves
  52. user: root
  53. gather_facts: True
  54. vars:
  55. # pulled from /etc/shadow
  56. password: $somehash$
  57. tasks:
  58. - action: user name=tofarley password={{password}}
  59.  
  60. - name: Copy slave.blend to server
  61. hosts: slaves
  62. user: root
  63. gather_facts: True
  64. tasks:
  65. - copy: src=/home/tofarley/slave.blend dest=/root/slave.blend owner=root group=root mode=0644
  66.  
  67. - name: Launch blender in tmux
  68. hosts: slaves
  69. user: root
  70. gather_facts: True
  71. tasks:
  72. # You can attach to this session with 'tmux attach -t blender'
  73. - command: tmux new-session -d -s blender 'blender -b slave.blend --addons netrender -a -noaudio -nojoystick' \;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement