Skip to content
This repository was archived by the owner on Aug 29, 2018. It is now read-only.

Commit f1b1e48

Browse files
committed
Merge pull request #356 from sdodson/travis-ci
Travis ci will now test for lint, syntax, and spec tests.
2 parents dd4e7e4 + a1e35f0 commit f1b1e48

File tree

11 files changed

+82
-46
lines changed

11 files changed

+82
-46
lines changed

.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
language: ruby
3+
before_install: rm Gemfile.lock || true
4+
rvm:
5+
- 1.9.3
6+
script: bundle exec rake test
7+
env:
8+
matrix:
9+
- PUPPET_VERSION="~> 3.2.0"
10+
- PUPPET_VERSION="~> 3.4.0"
11+
- PUPPET_VERSION="~> 3.6.0"
12+
matrix:
13+
include:
14+
- rvm: 1.8.7
15+
env: PUPPET_VERSION="~> 2.7.0"
16+
- rvm: 1.8.7
17+
env: PUPPET_VERSION="~> 3.4.0"
18+
- rvm: 1.8.7
19+
env: PUPPET_VERSION="~> 3.6.0"

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ group :test do
44
gem "rake"
55
gem "puppet", ENV['PUPPET_VERSION'] || '>= 2.7.0'
66
gem "puppet-lint"
7+
gem 'rspec', '< 3.0.0'
78
gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git', :ref => '389f99ef666521fec1b4530fe69dc1ab84a060a8'
89
gem "puppet-syntax"
910
gem "puppetlabs_spec_helper"

manifests/activemq_keystores.pp

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# Copyright 2014 Red Hat, Inc., All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# This class creates a java keystore for ActiveMQ using provided CA, Cert, and
16+
# Keys
117
class openshift_origin::activemq_keystores (
218

319
$ca = $::openshift_origin::msgserver_tls_ca,
@@ -27,7 +43,7 @@
2743
}
2844
file {"${activemq_confdir}/ssl_credentials":
2945
ensure => directory,
30-
mode => 0700,
46+
mode => '0700',
3147
}
3248
file {"${activemq_confdir}/ssl_credentials/activemq_certificate.pem":
3349
ensure => file,
@@ -42,7 +58,6 @@
4258
source => $ca,
4359
}
4460

45-
4661
# ----- Manage Keystore Contents -----
4762

4863
# Each keystore should have a dependency on the PEM files it relies on.
@@ -59,12 +74,12 @@
5974

6075
# Keystore with ActiveMQ cert and private key
6176
java_ks { 'activemq_cert:keystore':
62-
ensure => latest,
63-
certificate => "${activemq_confdir}/ssl_credentials/activemq_certificate.pem",
64-
private_key => "${activemq_confdir}/ssl_credentials/activemq_private.pem",
65-
target => "${activemq_confdir}/keystore.jks",
66-
password => $keystore_password,
67-
require => [
77+
ensure => latest,
78+
certificate => "${activemq_confdir}/ssl_credentials/activemq_certificate.pem",
79+
private_key => "${activemq_confdir}/ssl_credentials/activemq_private.pem",
80+
target => "${activemq_confdir}/keystore.jks",
81+
password => $keystore_password,
82+
require => [
6883
File["${activemq_confdir}/ssl_credentials/activemq_private.pem"],
6984
File["${activemq_confdir}/ssl_credentials/activemq_certificate.pem"]
7085
],
@@ -79,13 +94,13 @@
7994
file {"${activemq_confdir}/keystore.jks":
8095
owner => $activemq_user,
8196
group => $activemq_user,
82-
mode => 0600,
97+
mode => '0600',
8398
require => Java_ks['activemq_cert:keystore'],
8499
}
85100
file {"${activemq_confdir}/truststore.jks":
86101
owner => $activemq_user,
87102
group => $activemq_user,
88-
mode => 0600,
103+
mode => '0600',
89104
require => Java_ks['activemq_ca:truststore'],
90105
}
91106

manifests/broker.pp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,18 @@
109109
}
110110

111111
selinux_fcontext { '/var/www/openshift/broker/httpd/run(/.*)?':
112-
ensure => 'present',
113-
seltype => 'httpd_var_run_t',
112+
ensure => 'present',
113+
seltype => 'httpd_var_run_t',
114114
}
115115

116116
selinux_fcontext { '/var/www/openshift/broker/tmp(/.*)?':
117-
ensure => 'present',
118-
seltype => 'httpd_tmp_t',
117+
ensure => 'present',
118+
seltype => 'httpd_tmp_t',
119119
}
120120

121121
selinux_fcontext { '/var/log/openshift/broker(/.*)?':
122-
ensure => 'present',
123-
seltype => 'httpd_log_t',
122+
ensure => 'present',
123+
seltype => 'httpd_log_t',
124124
}
125125

126126
# Make sure the semanage rules are set up right away.
@@ -234,12 +234,13 @@
234234
notify => Service['openshift-broker'],
235235
}
236236
}
237+
$development_file_present = $::openshift_origin::development_mode ? {
238+
true => present,
239+
default => absent,
240+
}
237241
file { '/etc/openshift/development':
238-
source => 'puppet:///modules/openshift_origin/development',
239-
ensure => $::openshift_origin::development_mode ? {
240-
true => present,
241-
default => absent,
242-
}
242+
ensure => $development_file_present,
243+
source => 'puppet:///modules/openshift_origin/development',
243244
}
244245

