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

postgresql_info: provide pg_is_in_recovery() #1068

Closed
phemmer opened this issue Oct 9, 2020 · 9 comments · Fixed by #1091
Closed

postgresql_info: provide pg_is_in_recovery() #1068

phemmer opened this issue Oct 9, 2020 · 9 comments · Fixed by #1091
Labels
database feature This issue/PR relates to a feature request has_pr module module plugins plugin (any type) postgresql

Comments

@phemmer
Copy link

phemmer commented Oct 9, 2020

SUMMARY

The postgresql_info module should provide a variable containing the result of select pg_is_in_recovery().

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

I think it would make sense to put the value in the top level of the returned dict as is_in_recovery.

ADDITIONAL INFORMATION

This feature would allow the user to determine whether postgres is running as a replica slave, or standalone/master, and be able to skip tasks when so. This is important as when running tasks which update the database, you can only make changes to a master, and the changes then get replicated to the slave(s).

Could also be used in a loop when waiting for a restored database to finish start up.

@ansibullbot
Copy link
Collaborator

Files identified in the description:
None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot ansibullbot added affects_2.10 feature This issue/PR relates to a feature request needs_triage labels Oct 9, 2020
@kostiantyn-nemchenko
Copy link

!component =plugins/modules/database/postgresql/postgresql_info.py

@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@Andersson007
Copy link
Contributor

@phemmer hi, thanks for the feedback! Sounds good.
If anybody wants to add the feature, i'd be happy to review (if yes, please, before you start, put a comment here)

@Andersson007
Copy link
Contributor

I'm working on this

@Andersson007
Copy link
Contributor

Done #1091
@phemmer could you please take a look? If this is ok for you please put shipit there (in the PR).

@phemmer
Copy link
Author

phemmer commented Oct 14, 2020

That was fast. Probably would have gotten to it myself eventually, but who knows when that would have been :-)
Thanks!

@Andersson007
Copy link
Contributor

@phemmer thanks for the idea!

Next community.general release will be ~at the end of November, so you can install the collection from galaxy and use then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database feature This issue/PR relates to a feature request has_pr module module plugins plugin (any type) postgresql
Projects
None yet
4 participants