Kouen Kouen - 2 years ago 80
SQL Question

How would i use nested classes in Puppet for this example?

I am trying to install

for puppet from the forge, already installed properly
module, but i donĀ“t understand quite well the classes behaviour.
the example is below:

class drupal::db {

class { '::mysql::server':

# how would i access to ::mysql::server::mysqltuner???
# how do i should nest to make it work???
# how can i access the subclass of server "mysqltuner"??? what connector should i use???, I know it like some kind of path to the subclass.
# Which is the magic connector????
# Class Tested It works
# ::mysql::server::mysqltuner No
# ::mysqltuner No
# mysqltuner No
class { '::mysql::server::mysqltuner':
ensure => present

class { '::mysql::client':

I have tried several ways but it didnt work.
i have to use my own cfg file and i need to load mysqltuner so it works with my file.
I really appreciate any answer in the topic.

Kind Regards.


Answer Source

You're overthinking this. mysql::server::mysqltuner is not a nested class. It's just a name that represents a significance to mysql::server.


include ::mysql::server
include ::mysql::server::mysqltuner

The class { '::mysql::server': } syntax should generally be avoided if not needed.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download