Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookstyle Bot Auto Corrections with Cookstyle 7.31.1 #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Berksfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# encoding: utf-8

source 'https://supermarket.getchef.com'
source 'https://supermarket.chef.io'

metadata

Expand Down
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# encoding: utf-8

source 'https://rubygems.org'

gem 'berkshelf', '~> 5.3'
Expand Down
30 changes: 14 additions & 16 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
# encoding: utf-8

guard :rubocop do
watch(/.+\.rb$/)
watch(/(?:.+\/)?\.rubocop\.yml$/) { |m| File.dirname(m[0]) }
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
end

guard :foodcritic, cookbook_paths: '.', cli: '-f any --tags ~FC023' do
watch(/attributes\/.+\.rb$/)
watch(/providers\/.+\.rb$/)
watch(/recipes\/.+\.rb$/)
watch(/resources\/.+\.rb$/)
watch(%r{attributes/.+\.rb$})
watch(%r{providers/.+\.rb$})
watch(%r{recipes/.+\.rb$})
watch(%r{resources/.+\.rb$})
watch(/metadata.rb/)
end

guard :rspec do
watch(/^spec\/.+_spec\.rb$/)
watch(/^(recipes)\/(.+)\.rb$/) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^(recipes)/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { 'spec' }
end

guard :kitchen, all_on_start: false do
watch(/test\/.+/)
watch(/^recipes\/(.+)\.rb$/)
watch(/^attributes\/(.+)\.rb$/)
watch(/^files\/(.+)/)
watch(/^templates\/(.+)/)
watch(/^providers\/(.+)\.rb/)
watch(/^resources\/(.+)\.rb/)
watch(%r{test/.+})
watch(%r{^recipes/(.+)\.rb$})
watch(%r{^attributes/(.+)\.rb$})
watch(%r{^files/(.+)})
watch(%r{^templates/(.+)})
watch(%r{^providers/(.+)\.rb})
watch(%r{^resources/(.+)\.rb})
end
2 changes: 0 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env rake
# encoding: utf-8

require 'foodcritic'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
Expand Down
7 changes: 3 additions & 4 deletions attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# encoding: utf-8
#
# Cookbook Name:: postgres-hardening
# Cookbook:: postgres-hardening
# Attributes:: default
#
# Copyright 2014, Christoph Hartmann
# Copyright 2014, Deutsche Telekom AG
# Copyright:: 2014, Christoph Hartmann
# Copyright:: 2014, Deutsche Telekom AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
9 changes: 4 additions & 5 deletions attributes/hardening.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# encoding: utf-8
#
# Cookbook Name:: postgres-hardening
# Cookbook:: postgres-hardening
# Attributes:: default
#
# Copyright 2014, Christoph Hartmann
# Copyright 2014, Deutsche Telekom AG
# Copyright:: 2014, Christoph Hartmann
# Copyright:: 2014, Deutsche Telekom AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -48,5 +47,5 @@
# all others are md5 now
{ type: 'local', db: 'all', user: 'all', addr: nil, method: 'md5' },
{ type: 'host', db: 'all', user: 'all', addr: '127.0.0.1/32', method: 'md5' },
{ type: 'host', db: 'all', user: 'all', addr: '::1/128', method: 'md5' }
{ type: 'host', db: 'all', user: 'all', addr: '::1/128', method: 'md5' },
]
7 changes: 1 addition & 6 deletions metadata.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
# encoding: utf-8
name 'postgres-hardening'
maintainer 'Christoph Hartmann'
maintainer_email '[email protected]'
license 'Apache v2.0'
license 'Apache-2.0'
description 'Installs and configures a secure posgres server'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '2.0.0'

depends 'postgresql', '>= 6.0.0'

recipe 'postgresql-hardening::default', 'calls hardening recipe'
recipe 'postgresql-hardening::hardening', 'add hardening configuration postgresql server'

supports 'amazon'
supports 'redhat'
supports 'centos'
Expand Down
7 changes: 3 additions & 4 deletions recipes/default.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# encoding: utf-8
#
# Cookbook Name: postgres-hardening
# Cookbook:: Name: postgres-hardening
# Recipe: default
#
# Copyright 2014, Deutsche Telekom AG
# Copyright:: 2014, Deutsche Telekom AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -18,4 +17,4 @@
# limitations under the License.
#

include_recipe('postgres-hardening::hardening')
include_recipe 'postgres-hardening::hardening'
8 changes: 3 additions & 5 deletions recipes/hardening.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# encoding: utf-8
#
# Cookbook Name: postgres-hardening
# Cookbook:: Name: postgres-hardening
# Recipe: hardening.rb
#
# Copyright 2014, Deutsche Telekom AG
# Copyright:: 2014, Deutsche Telekom AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -19,8 +18,7 @@
#

# ensure, that you have postgresql::server in your runlist
case node['platform_family']
when 'debian'
if platform_family?('debian')
['', node['postgresql']['version']].each do |dir|
directory File.join('/var/lib/postgresql/', dir) do
mode '0700'
Expand Down
3 changes: 1 addition & 2 deletions spec/default_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# encoding: utf-8
#
# Copyright 2015, Hardening Framework Team
# Copyright:: 2015, Hardening Framework Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
13 changes: 6 additions & 7 deletions spec/hardening_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# encoding: utf-8
#
# Copyright 2015, Hardening Framework Team
# Copyright:: 2015, Hardening Framework Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -23,7 +22,7 @@
{ os_name: 'ubuntu', os_version: '12.04', postgres_version: '9.3' },
{ os_name: 'ubuntu', os_version: '14.04', postgres_version: '9.3' },
{ os_name: 'debian', os_version: '6.0.5', postgres_version: '9.3' },
{ os_name: 'debian', os_version: '7.5', postgres_version: '9.3' }
{ os_name: 'debian', os_version: '7.5', postgres_version: '9.3' },
]

platforms.each do |platform|
Expand All @@ -45,11 +44,11 @@
stub_command("ls -l /var/lib/postgresql/#{@postgres_version}/main/server.crt |grep /etc/ssl/certs/ssl-cert-snakeoil.pem").and_return(true)
stub_command("ls -l /var/lib/postgresql/#{@postgres_version}/main/server.key |grep /etc/ssl/private/ssl-cert-snakeoil.key").and_return(true)

expect(chef_run).to create_directory('/var/lib/postgresql/').
with(mode: '0700')
expect(chef_run).to create_directory('/var/lib/postgresql/')
.with(mode: '0700')

expect(chef_run).to create_directory("/var/lib/postgresql/#{@postgres_version}").
with(mode: '0700')
expect(chef_run).to create_directory("/var/lib/postgresql/#{@postgres_version}")
.with(mode: '0700')
end

it 'deletes links if commands return true' do
Expand Down
4 changes: 1 addition & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# encoding: utf-8
#
# Copyright 2015, Hardening Framework Team
# Copyright:: 2015, Hardening Framework Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -22,4 +21,3 @@

# coverage report
Coveralls.wear!
at_exit { ChefSpec::Coverage.report! }