I'm doing my first steps in Puppet and ran into a problem. I've installed PHP on a Linux server and I want to do some slightly changes to php.ini
file. I don't want to overwrite the whole ini
file with one from repository, just change/create one simple config value.
I want to ensure, that the property upload_max_filesize
in php.ini
has the value of 10M
.
How can I achieve this?
There's basically 3 options:
Use augeas support in puppet (you'll need the ruby augeas libraries installed) like:
You can use "augtool ls /files/etc/php.ini" to see the sections to understand how augeas is parsing the file and use that to work out the paths you need.
You can use an exec. Something like:
Unfortunately, this solution doesn't understand the sections in php.ini, so adding a variable that's not already there would require extra effort. This will do the wrong thing if a variable appears in more than one section (but examples I'm looking at appear to have all unique variable names). This should work for a variable that's present but commented-out with a semi-colon.
source => 'puppet:///...'
orcontent => template(...)
to replace the file entirely, as you indicated you would prefer not to do.