Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/ansible.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: CI
on:
push:
workflow_dispatch:
jobs:
ansible-role:
uses: punktDe/shared-workflows/.github/workflows/ansible-role.yml@main
Comment on lines +2 to +8

Copilot AI Feb 16, 2026

Copy link

Choose a reason for hiding this comment

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

The previous CI defined explicit linting + a Molecule OS matrix in-repo; this workflow delegates everything to the shared workflow without showing what runs here. If the shared workflow doesn’t include the same lint/molecule coverage (and OS matrix), this change reduces CI signal for this role; consider documenting/encoding the required checks via inputs or an explicit matrix in this repo.

Copilot uses AI. Check for mistakes.

Copilot AI Feb 16, 2026

Copy link

Choose a reason for hiding this comment

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

The reusable workflow is referenced at punktDe/shared-workflows/...@main. Pin this to a tagged release or a specific commit SHA to avoid unreviewed changes in the shared workflow being pulled into CI (supply-chain risk) and to make builds reproducible.

Suggested change
uses: punktDe/shared-workflows/.github/workflows/ansible-role.yml@main
uses: punktDe/shared-workflows/.github/workflows/ansible-role.yml@<PINNED_TAG_OR_SHA>

Copilot uses AI. Check for mistakes.
secrets:
galaxy_api_key: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}
49 changes: 0 additions & 49 deletions .github/workflows/generate_readme.yml

This file was deleted.

61 changes: 0 additions & 61 deletions .github/workflows/test.yml

This file was deleted.

40 changes: 4 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ postgresql role for Proserver
|---|---|---|---|---|
| `version` | Major version of PostgreSQL to install/configure. Ignored on FreeBSD Proservers (version is determined by the system). | int | no | 13 |
| `prefix` | | dict of 'prefix' options | no | |
| `users` | Dict of PostgreSQL users to create (key is an arbitrary id, value defines the user). | dict of 'users' options | no | {} |
| `privileges` | Dict of privileges to assign (key is arbitrary id). Each entry grants a role access to a database or object. | dict of 'privileges' options | no | {} |
| `databases` | Dict of databases to create (key is arbitrary id). At least the root database entry is required by defaults. | dict of 'databases' options | no | |
| `users` | Dict of PostgreSQL users to create (key is an arbitrary id, value defines the user). Values should contain: username (str), password (str, optional), role_attributes (dict, optional), hosts (list, optional). | dict | no | |
| `privileges` | Dict of privileges to assign (key is arbitrary id). Each entry grants a role access to a database or object. Values should contain: username (str), database (str), type (str, default: table), objs (str, optional), schema (str, optional), privs (list). | dict | no | |
| `databases` | Dict of databases to create (key is arbitrary id). At least the root database entry is required by defaults. Values should contain: name (str), owner (str), encoding (str, optional), lc_collate (str, optional), lc_ctype (str, optional), template (str, optional), import_file (path, optional). | dict | no | |
| `database_defaults` | Defaults applied to database creation when not set per-database. | dict of 'database_defaults' options | no | |
| `postgresql.conf` | Key-value options written to the role-managed include file (ansible.conf), included from postgresql.conf. Consult PostgreSQL documentation for valid settings. | dict | no | |
| `repository` | Package repository used to install PostgreSQL (Linux/Debian). | dict of 'repository' options | no | |
Expand All @@ -38,39 +38,7 @@ postgresql role for Proserver

|Option|Description|Type|Required|Default|
|---|---|---|---|---|
| `config` | Directory for PostgreSQL configuration (e.g. pg_hba.conf, postgresql.conf include). Defaults depend on system; see defaults/main.yaml (e.g. /etc/postgresql/{{ version }}/main/conf.d on Linux). | str | no | |

#### Options for `postgresql.users`

|Option|Description|Type|Required|Default|
|---|---|---|---|---|
| `username` | Login name of the user. | str | no | |
| `password` | Password for the user (optional). | str | no | |
| `role_attributes` | Role attributes (e.g. SUPERUSER, CREATEROLE); values are joined for role_attr_flags. | dict | no | |
| `hosts` | List of client addresses (e.g. 127.0.0.1) for which a pg_hba.conf host entry is added. Used together with privileges to allow password authentication from those hosts. | list of 'str' | no | |

