class - классы¶
class helloworld {
notify {
'hello, world!':}
}
class hello($name) {
notify {
'hello, $name!':}
}
class { 'hello': name => 'ilnurgi'}
# вызов класса
class {'helloworld':}
# наследованеи классов
class unix {
file {
'/etc/passwd':
owner => 'root',
group => 'root',
mode => '0644',
}
file {
'/etc/shadow':
owner => 'root',
group => 'root',
mode => '0440',
}
}
class freebsd inherits unix {
File['/etc/passwd', '/etc/shadow'] {
group => 'wheel', owner => undef
}
}