diff --git a/SETUP.md b/SETUP.md new file mode 100644 index 0000000000..6f2914cc57 --- /dev/null +++ b/SETUP.md @@ -0,0 +1,52 @@ +SETUP +===== + +This will be an ansible playbook soon! + +For now these are instructions for CentOS 6. + +Install ansible-commander +========================= + +Before proceeding, be aware that this should be installed on it's own +machine (or virtualmachine) as it is going to lock down the database. + +Ansible will install ansible-commander using a playbook, so you first +need to have ansible installed. Do this first and come back here. + +You will also need the EPEL yum repository installed if using CentOS6. + +First edit app_setup/vars/vars.yml to select a database password. + +If you feel like you need to change it, the Django config file is also +templated. See app_setup/templates/setting.py.j2. Most people will +not need to change this. + +run "make setup" to run the ansible setup playbook. It should run +without erros. + +This playbook will: + + * install Django and required software components + * install postgresql and configure authentication + * initialize the database + * initialize the first database table + * synchronize the database and run any migrations + +You may run this setup step again as needed as many times +as you like. + +Test the server +=============== + +make runserver + +access the server on 127.0.0.1:8000 + +Running through Apache +====================== + +TODO. + + + diff --git a/acom/audits/models.py b/acom/audits/models.py deleted file mode 100644 index 71a8362390..0000000000 --- a/acom/audits/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/acom/events/models.py b/acom/events/models.py deleted file mode 100644 index 71a8362390..0000000000 --- a/acom/events/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/acom/events/tests.py b/acom/events/tests.py deleted file mode 100644 index 2247054b35..0000000000 --- a/acom/events/tests.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -This file demonstrates two different styles of tests (one doctest and one -unittest). These will both pass when you run "manage.py test". - -Replace these with more appropriate tests for your application. -""" - -from django.test import TestCase - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.failUnlessEqual(1 + 1, 2) - -__test__ = {"doctest": """ -Another way to test that 1 + 1 is equal to 2. - ->>> 1 + 1 == 2 -True -"""} - diff --git a/acom/events/views.py b/acom/events/views.py deleted file mode 100644 index 60f00ef0ef..0000000000 --- a/acom/events/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/acom/groups/__init__.py b/acom/groups/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/acom/groups/models.py b/acom/groups/models.py deleted file mode 100644 index 71a8362390..0000000000 --- a/acom/groups/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/acom/groups/tests.py b/acom/groups/tests.py deleted file mode 100644 index 2247054b35..0000000000 --- a/acom/groups/tests.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -This file demonstrates two different styles of tests (one doctest and one -unittest). These will both pass when you run "manage.py test". - -Replace these with more appropriate tests for your application. -""" - -from django.test import TestCase - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.failUnlessEqual(1 + 1, 2) - -__test__ = {"doctest": """ -Another way to test that 1 + 1 is equal to 2. - ->>> 1 + 1 == 2 -True -"""} - diff --git a/acom/groups/views.py b/acom/groups/views.py deleted file mode 100644 index 60f00ef0ef..0000000000 --- a/acom/groups/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/acom/hosts/__init__.py b/acom/hosts/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/acom/hosts/models.py b/acom/hosts/models.py deleted file mode 100644 index 71a8362390..0000000000 --- a/acom/hosts/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/acom/hosts/tests.py b/acom/hosts/tests.py deleted file mode 100644 index 2247054b35..0000000000 --- a/acom/hosts/tests.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -This file demonstrates two different styles of tests (one doctest and one -unittest). These will both pass when you run "manage.py test". - -Replace these with more appropriate tests for your application. -""" - -from django.test import TestCase - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.failUnlessEqual(1 + 1, 2) - -__test__ = {"doctest": """ -Another way to test that 1 + 1 is equal to 2. - ->>> 1 + 1 == 2 -True -"""} - diff --git a/acom/hosts/views.py b/acom/hosts/views.py deleted file mode 100644 index 60f00ef0ef..0000000000 --- a/acom/hosts/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/acom/inventory/__init__.py b/acom/inventory/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/acom/inventory/models.py b/acom/inventory/models.py deleted file mode 100644 index 71a8362390..0000000000 --- a/acom/inventory/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/acom/inventory/tests.py b/acom/inventory/tests.py deleted file mode 100644 index 2247054b35..0000000000 --- a/acom/inventory/tests.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -This file demonstrates two different styles of tests (one doctest and one -unittest). These will both pass when you run "manage.py test". - -Replace these with more appropriate tests for your application. -""" - -from django.test import TestCase - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.failUnlessEqual(1 + 1, 2) - -__test__ = {"doctest": """ -Another way to test that 1 + 1 is equal to 2. - ->>> 1 + 1 == 2 -True -"""} - diff --git a/acom/inventory/views.py b/acom/inventory/views.py deleted file mode 100644 index 60f00ef0ef..0000000000 --- a/acom/inventory/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/acom/jobs/__init__.py b/acom/jobs/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/acom/jobs/models.py b/acom/jobs/models.py deleted file mode 100644 index 71a8362390..0000000000 --- a/acom/jobs/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/acom/jobs/tests.py b/acom/jobs/tests.py deleted file mode 100644 index 2247054b35..0000000000 --- a/acom/jobs/tests.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -This file demonstrates two different styles of tests (one doctest and one -unittest). These will both pass when you run "manage.py test". - -Replace these with more appropriate tests for your application. -""" - -from django.test import TestCase - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.failUnlessEqual(1 + 1, 2) - -__test__ = {"doctest": """ -Another way to test that 1 + 1 is equal to 2. - ->>> 1 + 1 == 2 -True -"""} - diff --git a/acom/jobs/views.py b/acom/jobs/views.py deleted file mode 100644 index 60f00ef0ef..0000000000 --- a/acom/jobs/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/acom/audits/__init__.py b/acom/main/__init__.py similarity index 100% rename from acom/audits/__init__.py rename to acom/main/__init__.py diff --git a/acom/main/__init__.pyc b/acom/main/__init__.pyc new file mode 100644 index 0000000000..87b0fe3b1b Binary files /dev/null and b/acom/main/__init__.pyc differ diff --git a/acom/main/migrations/0001_initial.py b/acom/main/migrations/0001_initial.py new file mode 100644 index 0000000000..f2237a99d5 --- /dev/null +++ b/acom/main/migrations/0001_initial.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding model 'Inventory' + db.create_table('inventory', ( + ('name', self.gf('django.db.models.fields.TextField')()), + ('description', self.gf('django.db.models.fields.TextField')()), + ('creation_date', self.gf('django.db.models.fields.DateField')()), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + )) + db.send_create_signal('main', ['Inventory']) + + + def backwards(self, orm): + # Deleting model 'Inventory' + db.delete_table('inventory') + + + models = { + 'main.inventory': { + 'Meta': {'object_name': 'Inventory', 'db_table': "'inventory'"}, + 'creation_date': ('django.db.models.fields.DateField', [], {}), + 'description': ('django.db.models.fields.TextField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.TextField', [], {}) + } + } + + complete_apps = ['main'] diff --git a/acom/events/__init__.py b/acom/main/migrations/__init__.py similarity index 100% rename from acom/events/__init__.py rename to acom/main/migrations/__init__.py diff --git a/acom/main/migrations/__init__.pyc b/acom/main/migrations/__init__.pyc new file mode 100644 index 0000000000..402ab7f623 Binary files /dev/null and b/acom/main/migrations/__init__.pyc differ diff --git a/acom/main/models.py b/acom/main/models.py new file mode 100644 index 0000000000..badadac3fc --- /dev/null +++ b/acom/main/models.py @@ -0,0 +1,21 @@ +from django.db import models + +class CommonModel(models.Model): + ''' common model for all object types that have these standard fields ''' + + class Meta: + abstract = True + + name = models.TextField() + description = models.TextField() + creation_date = models.DateField() + db_table = 'inventories' + +class Inventory(CommonModel): + + class Meta: + db_table = 'inventory' + + id = models.AutoField(primary_key=True) + + diff --git a/acom/main/models.pyc b/acom/main/models.pyc new file mode 100644 index 0000000000..d8cdc36a02 Binary files /dev/null and b/acom/main/models.pyc differ diff --git a/acom/audits/tests.py b/acom/main/tests.py similarity index 100% rename from acom/audits/tests.py rename to acom/main/tests.py diff --git a/acom/audits/views.py b/acom/main/views.py similarity index 100% rename from acom/audits/views.py rename to acom/main/views.py diff --git a/acom/orgs/__init__.py b/acom/orgs/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/acom/orgs/models.py b/acom/orgs/models.py deleted file mode 100644 index 71a8362390..0000000000 --- a/acom/orgs/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/acom/orgs/tests.py b/acom/orgs/tests.py deleted file mode 100644 index 2247054b35..0000000000 --- a/acom/orgs/tests.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -This file demonstrates two different styles of tests (one doctest and one -unittest). These will both pass when you run "manage.py test". - -Replace these with more appropriate tests for your application. -""" - -from django.test import TestCase - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.failUnlessEqual(1 + 1, 2) - -__test__ = {"doctest": """ -Another way to test that 1 + 1 is equal to 2. - ->>> 1 + 1 == 2 -True -"""} - diff --git a/acom/orgs/views.py b/acom/orgs/views.py deleted file mode 100644 index 60f00ef0ef..0000000000 --- a/acom/orgs/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/acom/permissions/__init__.py b/acom/permissions/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/acom/permissions/models.py b/acom/permissions/models.py deleted file mode 100644 index 71a8362390..0000000000 --- a/acom/permissions/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/acom/permissions/tests.py b/acom/permissions/tests.py deleted file mode 100644 index 2247054b35..0000000000 --- a/acom/permissions/tests.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -This file demonstrates two different styles of tests (one doctest and one -unittest). These will both pass when you run "manage.py test". - -Replace these with more appropriate tests for your application. -""" - -from django.test import TestCase - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.failUnlessEqual(1 + 1, 2) - -__test__ = {"doctest": """ -Another way to test that 1 + 1 is equal to 2. - ->>> 1 + 1 == 2 -True -"""} - diff --git a/acom/permissions/views.py b/acom/permissions/views.py deleted file mode 100644 index 60f00ef0ef..0000000000 --- a/acom/permissions/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/acom/projects/__init__.py b/acom/projects/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/acom/projects/models.py b/acom/projects/models.py deleted file mode 100644 index 71a8362390..0000000000 --- a/acom/projects/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/acom/projects/tests.py b/acom/projects/tests.py deleted file mode 100644 index 2247054b35..0000000000 --- a/acom/projects/tests.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -This file demonstrates two different styles of tests (one doctest and one -unittest). These will both pass when you run "manage.py test". - -Replace these with more appropriate tests for your application. -""" - -from django.test import TestCase - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.failUnlessEqual(1 + 1, 2) - -__test__ = {"doctest": """ -Another way to test that 1 + 1 is equal to 2. - ->>> 1 + 1 == 2 -True -"""} - diff --git a/acom/projects/views.py b/acom/projects/views.py deleted file mode 100644 index 60f00ef0ef..0000000000 --- a/acom/projects/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/acom/reports/__init__.py b/acom/reports/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/acom/reports/models.py b/acom/reports/models.py deleted file mode 100644 index 71a8362390..0000000000 --- a/acom/reports/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/acom/reports/tests.py b/acom/reports/tests.py deleted file mode 100644 index 2247054b35..0000000000 --- a/acom/reports/tests.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -This file demonstrates two different styles of tests (one doctest and one -unittest). These will both pass when you run "manage.py test". - -Replace these with more appropriate tests for your application. -""" - -from django.test import TestCase - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.failUnlessEqual(1 + 1, 2) - -__test__ = {"doctest": """ -Another way to test that 1 + 1 is equal to 2. - ->>> 1 + 1 == 2 -True -"""} - diff --git a/acom/reports/views.py b/acom/reports/views.py deleted file mode 100644 index 60f00ef0ef..0000000000 --- a/acom/reports/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/acom/settings.pyc b/acom/settings.pyc index 659ba05313..c24372f364 100644 Binary files a/acom/settings.pyc and b/acom/settings.pyc differ diff --git a/acom/teams/__init__.py b/acom/teams/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/acom/teams/models.py b/acom/teams/models.py deleted file mode 100644 index 71a8362390..0000000000 --- a/acom/teams/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/acom/teams/tests.py b/acom/teams/tests.py deleted file mode 100644 index 2247054b35..0000000000 --- a/acom/teams/tests.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -This file demonstrates two different styles of tests (one doctest and one -unittest). These will both pass when you run "manage.py test". - -Replace these with more appropriate tests for your application. -""" - -from django.test import TestCase - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.failUnlessEqual(1 + 1, 2) - -__test__ = {"doctest": """ -Another way to test that 1 + 1 is equal to 2. - ->>> 1 + 1 == 2 -True -"""} - diff --git a/acom/teams/views.py b/acom/teams/views.py deleted file mode 100644 index 60f00ef0ef..0000000000 --- a/acom/teams/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/acom/users/__init__.py b/acom/users/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/acom/users/models.py b/acom/users/models.py deleted file mode 100644 index 71a8362390..0000000000 --- a/acom/users/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/acom/users/tests.py b/acom/users/tests.py deleted file mode 100644 index 2247054b35..0000000000 --- a/acom/users/tests.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -This file demonstrates two different styles of tests (one doctest and one -unittest). These will both pass when you run "manage.py test". - -Replace these with more appropriate tests for your application. -""" - -from django.test import TestCase - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.failUnlessEqual(1 + 1, 2) - -__test__ = {"doctest": """ -Another way to test that 1 + 1 is equal to 2. - ->>> 1 + 1 == 2 -True -"""} - diff --git a/acom/users/views.py b/acom/users/views.py deleted file mode 100644 index 60f00ef0ef..0000000000 --- a/acom/users/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/app_setup/setup.yml b/app_setup/setup.yml new file mode 100644 index 0000000000..d490a03c89 --- /dev/null +++ b/app_setup/setup.yml @@ -0,0 +1,66 @@ +--- + +# tested only on CentOS6, may need adaptations for other operating systems +# TODO: install any ansible plugins we need +# TODO: set up Apache or Nginx to proxy this application +# TODO: setup celery and any worker processes/requirements + +- hosts: 127.0.0.1 + gather_facts: True + user: root + vars_files: + - vars/vars.yml + + tasks: + + - name: install packages + action: yum name=$item state=installed + with_items: + - postgresql # database client + - postgresql-server # database server + - Django # web stack + - Django-south # migration support + - python-django-tastypie # rest support + - python-psycopg2 + + # the following could probably be included, though ident identification is fiddly + # so we won't use it to create the database and database user + + - name: configure the database authentication more or less open for setup + template: src=templates/pg_hba_low.j2 dest=/var/lib/pgsql/data/pg_hba.conf + + - name: restart postgresql + service: name=postgresql state=restarted + + - name: setup the postgresql user + postgresql_user: > + name=ansible_commander + db=ansible_commander + password=${database_password} + login_user=postgres + priv=ALL + sudo_user: postgres + + - name: create the database + postgresql_db: name=acom state=present + + - name: configure the database authentication for runtime mode + template: src=templates/pg_hba.j2 dest=/var/lib/pgsql/data/pg_hba.conf + + - name: restart postgresql + service: name=postgresql state=restarted + + - name: configure python settings (with database password) + template: src=templates/settings.py.j2 dest=${working_dir}/acom/settings.py + + - name: sync Django database + shell: python ${working_dir}/acom/manage.py syncdb + + - name: sync django database + django_manage: > + command=syncdb + app_path=${working_dir}/acom + + #- name: run south migrations + # command: python ${working_dir}/acom/manage.py migrate db_migrate + diff --git a/app_setup/templates/config.j2 b/app_setup/templates/config.j2 new file mode 100644 index 0000000000..5950f1f8eb --- /dev/null +++ b/app_setup/templates/config.j2 @@ -0,0 +1,5 @@ +[database] +password={{ database_password }} + +[inventory] +secret=TheEnemysGateisDown diff --git a/app_setup/templates/db.j2 b/app_setup/templates/db.j2 new file mode 100644 index 0000000000..441cb920e8 --- /dev/null +++ b/app_setup/templates/db.j2 @@ -0,0 +1,53 @@ +CREATE USER ansible_commander UNENCRYPTED PASSWORD '{{ database_password }}'; + +GRANT ALL on DATABASE ansible_commander TO ansible_commander; +GRANT ALL on DATABASE ansible_commander_test TO ansible_commander; + +\c ansible_commander + +CREATE TABLE thing +( + id BIGSERIAL PRIMARY KEY, + type TEXT +); + +CREATE TABLE properties +( + id BIGSERIAL PRIMARY KEY, + thing_id BIGSERIAL NOT NULL REFERENCES thing(id) ON DELETE CASCADE, + key TEXT NOT NULL, + value TEXT +); + +CREATE UNIQUE INDEX properties_thing_idx ON properties (thing_id, key); +CREATE INDEX properties_key_idx ON properties (key); +CREATE INDEX properties_value_idx ON properties (key, value); +GRANT ALL on TABLE thing TO ansible_commander; +GRANT ALL on TABLE properties TO ansible_commander; +GRANT ALL ON SEQUENCE thing_id_seq TO ansible_commander; +GRANT ALL ON SEQUENCE properties_id_seq TO ansible_commander; + +\c ansible_commander_test + +CREATE TABLE thing +( + id BIGSERIAL PRIMARY KEY, + type TEXT +); + +CREATE TABLE properties +( + id BIGSERIAL PRIMARY KEY, + thing_id BIGSERIAL NOT NULL REFERENCES thing(id) ON DELETE CASCADE, + key TEXT NOT NULL, + value TEXT +); + +CREATE UNIQUE INDEX properties_thing_idx ON properties (thing_id, key); +CREATE INDEX properties_key_idx ON properties (key); +CREATE INDEX properties_value_idx ON properties (key, value); +GRANT ALL on TABLE thing TO ansible_commander; +GRANT ALL on TABLE properties TO ansible_commander; +GRANT ALL ON SEQUENCE thing_id_seq TO ansible_commander; +GRANT ALL ON SEQUENCE properties_id_seq TO ansible_commander; + diff --git a/app_setup/templates/pg_hba.j2 b/app_setup/templates/pg_hba.j2 new file mode 100644 index 0000000000..1d9c0a37f4 --- /dev/null +++ b/app_setup/templates/pg_hba.j2 @@ -0,0 +1,7 @@ +# Database administrative login by UNIX sockets +local all postgres ident + +# TYPE DATABASE USER CIDR-ADDRESS METHOD +local all all md5 +host all all 127.0.0.1/32 md5 +host all all ::1/128 md5 diff --git a/app_setup/templates/pg_hba_low.j2 b/app_setup/templates/pg_hba_low.j2 new file mode 100644 index 0000000000..4df8a874cc --- /dev/null +++ b/app_setup/templates/pg_hba_low.j2 @@ -0,0 +1,5 @@ +# temporary security setup for initial config only + +# TYPE DATABASE USER CIDR-ADDRESS METHOD +local all postgres trust + diff --git a/acom/settings.py b/app_setup/templates/settings.py.j2 similarity index 82% rename from acom/settings.py rename to app_setup/templates/settings.py.j2 index 78c35f832f..486821bc30 100644 --- a/acom/settings.py +++ b/app_setup/templates/settings.py.j2 @@ -11,12 +11,12 @@ MANAGERS = ADMINS DATABASES = { 'default': { - 'ENGINE': 'postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. - 'NAME': '', # Or path to database file if using sqlite3. - 'USER': '', # Not used with sqlite3. - 'PASSWORD': '', # Not used with sqlite3. - 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. - 'PORT': '', # Set to empty string for default. Not used with sqlite3. + 'ENGINE': 'postgresql_psycopg2', + 'NAME': 'acom', + 'USER': 'ansible_commander', + 'PASSWORD': '{{ database_password }}', + 'HOST': '', + 'PORT': '', } } @@ -27,7 +27,7 @@ DATABASES = { # timezone as the operating system. # If running in a Windows environment this must be set to the same as your # system time zone. -TIME_ZONE = 'America/NewYork' +TIME_ZONE = 'America/New_York' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html @@ -89,8 +89,11 @@ INSTALLED_APPS = ( 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', + 'main', + 'south', + # Uncomment the next line to enable the admin: - # 'django.contrib.admin', + #'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', ) diff --git a/app_setup/vars/vars.yml b/app_setup/vars/vars.yml new file mode 100644 index 0000000000..4962518171 --- /dev/null +++ b/app_setup/vars/vars.yml @@ -0,0 +1,2 @@ +--- +database_password: gateIsDown