#### Options for `postgresql.privileges`

|Option|Description|Type|Required|Default|
|---|---|---|---|---|
| `username` | Role name to grant the privilege to. | str | no | |
| `database` | Database the privilege applies to. | str | no | |
| `type` | Type of object (e.g. table, database, schema). | str | no | table |
| `objs` | Object name(s) for the grant (optional for type database). | str | no | |
| `schema` | Schema name (optional). | str | no | |
| `privs` | List of privilege names (e.g. ALL, SELECT, INSERT). | list of 'str' | no | |

#### Options for `postgresql.databases`

|Option|Description|Type|Required|Default|
|---|---|---|---|---|
| `name` | Name of the database. | str | no | |
| `owner` | Owner of the database. Use ~<user_key> to reference a user from postgresql.users by key (e.g. ~molecule). | str | no | |
| `encoding` | Character encoding (defaults to database_defaults.encoding). | str | no | |
| `lc_collate` | Locale for collation order (defaults to database_defaults.lc_collate). | str | no | |
| `lc_ctype` | Locale for character classification (defaults to database_defaults.lc_ctype). | str | no | |
| `template` | Template database to use (defaults to database_defaults.template). | str | no | |
| `import_file` | Path to a dump file to restore into the database after creation (optional). | path | no | |
| `config` | Directory for PostgreSQL configuration (e.g. pg_hba.conf, postgresql.conf include). Defaults depend on system; see defaults/main.yaml (e.g. /etc/postgresql/{{ postgresql.version }}/main/conf.d on Linux). | str | no | |

#### Options for `postgresql.database_defaults`

Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ postgresql:
apt:
key_url: https://packagecloud.io/timescale/timescaledb/gpgkey
repository: |
deb https://packagecloud.io/timescale/timescaledb/{{ ansible_distribution | lower }}/ {{ ansible_distribution_release }} main
deb https://packagecloud.io/timescale/timescaledb/{{ ansible_facts['distribution'] | lower }}/ {{ ansible_facts['distribution_release'] }} main
package: timescaledb-2-postgresql-{{ postgresql_version }}
65 changes: 4 additions & 61 deletions meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,81 +19,24 @@ argument_specs:
type: "str"
description:
- Directory for PostgreSQL configuration (e.g. pg_hba.conf, postgresql.conf include).
- Defaults depend on system; see defaults/main.yaml (e.g. /etc/postgresql/{{ version }}/main/conf.d on Linux).
- Defaults depend on system; see defaults/main.yaml (e.g. /etc/postgresql/{{ postgresql.version }}/main/conf.d on Linux).
users:
type: "dict"
default: {}
description:
- Dict of PostgreSQL users to create (key is an arbitrary id, value defines the user).
options:
username:
type: "str"
description: Login name of the user.
password:
type: "str"
description: Password for the user (optional).
role_attributes:
type: "dict"
description: Role attributes (e.g. SUPERUSER, CREATEROLE); values are joined for role_attr_flags.
hosts:
type: "list"
elements: "str"
description:
- List of client addresses (e.g. 127.0.0.1) for which a pg_hba.conf host entry is added.
- Used together with privileges to allow password authentication from those hosts.
- "Values should contain: username (str), password (str, optional), role_attributes (dict, optional), hosts (list, optional)."

Copilot AI Feb 16, 2026

Copy link

Choose a reason for hiding this comment

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

postgresql.users no longer defines nested options (username/password/role_attributes/hosts) in the role argument spec and instead embeds the schema in free-text. This is a documentation/validation regression for tools consuming meta/argument_specs.yml (including your README generator); consider restoring the structured options block if you still want per-field docs and machine-checked inputs.

Suggested change
- "Values should contain: username (str), password (str, optional), role_attributes (dict, optional), hosts (list, optional)."
options:
username:
type: "str"
description:
- Name of the PostgreSQL role/user to create.
password:
type: "str"
description:
- Password for the user (optional; if omitted, passwordless or external auth may be used).
role_attributes:
type: "dict"
description:
- Additional role attributes for the user (optional; mapping of attribute names to values).
hosts:
type: "list"
elements: "str"
description:
- List of hosts for which this user should be allowed to connect (optional).

