pass 2 on localvm

pull/1/head
Raymond Yee 2015-05-26 11:16:31 -07:00
parent 7d76df7007
commit c759ee8a73
4 changed files with 153 additions and 32 deletions

127
settings/localvm.py Normal file
View File

@ -0,0 +1,127 @@
from regluit.settings.common import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
SITE_ID = 2
ADMINS = (
('Raymond Yee', 'rdhyee+ungluebugs@gluejar.com'),
('Eric Hellman', 'eric@gluejar.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'regluit',
'USER': 'regluit',
'PASSWORD': 'regluit',
'HOST': '',
'PORT': '',
'TEST_CHARSET': 'utf8',
}
}
TIME_ZONE = 'America/New_York'
SECRET_KEY = '_^_off!8zsj4+)%qq623m&$7_m-q$iau5le0w!mw&n5tgt#x=t'
# settings for outbout email
# if you have a gmail account you can use your email address and password
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'accounts@gluejar.com'
EMAIL_HOST_PASSWORD = '7k3sWyzHpI'
EMAIL_PORT = 587
DEFAULT_FROM_EMAIL = 'accounts@gluejar.com'
# googlebooks
GOOGLE_BOOKS_API_KEY = 'AIzaSyBE36z7o6NUafIWcLEB8yk2I47-8_5y1_0'
# twitter auth
SOCIAL_AUTH_TWITTER_KEY = 'sd9StEg1N1qB8gGb2GRX4A'
SOCIAL_AUTH_TWITTER_SECRET = 'YSKHn8Du6EWqpcWZ6sp5tqDPvcOBXK0WJWVGWyB0'
# facebook auth
SOCIAL_AUTH_FACEBOOK_KEY = '242881179080779'
SOCIAL_AUTH_FACEBOOK_SECRET = '5eae483a0e92113d884c427b578ef23a'
# get these (as oauth2 client ID and Secret from
# https://console.developers.google.com/project/569579163337/apiui/credential?authuser=1
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = '569579163337-8rnhtn7pvbragmcj0l3slsmgfs86t69i.apps.googleusercontent.com'
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = 'zueklvlUNGgkxuAWTl-93q1z'
# Goodreads API
GOODREADS_API_KEY = "vfqIO6QAhBVvlxt6hAzZJg"
GOODREADS_API_SECRET = "57tq4MpyJ15Hgm2ToZQQFWJ7vraZzOAqHLckWRXQ"
# Freebase credentials
FREEBASE_USERNAME = ''
FREEBASE_PASSWORD = ''
# send celery log to Python logging
CELERYD_HIJACK_ROOT_LOGGER = False
# BASE_URL is a hard-coding of the domain name for site and used for PayPal IPN
# Next step to try https
BASE_URL = 'http://127.0.0.1'
BASE_URL_SECURE = 'https://127.0.0.1:443'
IPN_SECURE_URL = False
# use redis for production queue
BROKER_TRANSPORT = "redis"
BROKER_HOST = "localhost"
BROKER_PORT = 6379
BROKER_VHOST = "0"
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'handlers': {
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler'
},
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
STATIC_ROOT = '/var/www/static'
CKEDITOR_UPLOAD_PATH = '/var/www/static/media/'
IS_PREVIEW = False
# decide which of the period tasks to add to the schedule
#CELERYBEAT_SCHEDULE['send_test_email'] = SEND_TEST_EMAIL_JOB
CELERYBEAT_SCHEDULE['report_new_ebooks'] = EBOOK_NOTIFICATIONS_JOB
CELERYBEAT_SCHEDULE['emit_notifications'] = EMIT_NOTIFICATIONS_JOB
# local settings for maintenance mode
MAINTENANCE_MODE = False
# Amazon keys to permit S3 access
# reusing just cedentials here
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
AWS_ACCESS_KEY_ID = 'AKIAIYP6XRVAUWKQFT5Q'
AWS_SECRET_ACCESS_KEY = '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'
AWS_STORAGE_BUCKET_NAME = 'just-unglueit'
# if settings/local.py exists, import those settings -- allows for dynamic generation of parameters such as DATABASES
try:
from regluit.settings.local import *
except ImportError:
pass

