If you add a parameter to a define, it is important to provide a default
that lets current code work without being modified.  If there is no
default, than any current user of the define will get an error.  This is
how one makes changes but retains backwards compatibility.

I'm not sure I understand the question, so apologies in advance if this is
not the answer you are looking for.

Is the concern that every time you call this define you will have to repeat
many, many parameters with the same values, with only a few being
different?  If that is the case, you can define some resource defaults.

Webhosting::Php::Spip(
  ensure                 => $variable1,
  configuration          => $variable2,
  uid                    => $variable3,
}

Now any time you call webhosting::php::sip(), you don't have to give the
ensure, configuration, or uid, parameters you want them to be $variable1,
$variable2, and $variable3 respectively.
(Note: These defaults have scope; they are not global.  More details are in
https://docs.puppetlabs.com/puppet/latest/reference/lang_defaults.html#area-of-effect)
 You can still override these new defaults by providing the parameters.

Hope that helps,
Tom

On Thu, Jun 11, 2015 at 10:22 AM, Sergiu Cornea <
[email protected]> wrote:

> Good afternoon guys,
>
> I have been assigned with the task of creating something like this:
> https://github.com/duritong/puppet-webhosting/tree/master/manifests
>  which I successfully implemented however, in order to add an extra
> variable you will have to add it in all your module manifests, say for
> example you want to add a debug variable you will need it to add it in each
> manifest file. My question is if this the right way to approach this? Or
> there is a better solution?
>
> define webhosting::php::spip( $ensure = present, $configuration = {}, $uid
> = 'absent', $uid_name = 'absent', $gid = 'uid', $gid_name = 'absent',
> $user_provider = 'local', $password = 'absent', $password_crypted = true,
> $domainalias = 'www', $server_admin = 'absent', $logmode = 'default',
> $owner = root, $group = 'sftponly', $run_mode = 'normal', $run_uid = '
> absent', $run_uid_name = 'absent', $run_gid = 'absent', $run_gid_name = '
> absent', $watch_adjust_webfiles = 'absent', $user_scripts = 'absent',
> $user_scripts_options = {}, $wwwmail = false, $allow_override = 'FileInfo'
> , $do_includes = false, $options = 'absent', $additional_options = 'absent
> ', $default_charset = 'absent', $ssl_mode = false, $php_settings = {},
> $php_options = {}, $vhost_mode = 'template', $template_partial = 'absent',
> $vhost_source = 'absent', $vhost_destination = 'absent', $htpasswd_file =
> 'absent', $nagios_check = 'ensure', $nagios_check_domain = 'absent',
> $nagios_check_url = '/', $nagios_check_code = '200', $nagios_use = '
> generic-service', $mod_security = true,){
> Thank you for you help!
>
> Regards,
> Cip
>
> This message and its attachments are private and confidential. If you have
> received this message in error, please notify the sender and remove it and
> its attachments from your system.
>
> The University of Westminster is a charity and a company
> limited by guarantee. Registration number: 977818 England.
> Registered Office: 309 Regent Street, London W1B 2UW.
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/a956fb4a-8f72-4e3b-9cd4-f8453de958b7%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/a956fb4a-8f72-4e3b-9cd4-f8453de958b7%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Email: [email protected]    Work: [email protected]
Skype: YesThatTom
Blog:  http://EverythingSysadmin.com

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAHVFxgm3o1hHd88Manb%3DA4uJKByQgvOiTL2r8ksCMffL4WZm2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to