Skip to content

Commit

Permalink
(puppetlabs#1556) Fix Python package name for Ubuntu >= 22.04 and Deb…
Browse files Browse the repository at this point in the history
…ian 12

For Ubuntu 22.04 and Debian 12 and later the Python PostgreSQL package
is called "python3-psycopg2" so make that distinction in params.pp.
  • Loading branch information
antaflos authored and vaol committed Oct 13, 2024
1 parent 9393e6a commit a0c15e0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,15 @@
$perl_package_name = pick($perl_package_name, 'libdbd-pg-perl')
$plperl_package_name = pick($plperl_package_name, "postgresql-plperl-${version}")
$plpython_package_name = pick($plpython_package_name, "postgresql-plpython-${version}")
$python_package_name = pick($python_package_name, 'python-psycopg2')

$_ubuntu_2204 = ($facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['full'], '22.04') >= 0)
$_debian_12 = ($facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['full'], '12') >= 0)

if $_ubuntu_2204 or $_debian_12 {
$python_package_name = pick($python_package_name, 'python3-psycopg2')
} else {
$python_package_name = pick($python_package_name, 'python-psycopg2')
}

$bindir = pick($bindir, "/usr/lib/postgresql/${version}/bin")
$datadir = pick($datadir, "/var/lib/postgresql/${version}/main")
Expand Down

0 comments on commit a0c15e0

Please sign in to comment.