1

I have 2 modules with class name has A-Class and B-Class. I want to make sure B-Class runs first and with A-Class when i run Puppet apply site.pp. But getting error as 'Syntax error at 'mongos'; expected '}' at require B-Class line, below is the code.

node 'HOST-1'{
    class { 'a_class':
            require b_class,
            first => "abcd",
            log_data_path => "/log/serv.1",
        }

    class { 'b_Class':
            build_id => "php_2.4",
        }
}

Is it the right way to use require? Else what is the better way to do.

TIA

Felix Frank
  • 8,125
  • 1
  • 23
  • 30
kittu deopa
  • 79
  • 2
  • 2
  • 12

2 Answers2

1

Almost right, but require is a parameter in its own right.

require => Class['a_class']

In this scenario, you could also use chaining arrows.

class { 'b_class': ... }
->
class { 'a_class': ... }

This will have the same effect.

Felix Frank
  • 8,125
  • 1
  • 23
  • 30
1

This is also right. But better way to do it is

class { 'a_class':
        first => "abcd",
        log_data_path => "/log/serv.1",
        require => Class['a_class']
   }
sharvil_parekh
  • 435
  • 2
  • 5
  • 12