1

While provisioning via Vagrant and Ansible I keep running into this issue.

TASK [postgresql : Create extensions] ******************************************
failed: [myapp] (item=postgresql_extensions) => {"changed": true, "cmd": "psql myapp -c 'CREATE EXTENSION IF NOT EXISTS postgresql_extensions;'", "delta": "0:00:00.037786", "end": "2017-04-01 08:37:34.805325", "failed": true, "item": "postgresql_extensions", "rc": 1, "start": "2017-04-01 08:37:34.767539", "stderr": "ERROR: could not open extension control file \"/usr/share/postgresql/9.3/extension/postgresql_extensions.control\": No such file or directory", "stdout": "", "stdout_lines": [], "warnings": []}

I'm using a railsbox.io generated playbook.

ditty_one
  • 81
  • 6

1 Answers1

2

Turns out that railsbox.io is still using a deprecated syntax in the task.

- name: Create extensions
  sudo_user: '{{ postgresql_admin_user }}'
  shell: "psql {{ postgresql_db_name }} -c 'CREATE EXTENSION IF NOT EXISTS {{ item }};'"
  with_items: postgresql_extensions
  when: postgresql_extensions

The last line should use full jinja2 syntax.

when: '{{postgresql_extensions}}'
ditty_one
  • 81
  • 6