120: def setup
121:
122: if options[:debug] or options[:verbose]
123: if options[:debug]
124: Puppet::Util::Log.level = :debug
125: else
126: Puppet::Util::Log.level = :info
127: end
128:
129: unless Puppet[:daemonize] or options[:rack]
130: Puppet::Util::Log.newdestination(:console)
131: options[:setdest] = true
132: end
133: end
134:
135: Puppet::Util::Log.newdestination(:syslog) unless options[:setdest]
136:
137: exit(Puppet.settings.print_configs ? 0 : 1) if Puppet.settings.print_configs?
138:
139: Puppet.settings.use :main, :master, :ssl
140:
141:
142: Puppet::Node.cache_class = :yaml
143:
144:
145: if Puppet::SSL::CertificateAuthority.ca?
146: Puppet::SSL::Host.ca_location = :local
147: Puppet.settings.use :ca
148: Puppet::SSL::CertificateAuthority.instance
149: else
150: Puppet::SSL::Host.ca_location = :none
151: end
152: end