Skip to content

Commit 7e5f035

Browse files
authored
Merge pull request #3 from hw-cookbooks/cookstyle_bot/cookstyle_6_17_5
Signed-off-by: Tim Smith <[email protected]>
2 parents 8053168 + 5d22c6b commit 7e5f035

File tree

6 files changed

+66
-67
lines changed

6 files changed

+66
-67
lines changed

Gemfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
source "https://rubygems.org"
1+
source 'https://rubygems.org'
22

3-
gem 'emeril', :group => :release
3+
gem 'emeril', group: :release
44
gem 'rake'
55

66
group :integration do
7-
gem "test-kitchen"
8-
gem "kitchen-vagrant"
9-
gem "librarian-chef"
10-
gem "serverspec"
11-
gem "chefspec"
12-
gem "foodcritic"
13-
gem "guard-rspec"
7+
gem 'test-kitchen'
8+
gem 'kitchen-vagrant'
9+
gem 'librarian-chef'
10+
gem 'serverspec'
11+
gem 'chefspec'
12+
gem 'foodcritic'
13+
gem 'guard-rspec'
1414
end

Rakefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ require 'rspec/core/rake_task'
55
begin
66
require 'emeril/rake'
77
rescue LoadError
8-
puts ">>>>> Emeril gem not loaded, omitting tasks" unless ENV['CI']
8+
puts '>>>>> Emeril gem not loaded, omitting tasks' unless ENV['CI']
99
end
1010

11-
task :spec => 'spec:all'
12-
task :default => :spec
11+
task spec: 'spec:all'
12+
task default: :spec
1313

1414
namespace :spec do
1515
targets = []
@@ -18,8 +18,8 @@ namespace :spec do
1818
targets << File.basename(dir)
1919
end
2020

21-
task :all => targets
22-
task :default => :all
21+
task all: targets
22+
task default: :all
2323

2424
targets.each do |target|
2525
desc "Run serverspec tests to #{target}"
@@ -34,5 +34,5 @@ begin
3434
require 'kitchen/rake_tasks'
3535
Kitchen::RakeTasks.new
3636
rescue LoadError
37-
puts ">>>>> Kitchen gem not loaded, omitting tasks" unless ENV['CI']
37+
puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI']
3838
end

attributes/default.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
default[:csync2][:source][:version] = "csync2-1.34"
1+
default[:csync2][:source][:version] = 'csync2-1.34'
22
default[:csync2][:source][:downloads] = {
3-
"csync2-1.34.tar.gz" => 'http://oss.linbit.com/csync2/csync2-1.34.tar.gz',
4-
"librsync-0.9.7.tar.gz" => 'http://autobuild.itoc.com.au/csync2/librsync-0.9.7.tar.gz',
5-
"sqlite-2.8.17.tar.gz" => 'http://autobuild.itoc.com.au/csync2/sqlite-2.8.17.tar.gz'
3+
'csync2-1.34.tar.gz' => 'http://oss.linbit.com/csync2/csync2-1.34.tar.gz',
4+
'librsync-0.9.7.tar.gz' => 'http://autobuild.itoc.com.au/csync2/librsync-0.9.7.tar.gz',
5+
'sqlite-2.8.17.tar.gz' => 'http://autobuild.itoc.com.au/csync2/sqlite-2.8.17.tar.gz',
66
}
77

88
default[:csync2][:build_packages][:rhel] = [
@@ -17,19 +17,19 @@
1717
'openssl-devel',
1818
'openssl-static',
1919
'rng-tools',
20-
'xinetd'
21-
]
22-
default[:csync2][:build_packages][:ubuntu] = [
23-
'build-essential',
24-
'libtool',
25-
'byacc',
26-
'flex',
27-
'openssl',
28-
'rng-tools',
29-
'xinetd'
20+
'xinetd',
3021
]
22+
default[:csync2][:build_packages][:ubuntu] = %w(
23+
build-essential
24+
libtool
25+
byacc
26+
flex
27+
openssl
28+
rng-tools
29+
xinetd
30+
)
3131

3232
default[:csync2][:src][:configure_opts] = './configure --prefix=/usr --localstatedir=/var --with-librsync-source=../librsync-0.9.7.tar.gz --with-libsqlite-source=../sqlite-2.8.17.tar.gz --sysconfdir=/etc --disable-gnutls'
3333

34-
default[:csync2][:hosts] = [ "localhost" ]
35-
default[:csync2][:directories] = [ "/tmp/csync2" ]
34+
default[:csync2][:hosts] = [ 'localhost' ]
35+
default[:csync2][:directories] = [ '/tmp/csync2' ]

