Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create extensions with postgresql_ext instead of using psql #292

Closed
gclough opened this issue Mar 8, 2018 · 3 comments
Closed

Create extensions with postgresql_ext instead of using psql #292

gclough opened this issue Mar 8, 2018 · 3 comments

Comments

@gclough
Copy link
Collaborator

gclough commented Mar 8, 2018

Ansible has a native module to handle PostgreSQL extensions called postgresql_ext:

http://docs.ansible.com/ansible/latest/postgresql_ext_module.html

We should use that, instead of calling shell, which then calls psql.

@gclough
Copy link
Collaborator Author

gclough commented Mar 8, 2018

I tested this on the normal extensions part, and it seems to work:

- name: PostgreSQL | Add extensions to the databases
  postgresql_ext:
    db: "{{ item.0.db }}"
    login_user: "{{ postgresql_service_user }}"
    port: "{{ postgresql_port }}"
    name: "{{ item.1 }}"
  with_subelements:
    - "{{ postgresql_database_extensions }}"
    - extensions
  register: result

Who can test it for the rest of the cases (hstore,postgis, etc.)

@taybin
Copy link

taybin commented Jun 1, 2018

What's the status of this?

@gclough
Copy link
Collaborator Author

gclough commented Jun 1, 2018

This should be closed, as it was fixed in #307.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants