Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ryanpineo
Copy link

I saw another PR for this but it was old and had backwards incompatible changes so I made a new one that is backwards compatible.

While working on it I thought it would be much nicer if the extensions key could be listed under each database like:

postgresql_databases:
  - name: foobar
    extensions:
      - hstore
      - citext

but that would make it backwards incompatible because the with_subelements loop can't handle missing keys. There is support for that in ansible v2 though so maybe in the future we could change it to use that.

So the new syntax for extensions is:

postgresql_database_extensions:
  - db: foobar
    extensions:
      - hstore
      - citext

goetzk added a commit to medeopolis/ansible-tendenci that referenced this pull request Nov 15, 2015
With the exception of the extensions this role should be able to do everything
I currently do (and might need).
Variable extensions support has been raised in github already (and code
available since August) ANXS/postgresql#96 . I've kept
my extensions code for now, renaming configure_postgres to
configure_postgres_extensions in the process.

Other than that there might be some debian compatibility issues (as it isn't
listed in the supported list) but I expect it'll DTRT.
@jesselang
Copy link
Contributor

I really like this change. Does it just need to be rebased to master to have it merged in?

@ryanpineo
Copy link
Author

should do

@farridav
Copy link

I welcome this change also, makes adding extensions alot easier too.. It will need a rebase against master (as @jesselang mentions) then id like to run a few test cases against it :)

@jesselang
Copy link
Contributor

Looks like this module would be the best way to implement adding extensions:

https://docs.ansible.com/ansible/postgresql_ext_module.html

It is part of ansible "extras", which may inhibit using it since it would introduce the specific requirement.

@farridav
Copy link

Good find @jesselang would certainly make adding extensions easier.. Can we alter this pr to use the existing module?

@farridav
Copy link

I'm looking to get something along these lines in this weekend, why did you choose to use shell over postgres_ext?

@farridav
Copy link

Ah, I can see that it came in with Ansible 1.9, and in this repo we support >=1.8.4 ...

@ryanpineo
Copy link
Author

Yes I believe that was the reason

@farridav
Copy link

Can you rebase this? I can then bring it in, and when we bump minimum_ansible_version to 1.9 I'll replace the shell with postgres_ext

@ryanpineo
Copy link
Author

rebased

@jesselang
Copy link
Contributor

Exciting!

@farridav
Copy link

@jesselang, perhaps you can close your or that adds new extensions once this is in, as you will be able to do it using the list ;)

@farridav
Copy link

Ok cool, good to go in, thanks for your contribution @ryanpineo :)

farridav pushed a commit that referenced this pull request Dec 17, 2015
@farridav farridav merged commit 9c0783c into ANXS:master Dec 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants