sebastianrakel / puppet-gitea

Gitea Git Server Puppet Module
0 stars 5 forks source link

Node fails when using puppetlabs-postgresql and Foreman #20

Open VendettaMike opened 1 year ago

VendettaMike commented 1 year ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

Using Foreman as ENC. Foreman and puppet master are the same host Created a PostgreSQL host using puppetlabs-postgresql 8.2.1. Server is fully functional with database and roles for Gitea configured. Created a Gitea host and configured postgresql settings as required Performed puppet run on host which fails

What are you seeing

[root@git /]# /opt/puppetlabs/puppet/bin/puppet agent --test Info: Using environment 'production' Info: Retrieving pluginfacts Info: Retrieving plugin Info: Loading facts Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, 'versioncmp' parameter 'a' expects a String value, got Undef (file: /etc/puppetlabs/code/environments/production/modules/postgresql/manifests/server/role.pp, line: 137, column: 8) (file: /etc/puppetlabs/code/environments/production/modules/postgresql/manifests/server/db.pp, line: 40) on node git.xxxx.com Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run

Seems to be somewhat related to this

Attempted to update Postgresql role.pp file to use Globals and set DBVERSION in the ENC for the Git host but then it fails with UNDEF's in the database grant.

Any additional information you'd like to impart

ENC output for Git host: classes: gitea: app_name: xxxx Git Server database_host: xxx.xxx .xxx.xxx database_name: giteadb database_password: xxxxxx database_type: postgresql database_user: giteauser http_addr: git.xxxxx.com version: 1.19.1

Any idea how to get around this issue?

VendettaMike commented 1 year ago

After digging in more, I see that the module was designed for having Postgres on the same server as Gitea. I have forked and made changes to support remote servers which is trivial. It might be worth adding a config parameter to specify a local or remote server - remote servers of course would require that the database and grants are setup beforehand.

sebastianrakel commented 1 year ago

Hi, thanks for reaching out and sorry for my late answer. I'm currently on vaccation :) can you make a PR with the changes?