Skip to content

Commit d5e63e3

Browse files
author
Ben Fairless
committed
Lint and syntax fixes
1 parent bb78635 commit d5e63e3

File tree

7 files changed

+103
-93
lines changed

7 files changed

+103
-93
lines changed

manifests/agent.pp

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -46,36 +46,46 @@
4646
# }
4747
#
4848
class puppet::agent(
49-
$puppet_agent_service = $::puppet::params::puppet_agent_service,
50-
$puppet_agent_package = $::puppet::params::puppet_agent_package,
51-
$version = 'present',
52-
$puppet_run_style = 'service',
53-
$puppet_run_command = '/usr/bin/puppet agent --no-daemonize --onetime --logdest syslog > /dev/null 2>&1',
54-
$user_id = undef,
55-
$group_id = undef,
49+
$puppet_agent_service = $::puppet::params::puppet_agent_service,
50+
$puppet_agent_package = $::puppet::params::puppet_agent_package,
51+
$version = 'present',
52+
$puppet_run_style = 'service',
53+
$puppet_run_command = '/usr/bin/puppet agent --no-daemonize --onetime --logdest syslog > /dev/null 2>&1',
54+
$user_id = undef,
55+
$group_id = undef,
56+
$serialization_format = undef,
57+
$serialization_package = undef,
5658

5759
#[main]
58-
$templatedir = undef,
59-
$syslogfacility = undef,
60-
$priority = undef,
60+
$templatedir = undef,
61+
$syslogfacility = undef,
62+
$priority = undef,
6163

6264
#[agent]
63-
$srv_domain = undef,
64-
$ordering = undef,
65-
$trusted_node_data = undef,
66-
$environment = 'production',
67-
$puppet_server = $::puppet::params::puppet_server,
68-
$use_srv_records = false,
69-
$puppet_run_interval = 30,
70-
$splay = false,
71-
$puppet_server_port = $::puppet::params::puppet_server_port,
72-
$report = true,
73-
$pluginsync = true,
74-
$listen = false,
75-
$reportserver = '$server',
76-
$digest_algorithm = $::puppet::params::digest_algorithm,
77-
$configtimeout = '2m',
78-
$stringify_facts = undef,
65+
$srv_domain = undef,
66+
$ordering = undef,
67+
$trusted_node_data = undef,
68+
$environment = 'production',
69+
$puppet_server = $::puppet::params::puppet_server,
70+
$use_srv_records = false,
71+
$puppet_run_interval = 30,
72+
$splay = false,
73+
$puppet_server_port = $::puppet::params::puppet_server_port,
74+
$report = true,
75+
$pluginsync = true,
76+
$listen = false,
77+
$reportserver = '$server',
78+
$digest_algorithm = $::puppet::params::digest_algorithm,
79+
$configtimeout = '2m',
80+
$stringify_facts = undef,
81+
$verbose = undef,
82+
$agent_noop = undef,
83+
$usecacheonfailure = undef,
84+
$certname = undef,
85+
$http_proxy_host = undef,
86+
$http_proxy_port = undef,
87+
$cron_hour = '*',
88+
$cron_minute = undef,
7989
) inherits puppet::params {
8090

8191
if ! defined(User[$::puppet::params::puppet_user]) {
@@ -329,26 +339,29 @@
329339
if $serialization_format == 'msgpack' {
330340
unless defined(Package[$::puppet::params::ruby_dev]) {
331341
package {$::puppet::params::ruby_dev:
332-
ensure => 'latest',
342+
ensure => 'latest',
333343
}
334344
}
335345
unless defined(Package['gcc']) {
336346
package {'gcc':
337-
ensure => 'latest',
347+
ensure => 'latest',
338348
}
339349
}
340350
unless defined(Package['msgpack']) {
341351
package {'msgpack':
342-
ensure => 'latest',
343-
provider => 'gem',
344-
require => Package[$::puppet::params::ruby_dev, 'gcc'],
352+
ensure => 'latest',
353+
provider => 'gem',
354+
require => Package[$::puppet::params::ruby_dev, 'gcc'],
345355
}
346356
}
347357
}
348358
}
349359
ini_setting {'puppetagentserializationformatagent':
350360
setting => 'preferred_serialization_format',
351361
value => $serialization_format,
362+
}
363+
}
364+
352365
if $verbose != undef {
353366
ini_setting {'puppetagentverbose':
354367
ensure => present,

manifests/master.pp

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#
33
# This class installs and configures a Puppet master
44
#
5-
<<<<<<< HEAD
65
# Parameters:
76
# ['user_id'] - The userid of the puppet user
87
# ['group_id'] - The groupid of the puppet group
@@ -46,8 +45,6 @@
4645
# ['serialization_format'] - defaults to undef, otherwise it sets the preferred_serialization_format param (currently only msgpack is supported)
4746
# ['strict_variables'] - Makes the parser raise errors when referencing unknown variables
4847
# ['always_cache_features'] - if false (default), always try to load a feature even if a previous load failed
49-
50-
>>>>>>> 9f614250618d124231791e9dbee41ecca22581e7
5148
#
5249
# Requires:
5350
#
@@ -154,35 +151,35 @@
154151
nginx: {
155152
Anchor['puppet::master::begin'] ->
156153
class {'puppet::unicorn':
157-
certname => $certname,
158-
puppet_conf => $puppet_conf,
159-
puppet_ssldir => $puppet_ssldir,
160-
dns_alt_names => $dns_alt_names,
161-
listen_address => $listen_address,
162-
puppet_proxy_port => $puppet_proxy_port,
163-
disable_ssl => $disable_ssl,
164-
backup_upstream => $backup_upstream,
165-
unicorn_package => $unicorn_package,
166-
unicorn_path => $unicorn_path,
167-
disable_master => $disable_master,
168-
upstream => $upstream,
169-
backend_process_number => $backend_process_number,
154+
certname => $certname,
155+
puppet_conf => $puppet_conf,
156+
puppet_ssldir => $puppet_ssldir,
157+
dns_alt_names => $dns_alt_names,
158+
listen_address => $listen_address,
159+
puppet_proxy_port => $puppet_proxy_port,
160+
disable_ssl => $disable_ssl,
161+
backup_upstream => $backup_upstream,
162+
unicorn_package => $unicorn_package,
163+
unicorn_path => $unicorn_path,
164+
disable_master => $disable_master,
165+
upstream => $upstream,
166+
backend_process_number => $backend_process_number,
170167
} ->
171168
Anchor['puppet::master::end']
172169
}
173170
default: {
174171
Anchor['puppet::master::begin'] ->
175172
class {'puppet::passenger':
176-
puppet_proxy_port => $puppet_passenger_port,
177-
puppet_docroot => $puppet_docroot,
178-
apache_serveradmin => $apache_serveradmin,
179-
puppet_conf => $::puppet::params::puppet_conf,
180-
puppet_ssldir => $puppet_ssldir,
181-
certname => $certname,
182-
conf_dir => $::puppet::params::confdir,
183-
dns_alt_names => join($dns_alt_names,','),
184-
generate_ssl_certs => $generate_ssl_certs,
185-
puppet_passenger_tempdir => $puppet_passenger_tempdir,
173+
puppet_proxy_port => $puppet_passenger_port,
174+
puppet_docroot => $puppet_docroot,
175+
apache_serveradmin => $apache_serveradmin,
176+
puppet_conf => $::puppet::params::puppet_conf,
177+
puppet_ssldir => $puppet_ssldir,
178+
certname => $certname,
179+
conf_dir => $::puppet::params::confdir,
180+
dns_alt_names => join($dns_alt_names,','),
181+
generate_ssl_certs => $generate_ssl_certs,
182+
puppet_passenger_tempdir => $puppet_passenger_tempdir,
186183
config_addon => $puppet_passenger_cfg_addon,
187184
} ->
188185
Anchor['puppet::master::end']
@@ -229,11 +226,11 @@
229226
}
230227

231228
file { $puppet_vardir:
232-
ensure => directory,
233-
owner => $::puppet::params::puppet_user,
234-
group => $::puppet::params::puppet_group,
235-
notify => Service[$webserver],
236-
require => Package[$puppet_master_package]
229+
ensure => directory,
230+
owner => $::puppet::params::puppet_user,
231+
group => $::puppet::params::puppet_group,
232+
notify => Service[$webserver],
233+
require => Package[$puppet_master_package]
237234
}
238235

239236
if $storeconfigs {
@@ -393,9 +390,9 @@
393390
}
394391
unless defined(Package['msgpack']) {
395392
package {'msgpack':
396-
ensure => latest,
397-
provider => gem,
398-
require => Package[$::puppet::params::ruby_dev, 'gcc'],
393+
ensure => latest,
394+
provider => gem,
395+
require => Package[$::puppet::params::ruby_dev, 'gcc'],
399396
}
400397
}
401398
}
@@ -404,6 +401,7 @@
404401
setting => 'preferred_serialization_format',
405402
value => $serialization_format,
406403
}
404+
}
407405

