Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

Commit

Permalink
Merge pull request #22 from Alfresco/TAA-916
Browse files Browse the repository at this point in the history
selinux-command-httpd only if selinux is enabled
  • Loading branch information
Martin Whittington committed May 10, 2017
2 parents 419882b + fb1f8fd commit b3d5443
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 99 deletions.
1 change: 1 addition & 0 deletions .kitchen.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ driver:

provisioner:
name: chef_zero
require_chef_omnibus: 12.19.36

verifier:
name: inspec
Expand Down
1 change: 1 addition & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ driver:

provisioner:
name: chef_zero
require_chef_omnibus: 12.19.36

verifier:
name: inspec
Expand Down
10 changes: 6 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
source 'https://rubygems.org'

gem 'inspec', '~>1.2.1'
gem 'foodcritic', '~> 8.1.0'
gem 'cookstyle', '~> 0.0.1'
gem 'foodcritic', '~> 10.2.0'
gem 'cookstyle', '~> 1.2.0'
gem 'berkshelf', '~> 5.1.0'
gem 'chefspec', '~> 4.5.0'
gem 'chefspec', '~> 5.3.0'
gem 'rake'
gem 'coveralls', require: false
gem 'chef', '~> 12.19.36'
gem 'yamllint'

group :docker do
gem 'test-kitchen', '~> 1.4'
gem 'kitchen-docker', '~> 2.6.0'
gem 'kitchen-inspec', '~> 0.16.1'
gem 'kitchen-inspec', '~> 0.18.0'
end

group :vagrant do
Expand Down
16 changes: 12 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,29 @@

require 'foodcritic'
require 'rspec/core/rake_task'
require 'yamllint/rake_task'

desc 'Runs yamllint checks'
task :yamllint do
YamlLint::RakeTask.new do |t|
t.paths = %w( \.*\.y*ml )
end
end

desc 'Runs cookstyle tests'
task :cookstyle do
sh 'cookstyle'
sh 'chef exec bundle exec cookstyle'
end

desc 'Runs foodcritic test'
task :foodcritic do
FoodCritic::Rake::LintTask.new
sh 'foodcritic -f any .'
sh 'chef exec bundle exec foodcritic -f any .'
end

desc 'Runs ChefSpec tests'
task :chefspec do
sh 'rspec'
sh 'chef exec bundle exec rspec'
end

desc 'Run Test Kitchen integration tests'
Expand Down Expand Up @@ -57,4 +65,4 @@ namespace :integration do
end
end

task default: [:foodcritic, :cookstyle, :chefspec]
task default: [:yamllint, :foodcritic, :cookstyle, :chefspec]
89 changes: 0 additions & 89 deletions Vagrantfile

This file was deleted.

2 changes: 1 addition & 1 deletion attributes/nginx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
'Host $host',
'X-Real-IP $remote_addr',
'X-Forwarded-For $proxy_add_x_forwarded_for',
'X-Forwarded-Proto $scheme'
'X-Forwarded-Proto $scheme',
]
default['nginx']['server']['proxy']['locations']['/']['proxy_pass'] = "#{node['webserver']['lb_protocol']}://#{node['nginx']['proxy_hostname']}:#{node['nginx']['proxy_port']}"
# Set files larger than 1M to stream rather than cache
Expand Down
2 changes: 2 additions & 0 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
source_url 'https://github.com/Alfresco/chef-alfresco-webserver'
version '0.7.4'

chef_version '~> 12' if respond_to?(:chef_version)

supports 'centos', '>= 7.0'
supports 'redhat', '>= 7.0'

Expand Down
1 change: 1 addition & 0 deletions recipes/nginx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
execute 'selinux-command-httpd' do
command 'semanage permissive -a httpd_t'
not_if 'semanage permissive -l | grep httpd_t'
only_if 'getenforce | grep -i enforcing'
only_if 'which semanage'
end

Expand Down
2 changes: 1 addition & 1 deletion test/integration/nginx/inspec/config_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
nginx_conf = '/etc/nginx/nginx.conf'

options = {
assignment_re: /^\s*([^:]*?)\s*\ \s*(.*?)\s*;$/
assignment_re: /^\s*([^:]*?)\s*\ \s*(.*?)\s*;$/,
}

control 'nginx-11' do
Expand Down

0 comments on commit b3d5443

Please sign in to comment.