Puppet: relations between resources on different nodes

I know that we can indicate a relationship between resources that determines the deployment order. But is it possible to create a relationship between resources on different nodes in Puppet?

For example, I have an apache web server in node A and a mysql server in node B. I want to start mysql first before starting the apache web server. How can I put it in puppet language?


I 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 this did not work - a compilation error occurred. Any other solution?

+4
source share
4 answers

In the distributed "puppet", the application procedure is not guaranteed.

Puppet . , , , .

node. , (, db, - sql) hiera, , "db" "app".

. , mcollective, capistrano, ansible,...

+5

, , metapareter , , ->. , , metaparameter ~>. , , .

.

init.pp, / , include :

class {"taskname":} -> class {"taskname2":}
, 2.

0

googling puppet node dependency , .

http://docs.puppetlabs.com/puppet/latest/reference/lang_exported.html

.

node, , node, , , .

MCollective , , , .

0

, Puppet. , Puppet node, . , ( , , , ).

, enable => running .

, :

  • , , ( ).
  • Ubuntu juju , , , , .
  • , - .
0

All Articles