1. I have a class:
class templates-services-lamp-class {
...
$root_mysql_password = "password"
exec {"Set MySQL server root password":
require => Service ["mysql"],
onlyif => "mysqladmin -uroot status",
command => "mysqladmin -uroot password $root_mysql_password",
}
file {"/tmp/testfile":
ensure => present,
owner => root,
}
...
}
2. On another place in my file structure I have:
class classic-shared-database-mysql-class {
include templates-base-crontab-class
include templates-base-network-class
include templates-base-scripts-class
include templates-services-lamp-class <----------------
}
3. Then I define my node like this:
node testpuppetclient {
include classic-shared-database-mysql-class
}
Now my node has all the classes to be a 'generic sql server'
Now for my question: I want to override the mysql password on server level. I know a subclass can only override resources defined in a parent class, so this should work:
node testpuppetclient inherits templates-services-lamp-class {
$root_mysql_password = "other_password"
}
but it DOES NOT. Can you not override a variable then ?
4. Wat *does* work, is something like:
node testpuppetclient inherits templates-services-lamp-class {
File["/tmp/testfile"] { owner => someone_else }
}