408406
validate_bool(str2bool($always_cache_features))
409407
ini_setting { 'puppetmasteralwayscachefeatures':

manifests/passenger.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
}
102102

103103
apache::vhost { "puppet-${certname}":
104-
port => $puppet_proxy_port,
104+
port => $puppet_proxy_port,
105105
priority => '40',
106106
docroot => $puppet_docroot,
107107
serveradmin => $apache_serveradmin,

manifests/unicorn.pp

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
$disable_master,
4545
$upstream,
4646
$backend_process_number,
47-
) inherits puppet::params {
47+
) inherits puppet::params {
4848
class { '::nginx':
49-
worker_processes => $::processorcount,
50-
multi_accept => 'on',
49+
worker_processes => $::processorcount,
50+
multi_accept => 'on',
5151
}
5252
# if this is provided we install the package from the repo, otherwise we build unicorn from scratch
5353
if $unicorn_package {
@@ -67,18 +67,18 @@
6767
}
6868
}
6969
package {['unicorn', 'rack']:
70-
ensure => latest,
71-
provider => gem,
72-
require => Package[$::puppet::params::ruby_dev, 'gcc'],
70+
ensure => latest,
71+
provider => gem,
72+
require => Package[$::puppet::params::ruby_dev, 'gcc'],
7373
}
7474
}
7575
file {'unicorn-conf':
7676
path => '/etc/puppet/unicorn.conf',
7777
content => template('puppet/unicorn.conf'),
7878
} ->
7979
file {'copy-config':
80-
path => '/etc/puppet/config.ru',
81-
source => '/usr/share/puppet/ext/rack/config.ru',
80+
path => '/etc/puppet/config.ru',
81+
source => '/usr/share/puppet/ext/rack/config.ru',
8282
} ->
8383

