I know that we can specify relationship between resources, which determines the deployment order. But is it possible to create relationship between resources on different nodes in Puppet?
For example, I have apache web server in node A and mysql server in node B. I want to start mysql first before starting apache web server. How could I express this in Puppet language?
I have tried the following codes:
node ‘host1’ {
@@service { ‘mysql’:
ensure => running,
tag => ‘host1-mysql’,
}
}
node ‘host2’ {
service { ‘apache2’:
ensure => running,
}
Service<<| tag == ‘host1-mysql’ |>> -> Service[‘apache2’]
}
But it didn't work - produced a compile error. Any other solution?