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

Add SSL support to postgresql_schema module #44482

Merged
merged 1 commit into from
Nov 10, 2018

Conversation

andytom
Copy link
Contributor

@andytom andytom commented Aug 21, 2018

SUMMARY

Have added some extra arguments to the postgresql_schema module to allow
configuring an SSL connection to the postgresql server. The arguments
and method used here for the connection are the same as used by the
postgresql_database module.

Related to #39906

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

postgresql_schema

ANSIBLE VERSION
2.5.0
ADDITIONAL INFORMATION

You can now use the same ssl configuration arguments as the postgresql_database module for the postgresql_schema module. For example:

- name: Ensure bob owns the acme schema
  postgresql_schema:
    login_host: psql.example.com
    login_user: example_user
    login_password: super-secret-password
    ssl_rootcert: /path/to/ssl/cert
    ssl_mode: verify-full

    database: example_db
    name: acme
    owner: bob

try:
db_connection = psycopg2.connect(database=database, **kw)
db_connection = psycopg2.connect(**kw)
# Enable autocommit so we can create databases
if psycopg2.__version__ >= '2.4.2':
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if enabling auto-commit is required for this module.

@ansibot
Copy link
Contributor

ansibot commented Aug 21, 2018

The test ansible-test sanity --test pylint [explain] failed with 1 error:

lib/ansible/modules/database/postgresql/postgresql_schema.py:239:42: undefined-variable Undefined variable 'sslrootcert'

click here for bot help

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 ci_verified Changes made in this PR are causing tests to fail. feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. support:community This issue/PR relates to code supported by the Ansible community. labels Aug 21, 2018
@andytom andytom force-pushed the feature/postgresql_schema_ssl branch from 3e3dabf to 05e232f Compare August 21, 2018 19:33
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Aug 21, 2018
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Aug 23, 2018
@ansibot
Copy link
Contributor

ansibot commented Aug 28, 2018

@ansibot ansibot removed the needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) label Aug 28, 2018
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Sep 5, 2018
@andytom andytom closed this Sep 5, 2018
@andytom andytom reopened this Sep 5, 2018
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Sep 5, 2018
@andytom andytom force-pushed the feature/postgresql_schema_ssl branch from 05e232f to 117d25a Compare September 5, 2018 19:56
@andytom
Copy link
Contributor Author

andytom commented Sep 9, 2018

@matburt, would it be possible to get a quick review of this and let me know if there is anything that I need to change?

@andytom andytom force-pushed the feature/postgresql_schema_ssl branch from 117d25a to 867b5f9 Compare September 9, 2018 15:13
@andytom andytom force-pushed the feature/postgresql_schema_ssl branch from 867b5f9 to 307cfdd Compare September 16, 2018 16:51
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed community_review In order to be merged, this PR must follow the community review workflow. support:community This issue/PR relates to code supported by the Ansible community. labels Sep 16, 2018
@ansibot ansibot added the support:community This issue/PR relates to code supported by the Ansible community. label Oct 2, 2018
@Dorn-
Copy link
Contributor

Dorn- commented Oct 2, 2018

sgtm 👍

@andytom
Copy link
Contributor Author

andytom commented Oct 2, 2018

sgtm 👍

@Dorn- I think you need to comment shipit for the bot to count an approval (https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md#cmd-shipit).

@Dorn-
Copy link
Contributor

Dorn- commented Oct 2, 2018

I don't think that I am a maintainer, but let's try it :)

@Dorn-
Copy link
Contributor

Dorn- commented Oct 2, 2018

shipit

@andytom
Copy link
Contributor Author

andytom commented Oct 2, 2018

bot_status

@ansibot
Copy link
Contributor

ansibot commented Oct 2, 2018

Components

lib/ansible/modules/database/postgresql/postgresql_schema.py
support: community
maintainers: matburt

Metadata

waiting_on: maintainer
changes_requested_by: null
needs_info: False
needs_revision: False
needs_rebase: False
merge_commits: []
too many files or commits: False
mergeable_state: clean
shippable_status: success
maintainer_shipits (module maintainers): 0
community_shipits (namespace maintainers): 1
ansible_shipits (core team members): 0
shipit_actors (maintainers or core team members): Dorn-
shipit_actors_other: []
automerge: automerge shipit test failed

click here for bot help

@andytom
Copy link
Contributor Author

andytom commented Oct 2, 2018

I don't think that I am a maintainer, but let's try it :)

@Dorn-, I assumed you were the maintainer because you are the author in the module docs, oh well.

@matburt, I think this is just waiting on you now.

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Oct 10, 2018
@andytom andytom force-pushed the feature/postgresql_schema_ssl branch from a89ced4 to 03798ed Compare October 11, 2018 10:52
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Oct 11, 2018
@andytom andytom force-pushed the feature/postgresql_schema_ssl branch from 03798ed to b2ac90c Compare October 19, 2018 16:19
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Oct 29, 2018
@andytom andytom force-pushed the feature/postgresql_schema_ssl branch from b2ac90c to 1fd32e9 Compare October 29, 2018 09:16
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Oct 29, 2018
@andytom
Copy link
Contributor Author

andytom commented Oct 29, 2018

ready_for_review

@andytom
Copy link
Contributor Author

andytom commented Oct 30, 2018

+label affects_2.8
-label affects_2.7

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Nov 7, 2018
Have added some extra arguments to the postgresql_schema module to allow
configuring an SSL connection to the postgresql server. The arguments
and method used here for the connection are the same as used by the
postgresql_database module.
@andytom andytom force-pushed the feature/postgresql_schema_ssl branch from 1fd32e9 to 1e4b987 Compare November 8, 2018 09:12
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Nov 8, 2018
@caphrim007 caphrim007 merged commit 0db06b9 into ansible:devel Nov 10, 2018
@andytom andytom deleted the feature/postgresql_schema_ssl branch November 11, 2018 10:35
Ghilli3 pushed a commit to Ghilli3/ansible that referenced this pull request Nov 12, 2018
Have added some extra arguments to the postgresql_schema module to allow
configuring an SSL connection to the postgresql server. The arguments
and method used here for the connection are the same as used by the
postgresql_database module.
mjmayer pushed a commit to mjmayer/ansible that referenced this pull request Nov 30, 2018
Have added some extra arguments to the postgresql_schema module to allow
configuring an SSL connection to the postgresql server. The arguments
and method used here for the connection are the same as used by the
postgresql_database module.
Tomorrow9 pushed a commit to Tomorrow9/ansible that referenced this pull request Dec 4, 2018
Have added some extra arguments to the postgresql_schema module to allow
configuring an SSL connection to the postgresql server. The arguments
and method used here for the connection are the same as used by the
postgresql_database module.
@dagwieers dagwieers added postgresql PostgreSQL community database Database category labels Feb 7, 2019
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 community_review In order to be merged, this PR must follow the community review workflow. database Database category feature This issue/PR relates to a feature request. module This issue/PR relates to a module. new_contributor This PR is the first contribution by a new community member. postgresql PostgreSQL community support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants