init.pp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
-solr { include sun-java package { "digg-solr": ensure => $digg_solr_version ? { "" => installed, default => $digg_solr_version }, "digg-solr-plugins": ensure => $digg_solr_plugins_version ? { "" => installed, default => $digg_solr_plugins_version }, notify => Service["jetty"]; } file { "/usr/local/solr": ensure => directory, owner => "search", group => "search", ["/usr/local/solr/solr", "/usr/local/solr/solr/conf", "/usr/local/solr/solr/bin"]: owner => "search", group => "search", ensure => directory, ["/usr/local/solr/solr/lib", "/usr/local/solr/solr/logs"]: owner => "search", group => "search", mode => 0664, recurse => true, "digg-solr::schema": owner => "search", group => "search", path => "/usr/local/solr/solr/conf/schema.xml", source => "puppet:///digg-solr/schema.xml", notify => Service["jetty"]; "digg-solr::scripts": owner => "search", group => "search", path => "/usr/local/solr/solr/conf/scripts.conf", source => "puppet:///digg-solr/scripts.conf", notify => Service["solr-rsync"]; "/home/search/.ssh": owner => "search", group => "search", mode => 0755, ensure => directory, "/etc/init.d/jetty": mode => 0755, source => "puppet:///digg-solr/jetty.init"; "/etc/default/jetty": source => "puppet:///digg-solr/jetty.default", notify => Service["jetty"]; "digg-solr::solrconfig.xml": owner => "search", group => "search", path => "/usr/local/solr/solr/conf/solrconfig.xml", ensure => present, notify => Service["jetty"]; "/etc/init.d/solr-rsync": mode => 0755, source => "puppet:///digg-solr/solr-rsync.init"; } group { "search": gid => 250, ensure => present; } user { "search": ensure => present, uid => 250, gid => "search", home => "/home/search", managehome => true, shell => "/bin/bash", } cron { "digg-solr::snapshot-cleaner": command => "/usr/local/solr/solr/bin/snapcleaner -D 7", ensure => absent, hour => 0, minute => 0, user => "search", "digg-solr::snapshot-puller": command => "/usr/local/solr/solr/bin/snappuller; /usr/local/solr/solr/bin/snapinstaller", ensure => absent, minute => "*/5", user => "search", } service { "jetty": enable => true, ensure => running, hasstatus => true, status => "/etc/init.d/jetty check"; "solr-rsync": enable => false, ensure => stopped, pattern => "rsync --daemon"; } exec { "digg-solr::set-ownership": command => "/bin/chown -R search:search /usr/local/solr", } } |
master.pp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
-solr inherits digg-solr { ssh_authorized_key { "digg-solr::slave_ssh_key": ensure => present, key => "AAAAB3NzaC1yc2EAAAABIwAAAQEAqzASnbVssP5cSMy0Yr5lawszrVVXm8IRUfb9Frxd4WUGQKFqPCiyG6B3HtGm30v0iqzvEh0sEy0MVRgOxxlY8K9QdN+FoDQTfpXbm5ceDlWVjaCh35lzPOLZCpiWPy9uorJWpzwlZDrem1EluSH0aUOk/UttAE/qvhmHwHVRbTzfKCrWtjtXDkma3drKVR9ne5H8xuy4xuVxZmPGy+iVfwfBRBpvmNGUdgDec9JpDHwJy6jG17oXFBnCaYlRp5FDTu40PvYuIbS3hkcPmg03TjwHZTYtcf+8L7YrQYy08zpHPXuZk4O3noXyH0gQG+IQGgnhSgm3KV6hW0KUbbJ9kw==", type => rsa, user => "search", } file { "/usr/local/solr/solr/status": owner => "search", group => "search", recurse => true, ensure => directory; "/usr/local/solr/solr/logs/rsyncd.pid": owner => search, group => search, mode => 0664; ["/usr/local/solr/solr/logs/snappuller.log", "/usr/local/solr/solr/logs/snappuller.status"]: ensure => absent, notify => Service["jetty"]; } exec { "digg-solr::master::rsyncd-enable": command => "/usr/local/solr/solr/bin/rsyncd-enable", creates => "/usr/local/solr/solr/logs/rsyncd-enabled", cwd => "/usr/local/solr/solr", "digg-solr::master::snappuller-disable": command => "/usr/local/solr/solr/bin/snappuller-disable", onlyif => "/usr/bin/test -f /usr/local/solr/solr/logs/snappuller-enabled", cwd => "/usr/local/solr/solr", } Cron["digg-solr::snapshot-cleaner"] { ensure => present } Service["solr-rsync"] { enable => true, ensure => running, } File["digg-solr::solrconfig.xml"] { source => "puppet:///digg-solr/solrconfig.xml.master" } } |
--debug --trace output
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
err: Could not create digg-solr: user search doesn't exist /usr/lib/ruby/1.8/puppet/type/ssh_authorized_key.rb:43:in `expand_path' /usr/lib/ruby/1.8/puppet/type/ssh_authorized_key:43:in `should' /usr/lib/ruby/1.8/puppet/type.rb:560:in `should' /usr/lib/ruby/1.8/puppet/type/ssh_authorized_key.rb:80:in `validate' /usr/lib/ruby/1.8/puppet/type:2367:in `initialize' /usr/lib/ruby/1.8/puppet/type.rb:1129:in `new' /usr/lib/ruby/1.8/puppet/type.rb:1129:in `create' /usr/lib/ruby/1.8/puppet/transportable:91:in `to_type' /usr/lib/ruby/1.8/puppet/transportable.rb:198:in `to_catalog' /usr/lib/ruby/1.8/puppet/transportable.rb:126:in `each' /usr/lib/ruby/1.8/puppet/transportable:126:in `each' /usr/lib/ruby/1.8/puppet/transportable.rb:195:in `to_catalog' /usr/lib/ruby/1.8/puppet/transportable.rb:204:in `call' /usr/lib/ruby/1.8/puppet/transportable:204:in `to_catalog' /usr/lib/ruby/1.8/puppet/transportable.rb:126:in `each' /usr/lib/ruby/1.8/puppet/transportable.rb:126:in `each' /usr/lib/ruby/1.8/puppet/transportable:195:in `to_catalog' /usr/lib/ruby/1.8/puppet/transportable.rb:204:in `call' /usr/lib/ruby/1.8/puppet/transportable.rb:204:in `to_catalog' /usr/lib/ruby/1.8/puppet/transportable:126:in `each' /usr/lib/ruby/1.8/puppet/transportable.rb:126:in `each' /usr/lib/ruby/1.8/puppet/transportable.rb:195:in `to_catalog' /usr/lib/ruby/1.8/puppet/transportable:210:in `call' /usr/lib/ruby/1.8/puppet/transportable.rb:210:in `to_catalog' /usr/lib/ruby/1.8/puppet/network/client/master.rb:172:in `getconfig' /usr/lib/ruby/1.8/puppet/network/client/master:245:in `run' /usr/lib/ruby/1.8/puppet/util.rb:425:in `thinmark' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/1.8/benchmark:307:in `realtime' /usr/lib/ruby/1.8/puppet/util.rb:424:in `thinmark' /usr/lib/ruby/1.8/puppet/network/client/master.rb:244:in `run' /usr/lib/ruby/1.8/sync:229:in `synchronize' /usr/lib/ruby/1.8/puppet/network/client/master.rb:237:in `run' /usr/sbin/puppetd:417 warning: Not using cache on failed catalog warning: Configuration could not be instantiated: user search doesn't exist |