metadata.rb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
name "csync2"
2-
maintainer "Heavy Water Operations, LLC"
3-
maintainer_email "[email protected]"
4-
license "Apache 2.0"
5-
description "Installs/Configures csync2"
6-
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
7-
version "0.1.0"
1+
name 'csync2'
2+
maintainer 'Heavy Water Operations, LLC'
3+
maintainer_email '[email protected]'
4+
license 'Apache-2.0'
5+
description 'Installs/Configures csync2'
6+
version '0.1.0'
87

recipes/default.rb

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#
2-
# Cookbook Name:: csync2
2+
# Cookbook:: csync2
33
# Recipe:: default
44
#
5-
# Copyright 2014, Heavy Water Operations, LLC
5+
# Copyright:: 2014, Heavy Water Operations, LLC
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.
@@ -18,67 +18,67 @@
1818
#
1919

2020
case node['platform']
21-
when "redhat", "centos", "fedora", "amazon"
22-
install_packages = node[:csync2][:build_packages][:rhel]
23-
when "debian", "ubuntu"
24-
install_packages = node[:csync2][:build_packages][:ubuntu]
21+
when 'redhat', 'centos', 'fedora', 'amazon'
22+
install_packages = node['csync2']['build_packages']['rhel']
23+
when 'debian', 'ubuntu'
24+
install_packages = node['csync2']['build_packages']['ubuntu']
2525
end
2626
install_packages.each do |pkg|
2727
package pkg
2828
end
2929

30-
node[:csync2][:source][:downloads].each do |k, v|
30+
node['csync2']['source']['downloads'].each do |k, v|
3131
remote_file "#{Chef::Config[:file_cache_path]}/#{k}" do
3232
source v
3333
end
3434
end
3535

3636
csync2_command = '/usr/sbin/csync2'
3737

38-
execute "Install csync2" do
38+
execute 'Install csync2' do
3939
cwd Chef::Config[:file_cache_path]
4040
command <<-EOF
41-
tar -xzvf #{node[:csync2][:source][:version]}.tar.gz
42-
cd #{node[:csync2][:source][:version]}
43-
#{node[:csync2][:src][:configure_opts]}
41+
tar -xzvf #{node['csync2']['source']['version']}.tar.gz
42+
cd #{node['csync2']['source']['version']}
43+
#{node['csync2']['src']['configure_opts']}
4444
make
4545
make install
4646
EOF
47-
not_if { ::File.exists?(csync2_command) }
47+
not_if { ::File.exist?(csync2_command) }
4848
end
4949

50-
ssl_conf = Chef::EncryptedDataBagItem.load('csync2', node.chef_environment)
51-
[ "csync2.key", "csync2_ssl_cert.csr", "csync2_ssl_cert.pem", "csync2_ssl_key.pem" ].each do |name|
50+
ssl_conf = data_bag_item('csync2', node.chef_environment)
51+
[ 'csync2.key', 'csync2_ssl_cert.csr', 'csync2_ssl_cert.pem', 'csync2_ssl_key.pem' ].each do |name|
5252
file "/etc/#{name}" do
5353
content ssl_conf["#{name}"]
54-
mode 00644
54+
mode '644'
5555
end
5656
end
5757

58-
[ "/var/log/csync2", "/var/spool/csync2" ].each do |dir|
58+
[ '/var/log/csync2', '/var/spool/csync2' ].each do |dir|
5959
directory dir
6060
end
6161

62-
template "/etc/csync2.cfg" do
63-
source "csync2.cfg.erb"
62+
template '/etc/csync2.cfg' do
63+
source 'csync2.cfg.erb'
6464
variables({
65-
:hosts => node[:csync2][:hosts],
66-
:directories => node[:csync2][:directories]
65+
hosts: node['csync2']['hosts'],
66+
directories: node['csync2']['directories'],
6767
})
68-
notifies :restart, "service[xinetd]", :delayed
68+
notifies :restart, 'service[xinetd]', :delayed
6969
end
7070

71-
execute "Configure service port" do
71+
execute 'Configure service port' do
7272
command "echo 'csync2 30865/tcp' >> /etc/services"
73-
notifies :restart, "service[xinetd]", :delayed
74-
not_if "grep csync2 /etc/services"
73+
notifies :restart, 'service[xinetd]', :delayed
74+
not_if 'grep csync2 /etc/services'
7575
end
7676

77-
template "/etc/xinetd.d/csync2" do
78-
source "csync2.xinetd.erb"
79-
notifies :restart, "service[xinetd]", :delayed
77+
template '/etc/xinetd.d/csync2' do
78+
source 'csync2.xinetd.erb'
79+
notifies :restart, 'service[xinetd]', :delayed
8080
end
8181

82-
service "xinetd" do
82+
service 'xinetd' do
8383
action :nothing
8484
end

test/integration/default/serverspec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
require 'pathname'
33

44
set :backend, :exec
5-
set :path, "/sbin:/usr/local/sbin:$PATH"
5+
set :path, '/sbin:/usr/local/sbin:$PATH'

0 commit comments

Comments
 (0)