Fix setup.yml

This commit is contained in:
chouseknecht 2013-05-06 15:13:37 -04:00 committed by Chris Houseknecht
parent c1cc2a1e0b
commit 2afd8d44e7
2 changed files with 42 additions and 42 deletions

View File

@ -13,49 +13,49 @@
tasks:
# - name: remove python-dateutils package if installed
# yum: name=python-dateutils15 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)
#
# - name: install python modules from pip
# pip: requirements=${working_dir}/requirements.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=ansible_commander
# password=${database_password}
# login_user=postgres
# 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 owner=postgres
- name: remove python-dateutils package if installed
yum: name=python-dateutils15 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)
# - name: restart postgresql
# service: name=postgresql state=restarted
- name: install python modules from pip
pip: requirements=${working_dir}/requirements.txt
# - name: configure python settings (with database password)
# template: src=templates/local_settings.py.j2 dest=${working_dir}/lib/settings/local_settings.py
- 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=ansible_commander
password=${database_password}
login_user=postgres
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 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}/lib/settings/local_settings.py
- name: sync django database
command: python ${working_dir}/manage.py syncdb --noinput

View File

@ -51,7 +51,7 @@ function Authenticate($scope, $rootScope, $location, Authorization, ToggleClass,
});
})
.error( function(data, status, headers, config) {
if ( data && data.non_field_errors.length == 0 ) {
if ( data.non_field_errors && data.non_field_errors.length == 0 ) {
// show field specific errors returned by the API
for (var key in data) {
$scope[key + 'Error'] = data[key][0];