I'm a newbie and I might be missing something... but let me try to explain 
what I want to accomplish and how I would like to do it. 

I'm installing ssh by using the saz::ssh 
<https://github.com/saz/puppet-ssh>module. This module provision the 
sshd_config file with the ssh 
configuration. 

I need to tune the sshd_config file, so I have a module, say patxi::scstack 
that includes ssh and tries to overwrite the sshd_config by defining this 
file again:

class scstack_ssh {
  include ssh

  file { "/etc/ssh/sshd_config":
    content => template("scstack/sshd_config"),
  }
}

This approach fails as expected:

Duplicate declaration: File[/etc/ssh/sshd_config] is already declared in 
file /tmp/vagrant-puppet/modules-0/ssh/manifests/server/config.pp at line 
11; cannot redeclare at 
/tmp/vagrant-puppet/modules-0/scstack/manifests/scstack_ssh.pp:67

The alternative could be to fork the module saz::ssh and change the 
sshd_config file it provides to fit my needs. However, this seems odd to 
me. I want to use the ssh puppet module as is, without any modification, so 
as to be able to update this module if the original author makes changes to 
it. In my humble opinion having to modify modules to fit my needs limits 
reusing of puppet modules. 

My question is: how can I achieve what I want? I see different options but 
I would like to know how to do it "the puppet way":

   1. Modify the original ssh module to include my sshd_config file
   2. Modify the original ssh module to include a location parameter to use 
   as source ("puppet:///$location") for sshd (I don't know it parameters can 
   be used in place for puppet:// urls)
   3. Provision the file in my module using another name and do an exec to 
   rename it, overwriting the one generated by the ssh module
   4. ...Any other option?

Thanks in advance,
Patxi.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/wriHqScyRNMJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to