OLD | NEW |
1 # == Class: adblockplus | 1 # == Class: adblockplus |
2 # | 2 # |
3 # The adblockplus class and the associated adblockplus:: namespace are | 3 # The adblockplus class and the associated adblockplus:: namespace are |
4 # used to integrate Puppet modules with each other, in order to assemble | 4 # used to integrate Puppet modules with each other, in order to assemble |
5 # the setups used by the Adblock Plus project. | 5 # the setups used by the Adblock Plus project. |
6 # | 6 # |
7 # === Parameters: | 7 # === Parameters: |
8 # | 8 # |
9 # [*authority*] | 9 # [*authority*] |
10 # The authorative domain or zone associated with the current environment, | 10 # The authorative domain or zone associated with the current environment, |
11 # similar to the deprecated and soon to be removed $base::zone. | 11 # similar to the deprecated and soon to be removed $base::zone. |
12 # | 12 # |
| 13 # [*hosts*] |
| 14 # A hash of adblockplus::host $name => $parameter items to set up in this |
| 15 # context, i.e. via Hiera. |
| 16 # |
13 # [*users*] | 17 # [*users*] |
14 # A hash of adblockplus::user $name => $parameter items to set up in this | 18 # A hash of adblockplus::user $name => $parameter items to set up in this |
15 # context, i.e. via Hiera. | 19 # context, i.e. via Hiera. |
16 # | 20 # |
17 # === Examples: | 21 # === Examples: |
18 # | 22 # |
19 # class {'adblockplus': | 23 # class {'adblockplus': |
| 24 # hosts => { |
| 25 # 'node1' => { |
| 26 # # see adblockplus::host |
| 27 # }, |
| 28 # }, |
20 # users => { | 29 # users => { |
21 # 'pinocchio' => { | 30 # 'pinocchio' => { |
22 # # see adblockplus::user | 31 # # see adblockplus::user |
23 # }, | 32 # }, |
24 # }, | 33 # }, |
25 # } | 34 # } |
26 # | 35 # |
27 class adblockplus ( | 36 class adblockplus ( |
28 $authority = hiera('adblockplus::authority', 'adblockplus.org'), | 37 $authority = hiera('adblockplus::authority', 'adblockplus.org'), |
| 38 $hosts = hiera_hash('adblockplus::hosts', {}), |
29 $users = hiera_hash('adblockplus::users', {}), | 39 $users = hiera_hash('adblockplus::users', {}), |
30 ) { | 40 ) { |
31 | 41 |
32 # See https://issues.adblockplus.org/ticket/3574#comment:8 | 42 # See https://issues.adblockplus.org/ticket/3574#comment:8 |
33 class {'base': | 43 class {'base': |
34 zone => $authority, | 44 zone => $authority, |
35 } | 45 } |
36 | 46 |
37 # Used as internal constant within adblockplus::* resources | 47 # Used as internal constant within adblockplus::* resources |
38 $directory = '/var/adblockplus' | 48 $directory = '/var/adblockplus' |
(...skipping 29 matching lines...) Expand all Loading... |
68 '/etc/ssh/ssh_host_rsa_key': | 78 '/etc/ssh/ssh_host_rsa_key': |
69 source => 'puppet:///modules/adblockplus/development_host_rsa_key', | 79 source => 'puppet:///modules/adblockplus/development_host_rsa_key', |
70 mode => 600, | 80 mode => 600, |
71 notify => Service['ssh']; | 81 notify => Service['ssh']; |
72 '/etc/ssh/ssh_host_rsa_key.pub': | 82 '/etc/ssh/ssh_host_rsa_key.pub': |
73 source => 'puppet:///modules/adblockplus/development_host_rsa_key.pub', | 83 source => 'puppet:///modules/adblockplus/development_host_rsa_key.pub', |
74 mode => 644; | 84 mode => 644; |
75 } | 85 } |
76 } | 86 } |
77 | 87 |
| 88 # https://projects.puppetlabs.com/issues/4145 |
| 89 ensure_resource('file', '/etc/ssh/ssh_known_hosts', { |
| 90 ensure => 'present', |
| 91 mode => 0644, |
| 92 }) |
| 93 |
| 94 # See modules/adblockplus/manifests/host.pp |
| 95 create_resources('adblockplus::host', $hosts) |
| 96 |
78 # See modules/adblockplus/manifests/user.pp | 97 # See modules/adblockplus/manifests/user.pp |
79 create_resources('adblockplus::user', $users) | 98 create_resources('adblockplus::user', $users) |
80 } | 99 } |
OLD | NEW |