Skip to content

Instantly share code, notes, and snippets.

View vegitron's full-sized avatar

Patrick Michaud vegitron

  • University of Washington
View GitHub Profile
@vegitron
vegitron / deploy.yml
Created July 22, 2015 17:44
new django-managed-deploy-git-base.yml
- hosts: django-app-server
roles:
- { role: "django_app_server_role" }
vars:
build_name: "{{ inventory_file }}"
current_build_value: "{{ lookup('current_build', build_name) }}"
files_dir: "{{ lookup('env', 'ANSIBLE_FILES')|default('/data/ansible/aca-builds/files', true) }}"
acting_user: "{{ lookup('env', 'USER') }}"
- hosts: mysql-db-server
use Solstice::Factory::Person;
use ShareSpace::Factory::Space;
use Data::Dumper;
use JSON;
my $username = $ARGV[0];
my $user = Solstice::Factory::Person->new()->getByLogin($username);
my $list = $user->getLoginRealm()->getAccountsPersonHasAccessTo($user);
@vegitron
vegitron / gist:014e63c89a6418f970e2
Created February 27, 2015 00:38
Canvas error in myuw tests
(myuw)pmichaud@anise:~/django/myuw$ python manage.py test myuw_mobile.test.dao.canvas.TestCanvas
Creating test database for alias 'default'...
EE
======================================================================
ERROR: test_crosslinks (myuw_mobile.test.dao.canvas.TestCanvas)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pmichaud/django/myuw/myuw_mobile/test/dao/canvas.py", line 13, in test_crosslinks
data = get_indexed_data_for_regid("12345678901234567890123456789012")
File "/home/pmichaud/django/myuw/myuw_mobile/dao/canvas.py", line 41, in get_indexed_data_for_regid
@vegitron
vegitron / gist:7104494
Created October 22, 2013 17:16
Attempting to assign and use ansible facts.
pmichaud@vegitron:~/ansible/testing$ cat fact-test.yml
- name: a playbook trying out set_fact
hosts: all
tasks:
- set_fact:
value1: "Static Value"
value2: "{{ lookup('pipe', 'echo $(($(date +%s%N)/1000000))') }}"
- debug: msg = "Time - {{ value1 }}"
- debug: msg = "Time - {{ value2 }}"
pmichaud@vegitron:~/ansible/testing$ cat time-demo.yml
- name: a playbook demonstrating eval on use for lookups
hosts: all
vars:
time_in_ms: "{{ lookup('pipe', 'echo $(($(date +%s%N)/1000000))') }}"
tasks:
- debug: msg = "Time - {{ time_in_ms }}"