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

[9.3 + 9.4] One 'postgresql.conf' template per version of PostgreSQL #66

Merged
merged 4 commits into from Mar 25, 2015

Conversation

Projects
None yet
6 participants
@sebalix
Copy link
Contributor

sebalix commented Feb 9, 2015

Hi,

This PR adds one 'postgresql.conf' file per version (9.3 + 9.4 here, previous versions could be added later). These files are the upstream ones, updated with the {{postgresql_*}} variables.

It fixes #47, and adds other options which were missing for the 9.3 version (autovacuum_multixact_freeze_max_age, vacuum_multixact_freeze_min_age and vacuum_multixact_freeze_table_age).

Regards,

@sebalix sebalix force-pushed the sebalix:master branch from 9a49bcb to fbb618d Feb 9, 2015

@sebalix sebalix changed the title [9.4] Add the 'max_replication_slots' option that comes with the version 9.4 [9.4] Add the new options that comes with the version 9.4 Feb 9, 2015

@sebalix sebalix force-pushed the sebalix:master branch 3 times, most recently from 916f6f9 to c2ccfe9 Feb 9, 2015

@clonedagain

This comment has been minimized.

Copy link
Contributor

clonedagain commented Feb 11, 2015

the role doesn't allow deploying PG9.4 without this change because of the removed keyword krb_srvname.
EDIT: from recent issues it seems the change would need to be more generic and allow an arbitrary number of versions

@clonedagain

This comment has been minimized.

Copy link
Contributor

clonedagain commented Feb 24, 2015

@sebalix at this stage, the best would be to provide one template config file per version (postgresql.conf-9.1.j2 ; postgresql.conf-9.2.j2 ; ..) and change the config task to:

- name: PostgreSQL | Update configuration - pt. 2 (postgresql.conf)
  template:
  src: postgresql.conf-{{postgresql_version}}.j2
  ...

Would you care to try this?

@sebalix

This comment has been minimized.

Copy link
Contributor

sebalix commented Feb 24, 2015

I agree, I prefer to do it this way too.

@pjan

This comment has been minimized.

Copy link
Contributor

pjan commented Feb 24, 2015

+1 for that solution @clonedagain. Opens it up to also target 9.3

@sebalix sebalix force-pushed the sebalix:master branch from c2ccfe9 to 1ee0a53 Feb 26, 2015

@sebalix

This comment has been minimized.

Copy link
Contributor

sebalix commented Feb 26, 2015

PR updated. Upstream configuration files have been added too (taken from the packages), it helps to compare the changes brought by next versions.

@sebalix sebalix changed the title [9.4] Add the new options that comes with the version 9.4 [9.3 + 9.4] One 'postgresql.conf' template per version of PostgreSQL Feb 26, 2015

@clonedagain

This comment has been minimized.

Copy link
Contributor

clonedagain commented Feb 26, 2015

Almost working...
Using pg 9.4 I still get a nonfunctional instance because the config file contains session_preload_libraries = '[]'
There's a join() missing in the template.

session_preload_libraries = '{{postgresql_session_preload_libraries}}'

@sebalix sebalix force-pushed the sebalix:master branch from e013441 to 312dc9e Feb 26, 2015

@sebalix

This comment has been minimized.

Copy link
Contributor

sebalix commented Feb 26, 2015

Rebased and fixed

@clonedagain

This comment has been minimized.

Copy link
Contributor

clonedagain commented Feb 26, 2015

👍 for me

@pjan

This comment has been minimized.

Copy link
Contributor

pjan commented Mar 3, 2015

Works for me.

Quite interesting to put the .orig files in it as well, where I used to copy everything in the defaults. Makes sense when you start supporting different versions.

@farridav has been spending some time on this role last week, so would be happy to also see his 🆗

@sebalix

This comment has been minimized.

Copy link
Contributor

sebalix commented Mar 5, 2015

Once this PR merged, I will do some other to support the previous versions, especially the 9.1.

@dukz

This comment has been minimized.

Copy link

dukz commented Mar 14, 2015

Hello, wondering if there is any schedule for a release of this feature?

@pjan

This comment has been minimized.

Copy link
Contributor

pjan commented Mar 14, 2015

@farridav care to review? If not, I will merge this in

@sebalix

This comment has been minimized.

Copy link
Contributor

sebalix commented Mar 24, 2015

Hi,
Any feedback on this?

@farridav

This comment has been minimized.

Copy link
Contributor

farridav commented Mar 24, 2015

Cool, I will take a look at this first thing tomorrow morning, 9am GMT and see if i can review 😄

@farridav farridav self-assigned this Mar 24, 2015

@farridav

This comment has been minimized.

Copy link
Contributor

farridav commented Mar 24, 2015

Actually just had a quick look through this, looking good.. and great to see we are testing multiple versions. I would still like another quick look tomorrow where ill test it then hopefully a merge. Great work guys!

@farridav

This comment has been minimized.

Copy link
Contributor

farridav commented Mar 25, 2015

Cool, I've had a look through, seems sane to me, I’ve tested both postgres versions 😄 we are unable to move from one to the other, but I think that’s not something we support anyhow..

Once rebased I'm happy to merge

It needs a rebase against master, conflicts are with .travis.yml.. To save me putting a PR into yours, here is the resolved file:

---

language: python
python: "2.7"
env:
  - POSTGRESQL_VERSION=9.3
  - POSTGRESQL_VERSION=9.4
before_install:
  - sudo apt-get update -qq
  - sudo apt-get install -qq python-apt python-pycurl locales
  - echo 'en_US.UTF-8 UTF-8' | sudo tee /var/lib/locales/supported.d/local
install:
  - pip install ansible==1.6.2
script:
  - echo localhost > inventory
  - ansible-playbook -i inventory test.yml --syntax-check
  - ansible-playbook -i inventory test.yml --connection=local --sudo -e "postgresql_version=$POSTGRESQL_VERSION"
  - >
    ansible-playbook -i inventory test.yml --connection=local --sudo -e "postgresql_version=$POSTGRESQL_VERSION"
    | grep -q 'changed=0.*failed=0'
    && (echo 'Idempotence test: pass' && exit 0)
    || (echo 'Idempotence test: fail' && exit 1)
@sebalix

This comment has been minimized.

Copy link
Contributor

sebalix commented Mar 25, 2015

Thanks, I will make a rebase today ASAP.

@sebalix sebalix force-pushed the sebalix:master branch from 312dc9e to 25f87d8 Mar 25, 2015

@farridav

This comment has been minimized.

Copy link
Contributor

farridav commented Mar 25, 2015

LGTM

farridav added a commit that referenced this pull request Mar 25, 2015

Merge pull request #66 from sebalix/master
[9.3 + 9.4] One 'postgresql.conf' template per version  of  PostgreSQL

@farridav farridav merged commit bf956b5 into ANXS:master Mar 25, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@onlydole

This comment has been minimized.

Copy link

onlydole commented Apr 6, 2015

Any word on when the Ansible Galaxy Repo will be updated for this issue?

@farridav

This comment has been minimized.

Copy link
Contributor

farridav commented Apr 6, 2015

I Will get a release put out tomorrow morning, ab 10AM GMT 😄

@farridav

This comment has been minimized.

Copy link
Contributor

farridav commented Apr 7, 2015

I have put up a release for this, the tag is v1.1.2 👍

@onlydole

This comment has been minimized.

Copy link

onlydole commented Apr 7, 2015

Thank you @farridav!

@pjan

This comment has been minimized.

Copy link
Contributor

pjan commented Apr 8, 2015

😄 thx @farridav

@dukz

This comment has been minimized.

Copy link

dukz commented Apr 9, 2015

Thanks guys. Needed this. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment