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. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 stage => 'runtime', | 53 stage => 'runtime', |
54 } | 54 } |
55 | 55 |
56 # Used as internal constant within adblockplus::* resources | 56 # Used as internal constant within adblockplus::* resources |
57 $directory = '/var/adblockplus' | 57 $directory = '/var/adblockplus' |
58 | 58 |
59 # A common location for directories specific to the adblockplus:: setups, | 59 # A common location for directories specific to the adblockplus:: setups, |
60 # managed via Puppet, but accessible by all users with access to the system | 60 # managed via Puppet, but accessible by all users with access to the system |
61 @file {$directory: | 61 @file {$directory: |
62 ensure => 'directory', | 62 ensure => 'directory', |
63 mode => 0755, | 63 mode => '0755', |
64 owner => 'root', | 64 owner => 'root', |
65 } | 65 } |
66 | 66 |
67 # A common time-zone shared by all hosts provisioned eases synchronization | 67 # A common time-zone shared by all hosts provisioned eases synchronization |
68 # and debugging, i.e. log-file review and similar tasks, significantly | 68 # and debugging, i.e. log-file review and similar tasks, significantly |
69 file { | 69 file { |
70 '/etc/timezone': | 70 '/etc/timezone': |
71 content => 'UTC', | 71 content => 'UTC', |
72 ensure => 'present', | 72 ensure => 'present', |
73 group => 'root', | 73 group => 'root', |
74 mode => 0644, | 74 mode => '0644', |
75 notify => Service['cron'], | 75 notify => Service['cron'], |
76 owner => 'root'; | 76 owner => 'root'; |
77 '/etc/localtime': | 77 '/etc/localtime': |
78 ensure => 'link', | 78 ensure => 'link', |
79 target => '/usr/share/zoneinfo/UTC', | 79 target => '/usr/share/zoneinfo/UTC', |
80 notify => Service['cron']; | 80 notify => Service['cron']; |
81 } | 81 } |
82 | 82 |
83 # Explicit resource required only to ensure cron(8) is running; | 83 # Explicit resource required only to ensure cron(8) is running; |
84 # there is no real requirement for a rationship with another resource | 84 # there is no real requirement for a rationship with another resource |
85 service {'cron': | 85 service {'cron': |
86 ensure => 'running', | 86 ensure => 'running', |
87 enable => true, | 87 enable => true, |
88 } | 88 } |
89 | 89 |
90 $cron_env = hiera('cron::environment', []) | 90 $cron_env = hiera('cron::environment', []) |
91 | 91 |
92 file { '/etc/crontab': | 92 file { '/etc/crontab': |
93 ensure => 'present', | 93 ensure => 'present', |
94 content => template('adblockplus/crontab.erb'), | 94 content => template('adblockplus/crontab.erb'), |
95 owner => 'root', | 95 owner => 'root', |
96 group => 'root', | 96 group => 'root', |
97 mode => 0644, | 97 mode => '0644', |
98 } | 98 } |
99 | 99 |
100 # Work around https://issues.adblockplus.org/ticket/3479 | 100 # Work around https://issues.adblockplus.org/ticket/3479 |
101 if $::environment == 'development' { | 101 if $::environment == 'development' { |
102 | 102 |
103 file { | 103 file { |
104 '/etc/ssh/ssh_host_rsa_key': | 104 '/etc/ssh/ssh_host_rsa_key': |
105 source => 'puppet:///modules/adblockplus/development_host_rsa_key', | 105 source => 'puppet:///modules/adblockplus/development_host_rsa_key', |
106 mode => 600, | 106 mode => '600', |
107 notify => Service['ssh']; | 107 notify => Service['ssh']; |
108 '/etc/ssh/ssh_host_rsa_key.pub': | 108 '/etc/ssh/ssh_host_rsa_key.pub': |
109 source => 'puppet:///modules/adblockplus/development_host_rsa_key.pub', | 109 source => 'puppet:///modules/adblockplus/development_host_rsa_key.pub', |
110 mode => 644; | 110 mode => '644'; |
111 } | 111 } |
112 } | 112 } |
113 | 113 |
114 # Fix implicit package dependency Class['apt'] does not properly handle | 114 # Fix implicit package dependency Class['apt'] does not properly handle |
115 Exec['apt_update'] -> Package<|title != 'python-software-properties'|> | 115 Exec['apt_update'] -> Package<|title != 'python-software-properties'|> |
116 | 116 |
117 # https://issues.adblockplus.org/ticket/3574#comment:19 | 117 # https://issues.adblockplus.org/ticket/3574#comment:19 |
118 ensure_packages($packages) | 118 ensure_packages($packages) |
119 | 119 |
120 # https://projects.puppetlabs.com/issues/4145 | 120 # https://projects.puppetlabs.com/issues/4145 |
121 ensure_resource('file', '/etc/ssh/ssh_known_hosts', { | 121 ensure_resource('file', '/etc/ssh/ssh_known_hosts', { |
122 ensure => 'present', | 122 ensure => 'present', |
123 mode => 0644, | 123 mode => '0644', |
124 }) | 124 }) |
125 | 125 |
126 # See modules/adblockplus/manifests/host.pp | 126 # See modules/adblockplus/manifests/host.pp |
127 create_resources('adblockplus::host', $hosts) | 127 create_resources('adblockplus::host', $hosts) |
128 | 128 |
129 # See modules/adblockplus/manifests/user.pp | 129 # See modules/adblockplus/manifests/user.pp |
130 create_resources('adblockplus::user', $users) | 130 create_resources('adblockplus::user', $users) |
131 } | 131 } |
OLD | NEW |