Hi

On 20 Jan 2014, at 7:34 am, Erwin Bogaard <erwin.boga...@gmail.com> wrote:

> Hi,
> 
> I'm looking into a way to manage the SugarCRM config.php (see partial example 
> below this message). This proposes several problems:
> 1. The file is full of arrays and arrays-in-arrays (So I think Augeas is 
> useless, as far as I understand it)
> 2. Not all config.php's contain the same arrays and/or key-value 
> combinations. It's possible that in one config.php a certain arrays is 
> needed, while it isn't in another and that teh value of a certain key needs 
> to be different and is set from SugarCRM. So to summarize: I don't want to 
> manage every array and key/value in config.php. (So I think and 
> config.erb-template is out of the question)

Using a template is the best way to manage it in my opinion.
If your dataset is that complex you would need to manage it for each individual 
node no matter which method you chose to utilise.
Using hiera will make that simple.

It’s not that tricky to generate entries in a template from an array.
It’s also not that tricky to use an inline_template to generate a variable.

> 3. I could use exec with sed and for every array and key/value I need to 
> manage, but that would probably make it quite complex (if possible at all), 
> as I need to check for existance first, and depending on the outcome, add the 
> array or key/value or change the existing pair.

This is the worst idea in my opinion. Please don’t go down that path. Managing 
that by itself will be a nightmare.

> The way I used to do this was manage config_override.php, in which you can 
> specify arrays and key/values which override the ones in config.php, with an 
> erb template. Problem with that, is that when you change something in the 
> SugarCRM-interface, it 's added/changed in config_override.php. Which is then 
> regularly overwritten by Puppet, so the change is reverted.
> 
> Does anyone have a good suggestion to manage this file reliably and with 
> reasonable complexity with Puppet?
> 
> -----
> Example file (partial):
> <?php
> $sugar_config = array (
>   'Reschedule' => 
>   array (
>     'version' => '2.0',
>   ),
>   'SAML_X509Cert' => '',
>   'SAML_loginurl' => '',
>   'addAjaxBannedModules' => 
>   array (
>     0 => 'AOS_Contracts',
>     1 => 'AOS_Invoices',
>     2 => 'AOS_Quotes',
>     3 => 'AOS_PDF_Templates',
>     4 => 'asol_Reports',
>     5 => 'Accounts',
>     6 => 'Contacts',
>     7 => 'Leads',
>     8 => 'Prospects',
>   ),
>   'admin_access_control' => false,
>   'admin_export_only' => false,
>   'aos' => 
>   array (
>     'version' => '5.3.2',
>     'contracts' => 
>     array (
>       'renewalReminderPeriod' => '14',
>     ),
>     'lineItems' => 
>     array (
>       'totalTax' => false,
>       'enableGroups' => true,
>     ),
>     'invoices' => 
>     array (
>       'initialNumber' => '1',
>     ),
>     'quotes' => 
>     array (
>       'initialNumber' => '1',
>     ),
>   ),
>   'authenticationClass' => '',
>   'cache_dir' => 'cache/',
>   'calculate_response_time' => true,
> ...
> ...
> );
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/e7c27236-f397-471e-b0ad-8e881e016a4b%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/F05138E5-ED9E-496D-BFD8-45925AEEC0EF%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to