8484
file {'unicorn-service':
@@ -93,8 +93,8 @@
9393
}
9494
unless defined(Service['unicorn-puppetmaster']) {
9595
service{'unicorn-puppetmaster':
96-
ensure => running,
97-
enable => true,
96+
ensure => running,
97+
enable => true,
9898
}
9999
}
100100
# update SELinux
@@ -113,7 +113,7 @@
113113
$crt_clean_cmd = "puppet cert clean ${certname}"
114114
# I would have preferred to use puppet cert generate, but it does not
115115
# return the correct exit code on some versions of puppet
116-
$crt_gen_cmd = "puppet certificate --ca-location=local --dns_alt_names=$dns_alt_names generate ${certname}"
116+
$crt_gen_cmd = "puppet certificate --ca-location=local --dns_alt_names=${dns_alt_names} generate ${certname}"
117117
# I am using the sign command here b/c AFAICT, the sign command for certificate
118118
# does not work
119119
$crt_sign_cmd = "puppet cert sign --allow-dns-alt-names ${certname}"
@@ -135,10 +135,10 @@
135135
content => template('puppet/puppetmaster'),
136136
} ->
137137
file {'enable-puppetmaster-vhost':
138-
ensure => link,
139-
path => '/etc/nginx/sites-enabled/puppetmaster',
140-
target => '/etc/nginx/sites-available/puppetmaster',
141-
notify => Service['nginx'],
138+
ensure => link,
139+
path => '/etc/nginx/sites-enabled/puppetmaster',
140+
target => '/etc/nginx/sites-available/puppetmaster',
141+
notify => Service['nginx'],
142142
}
143143
unless defined(Service['nginx']) {
144144
service{'nginx':
@@ -148,4 +148,3 @@
148148
}
149149
}
150150
}
151-

tests/dbterminus.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class {'puppet::dbterminus':
22
puppet_confdir => '/etc/puppet/puppet.conf',
33
puppet_service => Service['httpd'],
4-
dbport => '8081',
5-
dbserver => 'test.example.com'
4+
dbport => '8081',
5+
dbserver => 'test.example.com'
66
}

tests/passenger.pp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
class{ 'puppet::passenger':
2-
puppet_proxy_port => '8140',
3-
puppet_docroot => '/etc/puppet/doc',
2+
puppet_proxy_port => '8140',
3+
puppet_docroot => '/etc/puppet/doc',
44
apache_serveradmin => '[email protected]',
5-
puppet_site => 'master.example.com',
6-
puppet_conf => '/etc/puppet/puppet.conf',
7-
puppet_ssldir => '/var/lib/puppet/ssl',
8-
certname => 'master.example.com',
5+
puppet_site => 'master.example.com',
6+
puppet_conf => '/etc/puppet/puppet.conf',
7+
puppet_ssldir => '/var/lib/puppet/ssl',
8+
certname => 'master.example.com',
99
}

tests/storedconfigs.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class {'puppet::storeconfigs':
2-
dbserver => 'test.example.com',
3-
dbport => '8081',
4-
puppet_service => Service['httpd'],
2+
dbserver => 'test.example.com',
3+
dbport => '8081',
4+
puppet_service => Service['httpd'],
55
puppetdb_version => 'present'
66
}

0 commit comments

Comments
 (0)