puppetlabs / puppetlabs/puppetlabs-postgresql

Deferred values don't seem to work for postgres_password (aka admin password)

Open
#1,560 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

community
Dominant language
Ruby
Stars
232
Forks
610
Avg merge
5d 23h
Merged PRs (30d)
4

Description

Describe the Bug

When passing a Deferred value to the postgres_password parameter I get the following error message:

Failed on [...]:
  Apply failed to compile for [...]: 'postgresql::postgresql_escape' parameter 'input_string' expects a String value, got Deferred (file: /[...]/.modules/postgresql/manifests/server/passwd.pp, line: 28, column: 16)

Expected Behavior

Expected deferred values to work, that is simply setting the value to the deferred value.

Steps to Reproduce

Setup a default instance and run something similar to the below:

class { '::postgresql::server':
    postgres_password => Deferred('unwrap', [$admin_password_vault]),
}

Environment

  • Version: 8.2.1 (also with 10.0.2)
  • Platform: CentOS 7

Additional Context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at .modules/postgresql/manifests/server/passwd.pp, line 28, where the postgres_password value reaches postgresql_escape. Reproduce the default server setup with Deferred('unwrap', [$admin_password_vault]) and trace the parameter handling. Done means the deferred value is accepted and the instance applies successfully without the String-type error.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.