This policy ensures that memory_limit in php.ini is configured properly but the pattern is generically useful for any INI style config.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
  bundle agent php_customiztions
  {
    meta:

      (policy_server|am_policy_hub).enterprise_edition::
        "tags" slist => { "autorun" };

         "description" string => "Tune php fo 60k hosts in Mission Portal";
      
    vars:

        "php_ini[PHP][memory_limit]" string => "256M";

    files:

      policy_server.enterprise_edition::

        "/var/cfengine/httpd/php/lib/php.ini"
          edit_line => set_variable_values_ini( "$(this.bundle).php_ini", "PHP" );
  }