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?
You could see if there is a module on the Puppet Forge, but failing that you can use
exec
resources with thecreates
argument (if the commands run create a specific file). Failing that, use theexec
resource but tack on atouch
command to create your own marker to keep the resource idempotent.E.G: