ansible-collections / community.postgresql

Manage PostgreSQL with Ansible
https://galaxy.ansible.com/ui/repo/published/community/postgresql/
Other
111 stars 90 forks source link

pg15+ show shared_memory_size and sharedmemory_size_in_huge_pages in postgresql_info output #747

Closed hunleyd closed 1 month ago

hunleyd commented 1 month ago
SUMMARY

We should return the shared_memory_size and shared_memory_size_in_huge_pages (linux) as part of our info. This should probably happen after #746

ISSUE TYPE
COMPONENT NAME

postgresql_info

ADDITIONAL INFORMATION
- name: Collect PostgreSQL version and extensions
  become: true
  become_user: postgres
  community.postgresql.postgresql_info:
  register: 'pginfo'

- ansible.builtin.debug:
    msg: "{{ pginfo['shared_memory_size'] }}"

- asible.builtin.debug:
    msg: "{{ pginfo['shared_memory_size_in_huge_pages'] }}"
      - pginfo['huge_pages_status']
hunleyd commented 1 month ago

thoughts @Andersson007 ?

Andersson007 commented 1 month ago

@hunleyd SGTM, thanks for reporting the feature request, SGTM, would you like to add it yourself? If no, please add the help wanted label

hunleyd commented 1 month ago

i've added the label. i'd love to look at it myself, but if someone can get to it faster, that's great.

Andersson007 commented 1 month ago

I've checked and the module returns:

        "shared_memory_size": {
            "boot_val": "0",
            "context": "internal",
            "max_val": "2147483647",
            "min_val": "0",
            "pending_restart": false,
            "pretty_val": "143MB",
            "setting": "143",
            "sourcefile": "",
            "unit": "MB",
            "val_in_bytes": 149946368,
            "vartype": "integer"
        },
        "shared_memory_size_in_huge_pages": {
            "boot_val": "-1",
            "context": "internal",
            "max_val": "2147483647",
            "min_val": "-1",
            "pending_restart": false,
            "pretty_val": "72",
            "setting": "72",
            "sourcefile": "",
            "unit": "",
            "vartype": "integer"
        },

Is it what we want?

hunleyd commented 1 month ago

I don't see 'shared_*' (except shared_buffers) on https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_info_module.html#return-in_recovery anywhere in the returned values section. am i missing it?

Andersson007 commented 1 month ago

I suggest https://github.com/ansible-collections/community.postgresql/issues/749#issuecomment-2416820898