Git Product home page Git Product logo

postgresql's People

Contributors

agmcleod avatar avokhmin avatar brad avatar ciphernaut avatar dtopolko avatar jeffwidman avatar kostyrev avatar leevs avatar restless-et avatar trikke76 avatar worldofchris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

postgresql's Issues

sometimes task installing dependencies fails

TASK: [patrik.uytterhoeven.PostgreSQL-For-RHEL6x | Install | Add PostgreSQL repository] *** 

changed: [host27.example.org]

TASK: [patrik.uytterhoeven.PostgreSQL-For-RHEL6x | Install | Make sure CentOS & RHEL dependencies are installed] *** 
failed: [host27.example.org] => {"changed": false, "failed": true, "rc": 0, "results": []}
msg: No Package matching 'python-psycopg2' found available, installed or updated

FATAL: all hosts have already failed -- aborting

can we add update_cache by default?

Newest version of CentOS breaks ansible's modules for postgres user/db modification

I updated to a newer version of CentOS 7 and also the latest stable version of Ansible and suddenly this playbook stopped working for creating users/databases.

Eventually I tracked it down to this playbook sets Postgres to listen on Unix socket /tmp/.s.PGSQL.5432 but the Ansible modules that handle Postgres user/db creation default to /var/run/postgresql/.s.PGSQL.5432

I haven't dug into it to check if Ansible changed where it looks, or if it gets the info from an underlying OS config which might have changed when I updated my CentOS 7 image.

The simple change is to enable listening on Unix socket /var/run/postgresql/.s.PGSQL.5432 by default.

[feature] Avoid unnecessary restart when postgresql.conf changes

Most postgresql.conf changes don't need a restart, just a reload. And a reload is much safer.

To avoid a restart except where essential, there are a few approaches.
One is documented at http://www.postgresql.org/message-id/[email protected]

My thought was to have postgresql.conf only include postgresql_needs_restart.conf and postgresql_needs_reload.conf. postgresql_needs_restart.conf would include the parameters mentioned in the above email thread.

If postgresql.conf or postgresql_needs_restart.conf changes, the restart postgresql handler is fired as now. But if postgresql_needs_reload.conf changes, a new reload postgresql handler is fired.

I'm happy to implement this but thought I'd see what your thoughts were first on whether it's a sensible approach or if there's anything I've missed.

No longer compatible with ansible 1.9.X

I recently started getting ERROR: block is not a legal parameter in an Ansible task or handler. It looks like a recent commit added the block parameter which only works with ansible 2.0. I'm just checking to see if this was a conscious change to drop support for earlier ansible versions, and if so, to request that the docs be updated to say that. Thanks!

role is not idempotent for CentOS7

task

- name: restart tmpfiles service
  command: systemd-tmpfiles --create
  when: ansible_distribution_major_version == '7'

reports "changed" every ansible run

Not compatible with postgres < 9.3

The config template has parameters that were introduced in 9.3:

LOG:  unrecognized configuration parameter "unix_socket_directories" in file "/var/lib/pgsql/9.2/data/postgresql.conf" line 59
LOG:  unrecognized configuration parameter "wal_sender_timeout" in file "/var/lib/pgsql/9.2/data/postgresql.conf" line 183
LOG:  unrecognized configuration parameter "wal_receiver_timeout" in file "/var/lib/pgsql/9.2/data/postgresql.conf" line 200
LOG:  unrecognized configuration parameter "lock_timeout" in file "/var/lib/pgsql/9.2/data/postgresql.conf" line 360
FATAL:  configuration file "/var/lib/pgsql/9.2/data/postgresql.conf" contains errors

Not working with postgresql 9.5

Works pretty fine with psql 9.4 on CentOS 7.2, but not with 9.5

Following error while running the playbook:

RUNNING HANDLER [patrik.uytterhoeven.PostgreSQL-For-RHEL6x : restart postgresql] ***
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Job for postgresql-9.5.service failed because the control process exited with error code. See \"systemctl status postgresql-9.5.service\" and \"journalctl -xe\" for details.\n"}
        to retry, use: --limit @playbooks/database/main.retry

PLAY RECAP *********************************************************************
localhost                  : ok=23   changed=15   unreachable=0    failed=1
systemctl status postgresql-9.5.service
โ— postgresql-9.5.service - PostgreSQL 9.5 database server
   Loaded: loaded (/etc/systemd/system/postgresql-9.5.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2016-04-13 07:51:19 CEST; 14s ago
  Process: 6342 ExecStart=/usr/pgsql-9.5/bin/pg_ctl start -D ${PGDATA} -s -w -t 300 (code=exited, status=1/FAILURE)
  Process: 6336 ExecStartPre=/usr/pgsql-9.5/bin/postgresql95-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)

Apr 13 07:51:18 nlihmoodle01.hosting.local systemd[1]: Starting PostgreSQL 9.5 database server...
Apr 13 07:51:18 nlihmoodle01.hosting.local pg_ctl[6342]: **LOG:  unrecognized configuration parameter "checkpoint_segments" in file "/var/lib/pgsql/9.5/data/postgresql.conf" line 161**
Apr 13 07:51:18 nlihmoodle01.hosting.local pg_ctl[6342]: **FATAL:  configuration file "/var/lib/pgsql/9.5/data/postgresql.conf" contains errors**
Apr 13 07:51:19 nlihmoodle01.hosting.local pg_ctl[6342]: pg_ctl: could not start server
Apr 13 07:51:19 nlihmoodle01.hosting.local pg_ctl[6342]: Examine the log output.
Apr 13 07:51:19 nlihmoodle01.hosting.local systemd[1]: postgresql-9.5.service: control process exited, code=exited status=1
Apr 13 07:51:19 nlihmoodle01.hosting.local systemd[1]: Failed to start PostgreSQL 9.5 database server.
Apr 13 07:51:19 nlihmoodle01.hosting.local systemd[1]: Unit postgresql-9.5.service entered failed state.
Apr 13 07:51:19 nlihmoodle01.hosting.local systemd[1]: postgresql-9.5.service failed.

Playbook:

  roles:
    - patrik.uytterhoeven.PostgreSQL-For-RHEL6x
  vars:
      postgresql_version: 9.5
      postgresql_admin_user: "postgres"
      postgresql_default_auth_method: "trust"

role is broken for CentOS 6 and postgresql93-server

NOTIFIED: [patrik.uytterhoeven.PostgreSQL-For-RHEL6x | restart postgresql] **** 
failed: [192.168.1.17] => {"failed": true}
msg: Stopping postgresql-9.3 service: [  OK  ]
Starting postgresql-9.3 service: [FAILED]
# grep FATAL pgstartup.log 
2015-07-18 21:40:00 UTC FATAL:  could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": No such file or directory

because template renders

# grep -i unix_socket postgresql.conf 
unix_socket_directories = '/tmp,/var/run/postgresql/'

and there's no such dir

# ll /var/run/postgresql
ls: cannot access /var/run/postgresql: No such file or directory

I just can't take ansible seriously because of that stuff.
Seems nobody cares at all about testing and such.
Every single role that I tried to use from galaxy had fatal problems. Sigh.

Yes, I can just to redefine postgresql_unix_socket_directories but come on - isn't it suppose to work by default?

I would suggest you to use test-kitchen or something.

yet another CentOS6 bug with 9.4

task

- name: Initialise Postgresql Database if it is not
  command: service postgresql{{ join_char | default("-")}}{{ postgresql_version }} initdb {{postgresql_cluster_name}}

silently fails for 9.4 with message

cat /var/lib/pgsql/9.4/pgstartup.log 
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

initdb: invalid locale name "data"

but it works with 9.3

postgresql_env

In defaults there's

postgresql_env:
  LC_ALL: "{{ postgresql_locale }}"
  LC_LCTYPE: "{{ postgresql_locale }}"

what is it for?
I've failed to find any mentions of it elsewhere in role.

please push tag

Hello!
I'm using requirements.yml to install roles and it would be great if your role could be referenced with branch or tag. Thus one can be sure that backward-incompatible changes in master won't affect users.

CentOS6 and initdb

task

- name: Initialise Postgresql Database if it is not
  command: service postgresql{{ join_char | default("-")}}{{ postgresql_version }} initdb {{postgresql_cluster_name}}
  when: data_dir.stat.exists == false and ansible_distribution_major_version == '6'

produces this warning in /var/lib/pgsql/9.3/pgstartup.log

initdb: invalid locale name "data"
initdb: invalid locale name "data"
initdb: invalid locale name "data"
initdb: invalid locale name "data"
initdb: invalid locale name "data"
initdb: invalid locale name "data"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.