optimization - Templating MySQL's my.cnf for setup in Puppet -
i have been tasked templating mysql's my.cnf in attempt standardize configuration amongst slave databases using puppet. right now, i'm targeting innodb settings. there configuration options can safely calculated against hardware specifications such memory, disk , procs?
you need facter.
puppet:/etc/puppet/modules/master/lib/facter$ cat disks.rb #!/usr/bin/ruby #require 'facter' mount = `/bin/mount` disks=array.new mount.split("\n").each_with_index { | disk,i | unless disk.scan(/ext3|simfs|reiserfs|xfs/).empty? d=disk.split[2] disks.push d disks.push ',' end } facter.add('disks') setcode disks end end
` , in puppet.pp use facts $disks
#add disk check zabbix exec { "create_host": command => "/bin/echo $fqdn $ipaddress $disks | do_work", require => file["/root/ticket"], subscribe => file["/root/ticket"], refreshonly => true, }
see "adding custom facts facter" on puppet labs.
Comments
Post a Comment