How to extend a file definition from an existing module in the node?
        Posted  
        
            by 
                c33s
            
        on Server Fault
        
        See other posts from Server Fault
        
            or by c33s
        
        
        
        Published on 2012-10-15T19:54:16Z
        Indexed on 
            2012/10/15
            21:39 UTC
        
        
        Read the original article
        Hit count: 221
        
puppet
I use an older version of the example42 mysql module, which defines the mysql.conf file but not its content. Mmy goal is to just include the mysql module and add a content definition in the node.
class mysql {
    ...
    file { "mysql.conf":
        path => "${mysql::params::configfile}",
        mode => "${mysql::params::configfile_mode}",
        owner => "${mysql::params::configfile_owner}",
        group => "${mysql::params::configfile_group}",
        ensure => present,
        require => Package["mysql"],
        notify => Service["mysql"],
    }
    ...
}
node xyz
{
    include mysql
    File["mysql.conf"] { content => template("mymodule/mysql.conf.erb")}
}
The above code produces a "Only subclasses can override parameters"
What is the correct way to just add a content definition to an existing file definition?
© Server Fault or respective owner