Hi,
I am trying to add PHP 7.3 to some of my debian 9 boxes.
I am using puppetlabs/apache to setup apache and PHP. I want to add an apt repo (
sury.org) with PHP 7.3 to the system. I am using puppetlabs/apt for that
I am having problems to first add the repo, run apt update and then setup apache. Whatever I do, the 7.3 packets are not available. To make things more complex, the sury repo requires ssl meaning some more packages to be available upfront.
I found the following discussion on problems with puppetlabs/apt to run apt update after adding a source but I cannot get the solution outlined to work:
https://tickets.puppetlabs.com/browse/MODULES-2190
Here is my testing class:
class test_php {
# Apt::Source <| |> ~> Class['apt::update'] -> Package <| |>
include profile::base
ensure_packages([
'software-properties-common',
'dirmngr',
'apt-transport-https',
'lsb-release',
'ca-certificates',
])
exec { 'retrieve_sury_key':
command => "/usr/bin/wget -q
https://packages.sury.org/php/apt.gpg -O /etc/apt/trusted.gpg.d/sury-php.gpg",
creates => "/etc/apt/trusted.gpg.d/sury-php.gpg",
}
file { '/etc/apt/trusted.gpg.d/sury-php.gpg':
mode => '0755',
require => Exec["retrieve_sury_key"],
}
apt::source { 'sury_php':
comment => 'This is the Sury PHP package repo',
location => '
https://packages.sury.org/php/',
release => 'stretch',
repos => 'main ',
notify_update => true,
require => Package['software-properties-common', 'dirmngr', 'apt-transport-https', 'lsb-release', 'ca-certificates',],
}
class { 'apache':
default_vhost => true,
default_mods => false,
mpm_module => 'prefork',
}
class { 'apache::mod::php':
php_version => '7.3'
}
}
the commented line is the solution from the referenced ticket on apt, but it renders a circular dependency. The code as posted works on the second run, but gives the following error on the first run:
Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install libapache2-mod-php7.3' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libapache2-mod-php7.3
E: Couldn't find any package by glob 'libapache2-mod-php7.3'
E: Couldn't find any package by regex 'libapache2-mod-php7.3'
Error: /Stage[main]/Apache::Mod::Php/Apache::Mod[php7.3]/Package[libapache2-mod-php7.3]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install libapache2-mod-php7.3' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libapache2-mod-php7.3
E: Couldn't find any package by glob 'libapache2-mod-php7.3'
E: Couldn't find any package by regex 'libapache2-mod-php7.3'
Notice: /Stage[main]/Apache/File[/etc/apache2/conf.d]: Dependency Package[libapache2-mod-php7.3] has failures: true
Warning: /Stage[main]/Apache/File[/etc/apache2/conf.d]: Skipping because of failed dependencies
Notice: /Stage[main]/Apache::Mod::Php/File[php7.3.conf]: Dependency Package[libapache2-mod-php7.3] has failures: true
Warning: /Stage[main]/Apache::Mod::Php/File[php7.3.conf]: Skipping because of failed dependencies
I could not find any working solution anywhere, all examples available seem to be for pretty old code.
Thanks in advance, regards
Jochen