245246
# SCL and Puppet don't play well together; circumvents the use of the `scl enable ruby193` mechanism while

manifests/console.pp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@
5151
'/var/log/openshift/console(/.*)?',
5252
'/var/log/openshift/console/httpd(/.*)?',
5353
]:
54-
ensure => 'present',
55-
seltype => 'httpd_log_t',
54+
ensure => 'present',
55+
seltype => 'httpd_log_t',
5656
}
5757

5858
selinux_fcontext { '/var/www/openshift/console/httpd/run(/.*)?':
59-
ensure => 'present',
60-
seltype => 'httpd_var_run_t',
59+
ensure => 'present',
60+
seltype => 'httpd_var_run_t',
6161
}
6262

6363
# Add semanage types to dirs before anything else goes into them.

manifests/datastore.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
}
108108

109109
service { 'mongod':
110-
require => [Package['mongodb'], Package['mongodb-server']],
111-
enable => true,
110+
require => [Package['mongodb'], Package['mongodb-server']],
111+
enable => true,
112112
}
113113
}

manifests/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@
840840
$msgserver_admin_password = inline_template('<%= require "securerandom"; SecureRandom.base64 %>'),
841841
$msgserver_tls_enabled = 'disabled',
842842
$msgserver_tls_keystore_password = 'password',
843-
$msgserver_tls_ca = "/var/lib/puppet/ssl/certs/ca.pem",
843+
$msgserver_tls_ca = '/var/lib/puppet/ssl/certs/ca.pem',
844844
$msgserver_tls_cert = inline_template('<%= "/var/lib/puppet/ssl/certs/#{fqdn.downcase}.pem" %>'),
845845
$msgserver_tls_key = inline_template('<%= "/var/lib/puppet/ssl/private_keys/#{fqdn.downcase}.pem" %>'),
846846
$mcollective_user = 'mcollective',

manifests/msgserver.pp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@
5252
require => Package['activemq'],
5353
}
5454

55-
if ($::openshift_origin::msgserver_tls_enabled == 'enabled') or ($::openshift_origin::msgserver_tls_enabled == 'strict') {
55+
if ($::openshift_origin::msgserver_tls_enabled == 'enabled') or ($::openshift_origin::msgserver_tls_enabled == 'strict') {
5656
if ($::openshift_origin::msgserver_tls_ca != '') and ($::openshift_origin::msgserver_tls_key != '') and ($::openshift_origin::msgserver_tls_cert != '') {
57-
anchor { 'openshift_origin::msgserver_keystores_begin': } ->
57+
anchor { 'openshift_origin::msgserver_keystores_begin': } ->
5858
class { 'openshift_origin::activemq_keystores' : } ->
5959
anchor { 'openshift_origin::msgserver_keystores_end': }
60-
60+
6161
$activemq_openwire_port = '61617'
6262
} else { fail 'Valid certificate file locations are required when msgserver_tls_enabled is in strict or enabled mode.' }
63-
} else {
63+
} else {
6464
$activemq_openwire_port = '61616'
6565
}
6666

manifests/node.pp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -253,18 +253,18 @@
253253
}
254254

255255
service { ['openshift-gears']:
256-
enable => true,
257-
require => [
256+
enable => true,
257+
require => [
258258
Package['rubygem-openshift-origin-node'],
259259
Package['openshift-origin-node-util'],
260260
],
261261
}
262262

263263
if $openshift_origin::conf_node_watchman_service {
264264
service { ['openshift-watchman']:
265-
ensure => running,
266-
enable => true,
267-
require => [
265+
ensure => running,
266+
enable => true,
267+
require => [
268268
Package['rubygem-openshift-origin-node'],
269269
Package['openshift-origin-node-util'],
270270
Service['openshift-gears'],
@@ -281,10 +281,10 @@
281281
}
282282

283283
file { ['/var/lib/openshift/']:
284-
ensure => 'directory',
285-
owner => 'root',
286-
group => 'root',
287-
mode => '0751',
284+
ensure => 'directory',
285+
owner => 'root',
286+
group => 'root',
287+
mode => '0751',
288288
}
289289

290290
file { ['/var/lib/openshift/.settings','/etc/openshift/env/']:

manifests/register_dns.pp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141

4242
$key_argument = "${key_algorithm}:${key_domain}:${key_secret}"
4343

44-
exec { "Attempting to register host dns" :
45-
command => template('openshift_origin/register_dns.erb'),
46-
provider => 'shell',
47-
require => Package['bind-utils'],
44+
exec { 'Attempting to register host dns' :
45+
command => template('openshift_origin/register_dns.erb'),
46+
provider => 'shell',
47+
require => Package['bind-utils'],
4848
}
4949
}
5050
}

0 commit comments

Comments
 (0)