1

I'm trying to get PHP 7.4 installed on my RHEL 8 system with Puppet, but can't get the package declaration right to disable php and enable php:7.4 with dnf. The Puppet Package documentation doesn't describe well, and I wasn't able to learn anything from this post: Puppet 5.5.22, dnfmodule reset

Right now, Puppet installs 7.2, and then these commands are run manually to upgrade.

dnf module disable php
dnf module enable php:7.4
dnf upgrade php

How do I do this all with puppet?

1 Answers1

0

You could see if there is a module on the Puppet Forge, but failing that you can use exec resources with the creates argument (if the commands run create a specific file). Failing that, use the exec resource but tack on a touch command to create your own marker to keep the resource idempotent.

E.G:

exec {
  cmd => 'dnf module disable php && touch /etc/.dnf-php-disabled`
  creates => '/etc/.dnf-php-disabled'
}
shearn89
  • 3,143
  • 2
  • 14
  • 39