Guest User

Untitled

a guest
Dec 25th, 2017
634
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.48 KB | None | 0 0
  1. root@puppet:/etc/puppet# cat puppet.conf
  2. [master]
  3. storeconfigs = true
  4. dbadapter = mysql
  5. dbuser = puppet
  6. dbpassword = pupp3t
  7. dbserver = localhost
  8. dbsocket = /var/run/mysqld/mysqld.sock
  9.  
  10. [main]
  11. logdir=/var/log/puppet
  12. vardir=/var/lib/puppet
  13. ssldir=/var/lib/puppet/ssl
  14. rundir=/var/run/puppet
  15. # facter!!!
  16. factpath=$vardir/lib/facter
  17. templatedir=$confdir/templates
  18. confdir=/var/puppet
  19.  
  20.  
  21.  
  22.  
  23. root@puppet:/etc/puppet# cat fileserver.conf
  24. # This file consists of arbitrarily named sections/modules
  25. # defining where files are served from and to whom
  26.  
  27. # Define a section 'files'
  28. # Adapt the allow/deny settings to your needs. Order
  29. # for allow/deny does not matter, allow always takes precedence
  30. # over deny
  31. [files]
  32. path /var/puppet/files
  33. # allow *.abacho.net.local
  34. # allow *.myhammer.intra
  35. # allow 192.168.0.0/16
  36. # allow 10.0.0.0/8
  37. allow *
  38. [plugins]
  39. # allow *.example.com
  40. # deny *.evil.example.com
  41. allow *
  42. [modules]
  43. allow *
  44.  
  45. root@puppet:/etc/puppet# cat auth.conf
  46. # This is an example auth.conf file, it mimics the puppetmasterd defaults
  47. #
  48. # The ACL are checked in order of appearance in this file.
  49. #
  50. # Supported syntax:
  51. # This file supports two different syntax depending on how
  52. # you want to express the ACL.
  53. #
  54. # Path syntax (the one used below):
  55. # ---------------------------------
  56. # path /path/to/resource
  57. # [environment envlist]
  58. # [method methodlist]
  59. # [auth[enthicated] {yes|no|on|off|any}]
  60. # allow [host|ip|*]
  61. # deny [host|ip]
  62. #
  63. # The path is matched as a prefix. That is /file match at
  64. # the same time /file_metadat and /file_content.
  65. #
  66. # Regex syntax:
  67. # -------------
  68. # This one is differenciated from the path one by a '~'
  69. #
  70. # path ~ regex
  71. # [environment envlist]
  72. # [method methodlist]
  73. # [auth[enthicated] {yes|no|on|off|any}]
  74. # allow [host|ip|*]
  75. # deny [host|ip]
  76. #
  77. # The regex syntax is the same as ruby ones.
  78. #
  79. # Ex:
  80. # path ~ .pp$
  81. # will match every resource ending in .pp (manifests files for instance)
  82. #
  83. # path ~ ^/path/to/resource
  84. # is essentially equivalent to path /path/to/resource
  85. #
  86. # environment:: restrict an ACL to a specific set of environments
  87. # method:: restrict an ACL to a specific set of methods
  88. # auth:: restrict an ACL to an authenticated or unauthenticated request
  89. # the default when unspecified is to restrict the ACL to authenticated requests
  90. # (ie exactly as if auth yes was present).
  91. #
  92.  
  93. ### Authenticated ACL - those applies only when the client
  94. ### has a valid certificate and is thus authenticated
  95.  
  96. # allow nodes to retrieve their own catalog (ie their configuration)
  97. path ~ ^/catalog/([^/]+)$
  98. method find
  99. allow $1
  100.  
  101. # allow all nodes to access the certificates services
  102. path /certificate_revocation_list/ca
  103. method find
  104. allow *
  105.  
  106. # allow all nodes to store their reports
  107. path /report
  108. method save
  109. allow *
  110.  
  111. # inconditionnally allow access to all files services
  112. # which means in practice that fileserver.conf will
  113. # still be used
  114. path /file
  115. allow *
  116.  
  117. ### Unauthenticated ACL, for clients for which the current master doesn't
  118. ### have a valid certificate
  119.  
  120. # allow access to the master CA
  121. path /certificate/ca
  122. auth no
  123. method find
  124. allow *
  125.  
  126. path /certificate/
  127. auth no
  128. method find
  129. allow *
  130.  
  131. path /certificate_request
  132. auth no
  133. method find, save
  134. allow *
  135.  
  136. path /file_metadata
  137. auth any
  138. allow *
  139.  
  140. path /file
  141. allow *
  142.  
  143. # this one is not stricly necessary, but it has the merit
  144. # to show the default policy which is deny everything else
  145. path /
  146. auth any
  147.  
  148.  
  149.  
  150. root@puppet:/etc/puppet# ls -la /var/puppet/files
  151. insgesamt 0
  152. drwxr-xr-x 3 puppet puppet 41 28. Apr 10:29 .
  153. drwxr-xr-x 7 root root 75 28. Apr 09:23 ..
  154. -rw-r--r-- 1 puppet puppet 0 28. Apr 10:29 puppet.testfile
  155. drwxr-xr-x 3 puppet puppet 20 28. Apr 09:26 zabbix
  156.  
  157. root@puppet:/etc/puppet# cat /var/puppet/modules/myh_puppet_test/manifests/init.pp
  158. # init.pp
  159. #
  160. # Modul zur Bereitstellung / Konfiguration des ssh-client /-daemon
  161. #
  162. # Features:
  163. # - Check / Installation des openssh-server package
  164. # - Anpassung von /etc/sshd_config
  165. # - Austausch der RSA host keys zwischen den puppet clients
  166. # - Bereitstellung von /root/.ssh/authorized_keys
  167. # - ForwardAgent aktivieren
  168. #
  169. # created: 28.12.2010 by schoenebeck@my-hammer.de
  170.  
  171.  
  172. class myh_puppet_test {
  173.  
  174.  
  175. file {
  176. "/root/puppettestfile2":
  177. path => "/root/puppettestfile3",
  178. owner => root,
  179. group => root,
  180. mode => 644,
  181. content => template("myh_puppet_test/puppettestfile.erb"),
  182. ensure => present,
  183. }
  184.  
  185. file {
  186. "/tmp/puppet.testfile":
  187. source => "puppet:///files/puppet.testfile",
  188. }
  189. }
  190.  
  191.  
  192.  
  193. Logging on Client:
  194.  
  195.  
  196. Apr 28 14:21:02 brandenburgdb last message repeated 18 times
  197. Apr 28 15:00:17 brandenburgdb puppet-agent[31973]: Reopening log files
  198. Apr 28 15:00:17 brandenburgdb puppet-agent[31973]: Starting Puppet client version 2.6.7
  199. Apr 28 15:00:25 brandenburgdb puppet-agent[31973]: (/Stage[main]/Myh_puppet_test/File[/tmp/puppet.testfile]) Could not evaluate: Error 400 on SERVER: Not authorized to call find on /file_metadata/files/puppet.testfile Could not retrieve file metadata for puppet:///files/puppet.testfile: Error 400 on SERVER: Not authorized to call find on /file_metadata/files/puppet.testfile at /var/puppet/modules/myh_puppet_test/manifests/init.pp:31
  200. Apr 28 15:00:25 brandenburgdb puppet-agent[31973]: Finished catalog run in 0.25 seconds
  201.  
  202.  
  203. Debugoutput on Client:
  204.  
  205. [root@brandenburgdb ~]# /usr/sbin/puppetd --onetime --no-daemonize --verbose --debug --trace
  206. debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl does not exist
  207. debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not exist
  208. debug: Puppet::Type::User::ProviderLdap: true value when expecting false
  209. debug: Puppet::Type::User::ProviderPw: file pw does not exist
  210. debug: Puppet::Type::File::ProviderMicrosoft_windows: feature microsoft_windows is missing
  211. debug: Failed to load library 'ldap' for feature 'ldap'
  212. debug: /File[/var/lib/puppet/ssl/private]: Autorequiring File[/var/lib/puppet/ssl]
  213. debug: /File[/var/lib/puppet/state/graphs]: Autorequiring File[/var/lib/puppet/state]
  214. debug: /File[/var/lib/puppet/ssl/certs/brandenburgdb.abacho.net.local.pem]: Autorequiring File[/var/lib/puppet/ssl/certs]
  215. debug: /File[/var/lib/puppet/ssl]: Autorequiring File[/var/lib/puppet]
  216. debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet]
  217. debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/puppet]
  218. debug: /File[/var/lib/puppet/ssl/certs]: Autorequiring File[/var/lib/puppet/ssl]
  219. debug: /File[/var/lib/puppet/ssl/crl.pem]: Autorequiring File[/var/lib/puppet/ssl]
  220. debug: /File[/var/lib/puppet/ssl/private_keys/brandenburgdb.abacho.net.local.pem]: Autorequiring File[/var/lib/puppet/ssl/private_keys]
  221. debug: /File[/etc/puppet/puppet.conf]: Autorequiring File[/etc/puppet]
  222. debug: /File[/var/lib/puppet/state/state.yaml]: Autorequiring File[/var/lib/puppet/state]
  223. debug: /File[/var/lib/puppet/clientbucket]: Autorequiring File[/var/lib/puppet]
  224. debug: /File[/var/lib/puppet/client_data]: Autorequiring File[/var/lib/puppet]
  225. debug: /File[/var/lib/puppet/client_yaml]: Autorequiring File[/var/lib/puppet]
  226. debug: /File[/var/lib/puppet/facts]: Autorequiring File[/var/lib/puppet]
  227. debug: /File[/var/lib/puppet/ssl/certs/ca.pem]: Autorequiring File[/var/lib/puppet/ssl/certs]
  228. debug: /File[/var/lib/puppet/ssl/private_keys]: Autorequiring File[/var/lib/puppet/ssl]
  229. debug: /File[/var/lib/puppet/ssl/certificate_requests]: Autorequiring File[/var/lib/puppet/ssl]
  230. debug: /File[/var/lib/puppet/classes.txt]: Autorequiring File[/var/lib/puppet]
  231. debug: /File[/var/lib/puppet/ssl/public_keys/brandenburgdb.abacho.net.local.pem]: Autorequiring File[/var/lib/puppet/ssl/public_keys]
  232. debug: /File[/var/lib/puppet/ssl/public_keys]: Autorequiring File[/var/lib/puppet/ssl]
  233. debug: Finishing transaction 23577754084260
  234. debug: /File[/var/lib/puppet/ssl/public_keys/brandenburgdb.abacho.net.local.pem]: Autorequiring File[/var/lib/puppet/ssl/public_keys]
  235. debug: /File[/var/lib/puppet/ssl/certs/ca.pem]: Autorequiring File[/var/lib/puppet/ssl/certs]
  236. debug: /File[/var/lib/puppet/ssl/private_keys]: Autorequiring File[/var/lib/puppet/ssl]
  237. debug: /File[/var/lib/puppet/ssl/private]: Autorequiring File[/var/lib/puppet/ssl]
  238. debug: /File[/var/lib/puppet/ssl/crl.pem]: Autorequiring File[/var/lib/puppet/ssl]
  239. debug: /File[/var/lib/puppet/facts]: Autorequiring File[/var/lib/puppet]
  240. debug: /File[/var/lib/puppet/ssl/private_keys/brandenburgdb.abacho.net.local.pem]: Autorequiring File[/var/lib/puppet/ssl/private_keys]
  241. debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/puppet]
  242. debug: /File[/var/lib/puppet/ssl/public_keys]: Autorequiring File[/var/lib/puppet/ssl]
  243. debug: /File[/var/lib/puppet/ssl/certs/brandenburgdb.abacho.net.local.pem]: Autorequiring File[/var/lib/puppet/ssl/certs]
  244. debug: /File[/var/lib/puppet/ssl/certs]: Autorequiring File[/var/lib/puppet/ssl]
  245. debug: /File[/var/lib/puppet/ssl/certificate_requests]: Autorequiring File[/var/lib/puppet/ssl]
  246. debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet]
  247. debug: /File[/var/lib/puppet/ssl]: Autorequiring File[/var/lib/puppet]
  248. debug: Finishing transaction 23577754392820
  249. debug: Using cached certificate for ca
  250. debug: Using cached certificate for brandenburgdb.abacho.net.local
  251. debug: Finishing transaction 23577753930120
  252. debug: Loaded state in 0.00 seconds
  253. debug: Using cached certificate for ca
  254. debug: Using cached certificate for brandenburgdb.abacho.net.local
  255. debug: Using cached certificate_revocation_list for ca
  256. debug: catalog supports formats: b64_zlib_yaml dot marshal pson raw yaml; using pson
  257. info: Caching catalog for brandenburgdb.abacho.net.local
  258. debug: Creating default schedules
  259. debug: Loaded state in 0.00 seconds
  260. info: Applying configuration version '1303991202'
  261. debug: file_metadata supports formats: b64_zlib_yaml marshal pson raw yaml; using pson
  262. /usr/lib/ruby/site_ruby/1.8/puppet/parameter.rb:171:in `fail'
  263. /usr/lib/ruby/site_ruby/1.8/puppet/type/file/source.rb:153:in `init_metadata'
  264. /usr/lib/ruby/site_ruby/1.8/puppet/type/file/source.rb:145:in `each'
  265. /usr/lib/ruby/site_ruby/1.8/puppet/type/file/source.rb:145:in `init_metadata'
  266. /usr/lib/ruby/site_ruby/1.8/puppet/util/cacher.rb:106:in `send'
  267. /usr/lib/ruby/site_ruby/1.8/puppet/util/cacher.rb:106:in `cached_value'
  268. /usr/lib/ruby/1.8/monitor.rb:238:in `synchronize'
  269. /usr/lib/ruby/site_ruby/1.8/puppet/util/cacher.rb:98:in `cached_value'
  270. /usr/lib/ruby/site_ruby/1.8/puppet/util/cacher.rb:48:in `metadata'
  271. /usr/lib/ruby/site_ruby/1.8/puppet/type/file/source.rb:109:in `copy_source_values'
  272. /usr/lib/ruby/site_ruby/1.8/puppet/type/file.rb:624:in `retrieve'
  273. /usr/lib/ruby/site_ruby/1.8/puppet/type.rb:703:in `retrieve_resource'
  274. /usr/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:32:in `perform_changes'
  275. /usr/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:133:in `evaluate'
  276. /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:48:in `apply'
  277. /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:113:in `eval_children_and_apply_resource'
  278. /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:91:in `eval_resource'
  279. /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:142:in `evaluate'
  280. /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:429:in `thinmark'
  281. /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
  282. /usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
  283. /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:428:in `thinmark'
  284. /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:141:in `evaluate'
  285. /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:134:in `each'
  286. /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:134:in `evaluate'
  287. /usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:144:in `apply'
  288. /usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:150:in `run'
  289. /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:193:in `benchmark'
  290. /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
  291. /usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
  292. /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:192:in `benchmark'
  293. /usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:149:in `run'
  294. /usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:39:in `run'
  295. /usr/lib/ruby/site_ruby/1.8/puppet/agent/locker.rb:21:in `lock'
  296. /usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:39:in `run'
  297. /usr/lib/ruby/1.8/sync.rb:229:in `synchronize'
  298. /usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:39:in `run'
  299. /usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:103:in `with_client'
  300. /usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:37:in `run'
  301. /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:171:in `call'
  302. /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:171:in `controlled_run'
  303. /usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:35:in `run'
  304. /usr/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:114:in `onetime'
  305. /usr/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:88:in `run_command'
  306. /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:304:in `run'
  307. /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:410:in `exit_on_fail'
  308. /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:304:in `run'
  309. /usr/sbin/puppetd:4
  310. err: /Stage[main]/Myh_puppet_test/File[/tmp/puppet.testfile]: Could not evaluate: Error 400 on SERVER: Not authorized to call find on /file_metadata/files/puppet.testfile Could not retrieve file metadata for puppet:///files/puppet.testfile: Error 400 on SERVER: Not authorized to call find on /file_metadata/files/puppet.testfile at /var/puppet/modules/myh_puppet_test/manifests/init.pp:31
  311. debug: Finishing transaction 23577752927260
  312. debug: Storing state
  313. debug: Stored state in 0.01 seconds
  314. notice: Finished catalog run in 0.09 seconds
Add Comment
Please, Sign In to add comment