Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - name: Create render slaves on Rackspace Cloud
- hosts: renderslaves
- user: root
- connection: local
- gather_facts: False
- tasks:
- - name: Provision a set of instances
- local_action:
- module: rax
- creds_file: /home/tofarley/.pyrax
- region: DFW
- networks:
- - public
- - private
- - rendernet
- name: render-slave
- flavor: 2
- image: ubuntu-1204-lts-precise-pangolin
- count: 5
- exact_count: yes
- group: slaves
- # nova keypair-add --pub-key /home/tofarley/.ssh/id_rsa.pub render_keypair
- key_name: render_keypair
- wait: yes
- register: rax
- # Add these servers (by public IP) to a group called slaves
- # so that we can ssh into them below.
- - name: Add new instance to host group
- local_action: add_host hostname={{item.accessIPv4}} groupname=slaves
- with_items: rax.instances
- - name: Install Packages
- hosts: slaves
- user: root
- gather_facts: True
- tasks:
- - name: Install apt packages
- action: apt state=installed pkg={{item}} update-cache=yes
- with_items:
- - vim
- - git
- - tmux
- - blender
- tags:
- - packages
- - name: Create user
- hosts: slaves
- user: root
- gather_facts: True
- vars:
- # pulled from /etc/shadow
- password: $somehash$
- tasks:
- - action: user name=tofarley password={{password}}
- - name: Copy slave.blend to server
- hosts: slaves
- user: root
- gather_facts: True
- tasks:
- - copy: src=/home/tofarley/slave.blend dest=/root/slave.blend owner=root group=root mode=0644
- - name: Launch blender in tmux
- hosts: slaves
- user: root
- gather_facts: True
- tasks:
- # You can attach to this session with 'tmux attach -t blender'
- - 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