2
vagrant/Vagrantfile vendored
View File

@ -118,7 +118,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# trying to mimic https://github.com/mozilla/fxa-dev/blob/b9b6f347c786428b347b82d38fb67e2c2fd1b827/vagrant/Vagrantfile
# but this doesn't work
override.vm.provision "ansible" do |ansible|
ansible.playbook = 'hello2.yml'
ansible.playbook = 'localvm.yml'
end

View File

@ -1,5 +1,5 @@
- name: Hello Ansible
hosts: local
hosts: localvm
vars:
user: "{{ ansible_ssh_user }}"
sudo: yes

View File

@ -86,29 +86,29 @@
git: repo=ssh://git@github.com/Gluejar/regluit.git dest=/opt/regluit accept_hostkey=True force=yes version=sysadmin
## installing mysql
## https://github.com/bennojoy/mysql --> probably the right way
## how do you make use of other people's playbooks in the right way?
## http://stackoverflow.com/a/7740571/7782
#
#- name: mysql setup
# raw: debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password password {{mysql_root_pw}}'
#- raw: debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password_again password {{mysql_root_pw}}'
#- raw: apt-get -y install mysql-server
#
#- name: Create regluit database
# mysql_db: db=regluit state=present encoding=utf8 collation=utf8_bin login_user=root login_password={{mysql_root_pw}}
#
# # GRANT ALL PRIVILEGES ON regluit.* TO 'regluit'@'localhost' WITH GRANT OPTION; (covered?)
#- name: Create database user
# mysql_user: >
# user=regluit
# password={{mysql_regluit_pw}}
# host=localhost
# priv=*.*:ALL
# state=present
# login_user=root
# login_password={{mysql_root_pw}}
# installing mysql
# https://github.com/bennojoy/mysql --> probably the right way
# how do you make use of other people's playbooks in the right way?
# http://stackoverflow.com/a/7740571/7782
- name: mysql setup
raw: debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password password {{mysql_root_pw}}'
- raw: debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password_again password {{mysql_root_pw}}'
- raw: apt-get -y install mysql-server
- name: Create regluit database
mysql_db: db=regluit state=present encoding=utf8 collation=utf8_bin login_user=root login_password={{mysql_root_pw}}
# GRANT ALL PRIVILEGES ON regluit.* TO 'regluit'@'localhost' WITH GRANT OPTION; (covered?)
- name: Create database user
mysql_user: >
user=regluit
password={{mysql_regluit_pw}}
host=localhost
priv=*.*:ALL
state=present
login_user=root
login_password={{mysql_root_pw}}
# running stuff within a virtualenv
@ -344,12 +344,6 @@
- /opt/regluit/deploy/public_keys/*
sudo: no
- name: add public key from jenkins
authorized_key: >
user={{user}}
key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYSiXESHXEdugNLGxFABXpVSawDCU/BK05Ef2qUa7oxxhU7fXNqWaSTqowevVruF7kfzMQ7epIxN5XFFjbXf/tsSn1995H9BEhmHLXLuEB5VaPU2HTLqu0DscyPtRbk/WjqPj3jWXs2yHgKcJIXwd5EfSwJuCe1Ut6pMe9E/NUq9QztnydRTt0sGywXpkIpKeBkiQl4SWlPTHcoU6PDbEuMVii8GzRAQlpEQTJwzWJTToR1SZ7o1uusDSxIDfJSvAa5IiuII8CdKbqa/JSx1+4LqlT0yf+2yb67MR5q6+XFM4TeCf5z+4SW+IT/wd2tpbd0DjAdXJlAgBULwhd1L7r"
state=present
sudo: no
handlers: