70 likes | 245 Views
Puppet for messaging lessons learnt. Robert Ve žnaver IT/SDC /MI 10/3/2014. Puppet installation at CERN. environment. hostgroup. environment. module. subhostgroup. subhostgroup. module. Puppet syntax checking. puppet parser validate foo.pp puppet-lint foo.pp.
E N D
Puppet for messaginglessons learnt Robert Vežnaver IT/SDC/MI 10/3/2014
Puppet installation at CERN environment hostgroup environment module subhostgroup subhostgroup module Puppet for messaging - lessons learnt
Puppet syntax checking puppet parser validate foo.pp puppet-lint foo.pp Puppet for messaging - lessons learnt
Hierarchical Hiera data --- #host.yaml var_global:&defaults val1: 1 val2: 2 var_local: <<: *defaults val1: 0 --- #group.yaml var_global: val1: 1 val2: 2 --- #host.yaml(+wrapper) vars: - var_global Puppet for messaging - lessons learnt
Is it a module, class, or type? • module should be a service • classes are singletons • defined types are repeatable chunks • composed of other resources • must access independent resources Puppet for messaging - lessons learnt
Create resource from Hiera --- #host.yaml foo: instance1: http_port: '8080' https_port: '8443' instance2: http_port: '9080' https_port: '9443’ host.pp: $foo = hiera(’foo', []) create_resources('tomcat::instance', $foo) Puppet for messaging - lessons learnt
AI tools ai-pdbhostgroup<hostgroup> ai-dump <host> --facts <fact1,fact2,factn> ai-hiera -n <host> ’<hiera_variable>' Puppet for messaging - lessons learnt