Copilot uses AI. Check for mistakes.
privileges:
type: "dict"
default: {}
description:
- Dict of privileges to assign (key is arbitrary id). Each entry grants a role access to a database or object.
options:
username:
type: "str"
description: Role name to grant the privilege to.
database:
type: "str"
description: Database the privilege applies to.
type:
type: "str"
default: "table"
description: Type of object (e.g. table, database, schema).
objs:
type: "str"
description: Object name(s) for the grant (optional for type database).
schema:
type: "str"
description: Schema name (optional).
privs:
type: "list"
elements: "str"
description: List of privilege names (e.g. ALL, SELECT, INSERT).
- "Values should contain: username (str), database (str), type (str, default: table), objs (str, optional), schema (str, optional), privs (list)."

Copilot AI Feb 16, 2026

Copy link

Choose a reason for hiding this comment

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

postgresql.privileges no longer defines nested options in the role argument spec and instead embeds the expected fields in a single description string. If you rely on structured argument spec docs/validation, restore the options block so individual fields (database/type/objs/schema/privs, etc.) are discoverable and type-checked.

Suggested change
- "Values should contain: username (str), database (str), type (str, default: table), objs (str, optional), schema (str, optional), privs (list)."
options:
username:
type: "str"
description: PostgreSQL role (user) to grant privileges to.
database:
type: "str"
description: Database on which to grant the privileges.
type:
type: "str"
default: table
description: Object type to grant privileges on (e.g. table).
objs:
type: "str"
description: Name or pattern of objects to which privileges apply (optional).
schema:
type: "str"
description: Schema containing the objects (optional).
privs:
type: "list"
elements: "str"
description: List of privileges to grant (e.g. SELECT, INSERT).

Copilot uses AI. Check for mistakes.
databases:
type: "dict"
description:
- Dict of databases to create (key is arbitrary id). At least the root database entry is required by defaults.
options:
name:
type: "str"
description: Name of the database.
owner:
type: "str"
description:
- Owner of the database. Use ~<user_key> to reference a user from postgresql.users by key (e.g. ~molecule).
encoding:
type: "str"
description: Character encoding (defaults to database_defaults.encoding).
lc_collate:
type: "str"
description: Locale for collation order (defaults to database_defaults.lc_collate).
lc_ctype:
type: "str"
description: Locale for character classification (defaults to database_defaults.lc_ctype).
template:
type: "str"
description: Template database to use (defaults to database_defaults.template).
import_file:
type: "path"
description: Path to a dump file to restore into the database after creation (optional).
- "Values should contain: name (str), owner (str), encoding (str, optional), lc_collate (str, optional), lc_ctype (str, optional), template (str, optional), import_file (path, optional)."

Copilot AI Feb 16, 2026

Copy link

Choose a reason for hiding this comment

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

postgresql.databases no longer defines nested options in the role argument spec and instead documents the expected keys in free-text. This reduces generated docs fidelity and prevents schema-aware validation; consider restoring the structured options block if that detail is still desired.

Suggested change
- "Values should contain: name (str), owner (str), encoding (str, optional), lc_collate (str, optional), lc_ctype (str, optional), template (str, optional), import_file (path, optional)."
options:
name:
type: "str"
required: true
description: Name of the PostgreSQL database to create.
owner:
type: "str"
required: true
description: PostgreSQL role that will own the database.
encoding:
type: "str"
required: false
description: Encoding for the database (e.g. UTF-8). If omitted, database_defaults.encoding is used.
lc_collate:
type: "str"
required: false
description: Locale for string sort order. If omitted, database_defaults.lc_collate is used.
lc_ctype:
type: "str"
required: false
description: Locale for character classification. If omitted, database_defaults.lc_ctype is used.
template:
type: "str"
required: false
description: Template database to copy when creating the database. If omitted, database_defaults.template is used.
import_file:
type: "path"
required: false
description: Path to an SQL file to import into the database after creation.

Copilot uses AI. Check for mistakes.
database_defaults:
type: "dict"
options:
Expand Down
2 changes: 2 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ platforms:
<<: *default_platform
provisioner:
name: ansible
env:
ANSIBLE_ROLES_PATH: ../../roles:../../../:~/.ansible/roles
playbooks:
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
verifier:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ansible>12.0.0
ansible-lint
docker
molecule<25.2.0
molecule
molecule-plugins
yamllint
requests
Expand Down
Loading