HackSoftware / cookiecutter-django-ansible

Powered by Cookiecutter, Cookiecutter Django Ansible is a framework for jumpstarting an ansible project for provisioning a server that is ready for your cookiecutter-django application.
MIT License
72 stars 8 forks source link

Something with PostgreSQL when try to use this playbook #35

Open polinom opened 7 years ago

polinom commented 7 years ago

Here is my first run and first issue. Not exactly sure what is going on.

$ ansible-playbook -i production sites.yml

PLAY [Provision db server] *****************************************************

TASK [setup] *******************************************************************
ok: [138.197.146.6]

TASK [ANXS.postgresql : include_vars] ******************************************
ok: [138.197.146.6] => (item=/usr/local/etc/ansible/roles/ANXS.postgresql/vars/../vars/Debian.yml)

TASK [ANXS.postgresql : PostgreSQL | Make sure the CA certificates are available] ***
ok: [138.197.146.6]

TASK [ANXS.postgresql : PostgreSQL | Add PostgreSQL repository apt-key] ********
changed: [138.197.146.6]

TASK [ANXS.postgresql : PostgreSQL | Add PostgreSQL repository] ****************
fatal: [138.197.146.6]: FAILED! => {"failed": true, "msg": "The conditional check 'postgresql_apt_repository' failed. The error was: expected token 'end of statement block', got 'http'\n  line 1\n\nThe error appears to have been in '/usr/local/etc/ansible/roles/ANXS.postgresql/tasks/install.yml': line 17, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: PostgreSQL | Add PostgreSQL repository\n  ^ here\n"}
    to retry, use: --limit @/Users/ipolynets/workspace/fundproj/sites.retry

PLAY RECAP *********************************************************************
138.197.146.6              : ok=4    changed=1    unreachable=0    failed=1
Ivaylo-Bachvarov commented 7 years ago

Hey,

What distribution of Linux are you using?

polinom commented 7 years ago

It's ubuntu (ubuntu.16.04.1 x64) the basic ubuntu image provided on Digital Ocean. I also had to install python on it by running apt-get install python-minimal. Not sure if that may be relevant to the issue.

Properly formated error:

The conditional check 'postgresql_apt_repository' failed. The error was: expected token 'end of statement block', got 'http'
  line 1

The error appears to have been in '/usr/local/etc/ansible/roles/ANXS.postgresql/tasks/install.yml': line 17, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: PostgreSQL | Add PostgreSQL repository
  ^ here
Ivaylo-Bachvarov commented 7 years ago

Hi,

This ansible code is tested only for ubuntu 14.04 LTS. I am going to test it for 16.04 this weekend.