-
-
Save rcarmo/01ecea6a5e93e0de89d8d5d4c411638b to your computer and use it in GitHub Desktop.
My Blender render farm ansible playbook.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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' \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment