From 54972c603825ce8d08255778217d8489fd46e946 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 4 Sep 2013 17:13:53 -0400 Subject: [PATCH] The app_setup directory is legacy, the setup directory is the current one. --- app_setup/setup.yml | 70 -------------- app_setup/templates/config.j2 | 5 - app_setup/templates/db.j2 | 53 ----------- app_setup/templates/local_settings.py.j2 | 114 ----------------------- app_setup/templates/pg_hba.j2 | 7 -- app_setup/templates/pg_hba_low.j2 | 5 - app_setup/vars/vars.yml | 2 - 7 files changed, 256 deletions(-) delete mode 100644 app_setup/setup.yml delete mode 100644 app_setup/templates/config.j2 delete mode 100644 app_setup/templates/db.j2 delete mode 100644 app_setup/templates/local_settings.py.j2 delete mode 100644 app_setup/templates/pg_hba.j2 delete mode 100644 app_setup/templates/pg_hba_low.j2 delete mode 100644 app_setup/vars/vars.yml diff --git a/app_setup/setup.yml b/app_setup/setup.yml deleted file mode 100644 index 6aa155080b..0000000000 --- a/app_setup/setup.yml +++ /dev/null @@ -1,70 +0,0 @@ ---- - -# 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: False - user: root - vars_files: - - vars/vars.yml - - tasks: - - - name: remove python-dateutil package if installed - yum: name=python-dateutil15 state=removed - - - name: install packages from yum - yum: name=$item state=installed - with_items: - - libyaml - - gcc - - python-pip - - postgresql # database client - - postgresql-server # database server - - python-psycopg2 # database library - - python-devel # only because pexpect comes from pip - - python-lxml # xml for ?format=xml instead of json (optional) - - # python-setuptools package is old (0.6.10, ~2009) vs. latest distribute (0.6.40) - #- name: install latest distribute from pypi - # pip: name=distribute state=latest - - #- name: install python modules via pip - # pip: requirements=${working_dir}/requirements/dev.txt - - - 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 owner=postgres - - - name: restart postgresql - service: name=postgresql state=restarted - - # took out parameter... db=acom priv=ALL - - name: setup the postgresql user - postgresql_user: > - name=awx - password=${database_password} - login_user=postgres - sudo_user: postgres - - - name: create the database - postgresql_db: name=awx state=present - - - name: configure the database authentication for runtime mode - template: src=templates/pg_hba.j2 dest=/var/lib/pgsql/data/pg_hba.conf owner=postgres - - - name: restart postgresql - service: name=postgresql state=restarted - - - name: configure python settings (with database password) - template: src=templates/local_settings.py.j2 dest=${working_dir}/awx/settings/local_settings.py - - - name: sync django database - command: python ${working_dir}/manage.py syncdb --noinput - - - name: run south migrations - command: python ${working_dir}/manage.py migrate main - - diff --git a/app_setup/templates/config.j2 b/app_setup/templates/config.j2 deleted file mode 100644 index 5950f1f8eb..0000000000 --- a/app_setup/templates/config.j2 +++ /dev/null @@ -1,5 +0,0 @@ -[database] -password={{ database_password }} - -[inventory] -secret=TheEnemysGateisDown diff --git a/app_setup/templates/db.j2 b/app_setup/templates/db.j2 deleted file mode 100644 index 441cb920e8..0000000000 --- a/app_setup/templates/db.j2 +++ /dev/null @@ -1,53 +0,0 @@ -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/local_settings.py.j2 b/app_setup/templates/local_settings.py.j2 deleted file mode 100644 index f89aabec91..0000000000 --- a/app_setup/templates/local_settings.py.j2 +++ /dev/null @@ -1,114 +0,0 @@ -# {{ ansible_managed }} -# Copyright (c) 2013 AnsibleWorks, Inc. -# All Rights Reserved. - -ADMINS = ( - # ('Your Name', 'your_email@domain.com'), -) - -MANAGERS = ADMINS - -# Database settings to use PostgreSQL for development. -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'awx', - 'USER': 'awx', - 'PASSWORD': '{{ database_password }}', - 'HOST': '', - 'PORT': '', - } -} - -# Use SQLite for unit tests instead of PostgreSQL. -if len(sys.argv) >= 2 and sys.argv[1] == 'test': - DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'awx.sqlite3'), - # Test database cannot be :memory: for celery/inventory tests. - 'TEST_NAME': os.path.join(BASE_DIR, 'awx_test.sqlite3'), - } - } - -# Absolute filesystem path to the directory to host projects (with playbooks). -# This directory should NOT be web-accessible. -PROJECTS_ROOT = os.path.join(BASE_DIR, 'projects') - -# Local time zone for this installation. Choices can be found here: -# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name -# although not all choices may be available on all operating systems. -# On Unix systems, a value of None will cause Django to use the same -# 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/New_York' - -# Language code for this installation. All choices can be found here: -# http://www.i18nguy.com/unicode/language-identifiers.html -LANGUAGE_CODE = 'en-us' - -# SECURITY WARNING: keep the secret key used in production secret! -# Hardcoded values can leak through source control. Consider loading -# the secret key from an environment variable or a file instead. -SECRET_KEY = 'p7z7g1ql4%6+(6nlebb6hdk7sd^&fnjpal308%n%+p^_e6vo1y' - -# HTTP headers and meta keys to search to determine remote host name or IP. Add -# additional items to this list, such as "HTTP_X_FORWARDED_FOR", if behind a -# reverse proxy. -REMOTE_HOST_HEADERS = ['REMOTE_ADDR', 'REMOTE_HOST'] - -# Email address that error messages come from. -SERVER_EMAIL = 'root@localhost' - -# The email backend to use. For possible shortcuts see django.core.mail. -# The default is to use the SMTP backend. -# Third-party backends can be specified by providing a Python path -# to a module that defines an EmailBackend class. -EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' - -# Host for sending email. -EMAIL_HOST = 'localhost' - -# Port for sending email. -EMAIL_PORT = 25 - -# Optional SMTP authentication information for EMAIL_HOST. -EMAIL_HOST_USER = '' -EMAIL_HOST_PASSWORD = '' -EMAIL_USE_TLS = False - -# Default email address to use for various automated correspondence from -# the site managers. -DEFAULT_FROM_EMAIL = 'webmaster@localhost' - -# Subject-line prefix for email messages send with django.core.mail.mail_admins -# or ...mail_managers. Make sure to include the trailing space. -EMAIL_SUBJECT_PREFIX = '[AWX] ' - -# Enable logging to syslog. Setting level to ERROR captures 500 errors, -# WARNING also logs 4xx responses. -LOGGING['handlers']['syslog'] = { - 'level': 'WARNING', - 'filters': [], - 'class': 'logging.handlers.SysLogHandler', - 'address': '/dev/log', - 'facility': 'local0', - 'formatter': 'simple', -} - -# Enable the following lines to also log to a file. -#LOGGING['handlers']['file'] = { -# 'class': 'logging.FileHandler', -# 'filename': os.path.join(BASE_DIR, 'awx.log'), -# 'formatter': 'simple', -#} - -# Enable the following lines to turn on lots of permissions-related logging. -#LOGGING['loggers']['awx.main.access']['propagate'] = True -#LOGGING['loggers']['awx.main.signals']['propagate'] = True -#LOGGING['loggers']['awx.main.permissions']['propagate'] = True - -# Define additional environment variables to be passed to subprocess started by -# the celery task. -#AWX_TASK_ENV['FOO'] = 'BAR' diff --git a/app_setup/templates/pg_hba.j2 b/app_setup/templates/pg_hba.j2 deleted file mode 100644 index 1d9c0a37f4..0000000000 --- a/app_setup/templates/pg_hba.j2 +++ /dev/null @@ -1,7 +0,0 @@ -# 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 deleted file mode 100644 index 4df8a874cc..0000000000 --- a/app_setup/templates/pg_hba_low.j2 +++ /dev/null @@ -1,5 +0,0 @@ -# temporary security setup for initial config only - -# TYPE DATABASE USER CIDR-ADDRESS METHOD -local all postgres trust - diff --git a/app_setup/vars/vars.yml b/app_setup/vars/vars.yml deleted file mode 100644 index 4962518171..0000000000 --- a/app_setup/vars/vars.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -database_password: gateIsDown