Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ordering of classes in puppet

Tags:

puppet

I need to execute class mysql,tomcat before I execute code in class mypackage. In my site.pp I have

node 'node1' {
include mysql,mypackage,tomcat
}

How do I ensure the order of execution mysql->tomcat->mypackage

I tried putting this in /etc/puppet/modules/mypackage/manifests/init.pp but it did not work.

class mypackage {
    include mysql
    include tomcat
}
like image 997
user1191140 Avatar asked Jul 29 '15 01:07

user1191140


1 Answers

Please read this article about ordering in puppet. UPDATE: I recommend defining ordering relationships in your site.pp

    node 'node1' {
        include mysql,mypackage,tomcat
        Class['mysql'] -> Class['tomcat'] -> Class['mypackage']
    }

Please be aware of dependency cycles. It is really easy to create such cycle in puppet.

like image 193
kkamilpl Avatar answered Nov 15 '22 10:11

kkamilpl