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 db names should allow dots #106

Closed
Andersson007 opened this issue Apr 3, 2020 · 4 comments · Fixed by #184
Closed

PostgreSQL db names should allow dots #106

Andersson007 opened this issue Apr 3, 2020 · 4 comments · Fixed by #184
Labels
bug This issue/PR relates to a bug has_pr module module

Comments

@Andersson007
Copy link
Contributor

Copied from original issue: ansible/ansible#66422 @raneq on 2020, 13 Jan

SUMMARY

Using postgresql database module can't contain dots, but should be able to, as escaped characters. Although it's not a good practice, it's supported by postgresql and under certain circumstances some applications force you to create databases with dots inside (like Odoo), so Ansible becomes the limiting agent here.

In #63204 I asked for this feature for users and dbs but @Andersson007 worked first on the user module and asked to create a new issue for the db module.

ISSUE TYPE

Bug Report

COMPONENT NAME

postgresql_db

ANSIBLE VERSION
ansible --version
ansible 2.8.2
  config file = None
  configured module search path = ['/home/USER/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.7/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.7.3 (default, Apr  3 2019, 05:39:12) [GCC 8.3.0]

AFAIK, the bug/feature hasn't been fixed/implemented at 2.9, so it is still relevant.

CONFIGURATION

(nothing)
OS / ENVIRONMENT
Debian 10 "Buster" running against localhost

STEPS TO REPRODUCE

Use this playbook in a Debian-like cleanable environment:

# playbook.yml
---
- hosts: localhost
  tasks:
    - name: Install PostgreSQL
      become: yes
      apt:
        name:
          - postgresql
          - python3-psycopg2
          - python2-psycopg2

    - name: PostgreSQL DB
      become: yes
      become_user: postgres
      postgresql_db:
        name: first.second

Then execute:

ansible-playbook playbook.yml --ask-become -vvv
EXPECTED RESULTS

I expected Ansible to create escaped names, as PostgreSQL supports it.

ACTUAL RESULTS
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "ca_cert": null,
            "conn_limit": "",
            "db": "first.second",
...
            "state": "present",
            "target": "",
            "target_opts": "",
            "template": ""
        }
    },
    "msg": "PostgreSQL does not support database with more than 1 dots"
COMMENTS

Please, don't close automatically this issue as long as there's people asking for this and there's no human saying it won't happen for some reason. Thanks!

RELATED

This issue follows the track of issues:

#63204 by @raneq
#22568 by @indreek

And these closed PR:

#22601 by @indreek
#30828 by @pilou-

And these discarded (why?) PR by @Andersson007 :

#64006
#64053
#64084
#64131

And these merged PR by @Andersson007

#64007
#63565
#63942

POTENTIALLY INTERESTED PEOPLE

People asking for a fix in the related issues and PR: @Spindel @padraiglennon @MannerMan @kmmbvnr @kyrofa @mridude23 Can you show your interest if this new issue is also meaningful to you?

Thank you everyobdy!

@Andersson007
Copy link
Contributor Author

the prev discussion is available on ansible/ansible#66422

@ansibullbot
Copy link
Collaborator

@Andersson007
Copy link
Contributor Author

there is one more similar pr without a review #198

@Andersson007
Copy link
Contributor Author

I created a new issue (general) #210 instead.
If anybody wants to practice contributing to Ansible, please let me know before starting working on new PRs:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug has_pr module module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants