Skip to content

Commit f6a72e8

Browse files
authored
Merge pull request #39 from tas50/master
Switch to chef_nginx and update testing
2 parents 4deb478 + 282a712 commit f6a72e8

File tree

17 files changed

+406
-284
lines changed

17 files changed

+406
-284
lines changed

.gitignore

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,49 @@
1-
README.pdf
2-
README.html
3-
shared_test_repo/
4-
test/integration
5-
.kitchen
1+
*.rbc
2+
.config
63
coverage
4+
InstalledFiles
5+
lib/bundler/man
6+
pkg
7+
rdoc
8+
spec/reports
9+
test/tmp
10+
test/version_tmp
11+
tmp
12+
_Store
13+
*~
14+
*#
15+
.#*
16+
\#*#
17+
.*.sw[a-z]
18+
*.un~
19+
*.tmp
20+
*.bk
21+
*.bkup
722

23+
# ruby/bundler files
24+
.ruby-version
25+
.ruby-gemset
26+
.rvmrc
827
Gemfile.lock
28+
.bundle
29+
*.gem
30+
31+
# YARD artifacts
32+
.yardoc
33+
_yardoc
34+
doc/
35+
.idea
36+
37+
# chef stuff
938
Berksfile.lock
39+
.kitchen
40+
.kitchen.local.yml
41+
vendor/
42+
.coverage/
43+
.zero-knife.rb
44+
Policyfile.lock.json
45+
46+
# vagrant stuff
47+
.vagrant/
48+
.vagrant.d/
49+
.kitchen/

.kitchen.vagrant.yml

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
---
21
driver:
32
name: vagrant
4-
require_chef_omnibus: 12.5
53

64
provisioner:
7-
name: chef_solo
5+
name: chef_zero
86
test_repo_uri: https://github.com/dev-sec/tests-nginx-hardening.git
97

108
verifier:
@@ -13,25 +11,10 @@ verifier:
1311

1412
platforms:
1513
- name: ubuntu-12.04
16-
driver_config:
17-
box: ubuntu/precise64
18-
box_url: https://atlas.hashicorp.com/ubuntu/boxes/precise64/versions/20150730.1.0/providers/virtualbox.box
1914
- name: ubuntu-14.04
20-
driver_config:
21-
box: ubuntu/trusty64
22-
box_url: https://atlas.hashicorp.com/ubuntu/boxes/trusty64/versions/20150609.0.10/providers/virtualbox.box
23-
- name: centos-6.4
24-
driver_config:
25-
box: opscode-centos-6.4
26-
box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-6.4_provisionerless.box
27-
- name: centos-6.5
28-
driver_config:
29-
box: opscode-centos-6.5
30-
box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box
31-
- name: centos-7.1
32-
driver_config:
33-
box: opscode-centos-7.1
34-
box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-7.1_chef-provisionerless.box
15+
- name: ubuntu-16.04
16+
- name: centos-6.8
17+
- name: centos-7.2
3518
- name: oracle-6.4
3619
driver_config:
3720
box: oracle-6.4
@@ -40,25 +23,15 @@ platforms:
4023
driver_config:
4124
box: oracle-6.5
4225
box_url: https://storage.us2.oraclecloud.com/v1/istoilis-istoilis/vagrant/oel65-64.box
43-
- name: debian-6
44-
driver_config:
45-
box: debian-6
46-
box_url: https://s3.eu-central-1.amazonaws.com/ffuenf-vagrantboxes/debian/debian-6.0.10-amd64_virtualbox.box
47-
- name: debian-7
48-
driver_config:
49-
box: debian/wheezy64
50-
box_url: https://atlas.hashicorp.com/debian/boxes/wheezy64/versions/7.8.5/providers/virtualbox.box
51-
- name: debian-8
52-
driver_config:
53-
box: debian/jessie64
54-
box_url: https://atlas.hashicorp.com/debian/boxes/jessie64/versions/8.1.0/providers/virtualbox.box
26+
- name: debian-7.11
27+
- name: debian-8.5
5528

5629
suites:
5730
- name: default
5831
run_list:
5932
- recipe[apt]
6033
- recipe[nginx-hardening::upgrades]
61-
- recipe[nginx]
34+
- recipe[chef_nginx]
6235
- recipe[nginx-hardening]
6336
verifier:
6437
inspec_tests:

.kitchen.yml

Lines changed: 55 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
---
21
driver:
32
name: dokken
4-
chef_version: 12.5.1
3+
chef_version: latest
54
privileged: true # because Docker and SystemD/Upstart
65

76
transport:
@@ -15,66 +14,87 @@ verifier:
1514
sudo: true
1615

1716
platforms:
18-
- name: ubuntu-12.04
19-
driver:
20-
image: ubuntu:12.04
21-
- name: ubuntu-14.04
17+
- name: debian-7
2218
driver:
23-
image: ubuntu:14.04
24-
- name: ubuntu-16.04
19+
image: debian:7
20+
pid_one_command: /sbin/init
21+
intermediate_instructions:
22+
- RUN /usr/bin/apt-get update
23+
- RUN /usr/bin/apt-get install lsb-release procps -y
24+
25+
- name: debian-8
2526
driver:
26-
image: ubuntu:16.04
27+
image: debian:8
2728
pid_one_command: /bin/systemd
28-
- name: centos-6.6
29-
driver:
30-
image: centos:6.6
3129
intermediate_instructions:
32-
- RUN yum install -y which
33-
- name: centos-6.7
30+
- RUN /usr/bin/apt-get update
31+
- RUN /usr/bin/apt-get install lsb-release -y
32+
33+
- name: centos-6
3434
driver:
35-
image: centos:6.7
35+
image: centos:6
36+
platform: rhel
37+
pid_one_command: /sbin/init
3638
intermediate_instructions:
37-
- RUN yum install -y initscripts which
39+
- RUN yum -y install which initscripts
40+
3841
- name: centos-7
3942
driver:
4043
image: centos:7
41-
intermediate_instructions:
42-
- RUN yum install -y which
44+
platform: rhel
4345
pid_one_command: /usr/lib/systemd/systemd
44-
- name: oracle-6.6
46+
intermediate_instructions:
47+
- RUN yum -y install lsof which systemd-sysv initscripts
48+
49+
- name: fedora-latest
4550
driver:
46-
image: oraclelinux:6.6
51+
image: fedora:latest
52+
pid_one_command: /usr/lib/systemd/systemd
4753
intermediate_instructions:
48-
- RUN yum install -y which
49-
- name: oracle-6.7
54+
- RUN dnf -y install yum which systemd-sysv initscripts
55+
56+
- name: ubuntu-12.04
5057
driver:
51-
image: oraclelinux:6.7
58+
image: ubuntu-upstart:12.04
59+
pid_one_command: /sbin/init
5260
intermediate_instructions:
53-
- RUN yum install -y which
54-
- name: oracle-7.1
61+
- RUN /usr/bin/apt-get update
62+
63+
- name: ubuntu-14.04
5564
driver:
56-
image: oraclelinux:7.1
65+
image: ubuntu-upstart:14.04
66+
pid_one_command: /sbin/init
5767
intermediate_instructions:
58-
- RUN yum install -y which
59-
pid_one_command: /usr/lib/systemd/systemd
60-
- name: debian-7
68+
- RUN /usr/bin/apt-get update
69+
70+
- name: ubuntu-16.04
6171
driver:
62-
image: debian:7
72+
image: ubuntu:16.04
73+
pid_one_command: /bin/systemd
6374
intermediate_instructions:
64-
- RUN /usr/bin/apt-get update && /usr/bin/apt-get install -y lsb-release procps
65-
- name: debian-8
75+
- RUN /usr/bin/apt-get update
76+
77+
- name: opensuse-13.2
6678
driver:
67-
image: debian:8
79+
image: opensuse:13.2
80+
pid_one_command: /bin/systemd
6881
intermediate_instructions:
69-
- RUN /usr/bin/apt-get update && /usr/bin/apt-get install -y lsb-release procps
82+
- RUN zypper --non-interactive install aaa_base perl-Getopt-Long-Descriptive which
83+
84+
- name: opensuse-42.1
85+
driver:
86+
image: opensuse:42.1
7087
pid_one_command: /bin/systemd
88+
intermediate_instructions:
89+
- RUN zypper --non-interactive install aaa_base perl-Getopt-Long-Descriptive which
90+
7191

7292
suites:
7393
- name: default
7494
run_list:
7595
- recipe[apt]
7696
- recipe[nginx-hardening::upgrades]
77-
- recipe[nginx]
97+
- recipe[chef_nginx]
7898
- recipe[nginx-hardening]
7999
verifier:
80100
inspec_tests:

.rubocop.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.travis.yml

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,45 @@
1-
---
21
sudo: required
3-
language: ruby
4-
cache: bundler
52
dist: trusty
63

7-
services:
8-
- docker
4+
# install the pre-release chef-dk. Use chef-stable-trusty to install the stable release
5+
addons:
6+
apt:
7+
sources:
8+
- chef-current-trusty
9+
packages:
10+
- chefdk
911

10-
before_install:
11-
- gem --version
12-
- bundle version
12+
# Don't `bundle install` which takes about 1.5 mins
13+
install: echo "skip bundle install"
14+
15+
branches:
16+
only:
17+
- master
18+
19+
services: docker
20+
21+
env:
22+
matrix:
23+
- INSTANCE=default-ubuntu-1204
24+
- INSTANCE=default-ubuntu-1404
25+
- INSTANCE=default-ubuntu-1604
26+
- INSTANCE=default-centos-6
27+
- INSTANCE=default-centos-7
28+
29+
before_script:
30+
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
31+
- eval "$(/opt/chefdk/bin/chef shell-init bash)"
32+
- /opt/chefdk/embedded/bin/chef gem install coveralls # needed for chefspecs
33+
34+
script: KITCHEN_LOCAL_YAML=.kitchen.docker.yml /opt/chefdk/embedded/bin/kitchen verify ${INSTANCE}
1335

1436
matrix:
1537
include:
16-
# verify lint and unit
17-
- rvm: 2.3.1
18-
gemfile: Gemfile
19-
bundler_args: "--without integration guard tools"
20-
# integration tests
21-
- rvm: 2.3.1
22-
bundler_args: "--without guard tools"
23-
script: bundle exec rake test:integration OS='centos'
24-
gemfile: Gemfile
25-
- rvm: 2.3.1
26-
bundler_args: "--without guard tools"
27-
script: bundle exec rake test:integration OS='oracle'
28-
gemfile: Gemfile
29-
- rvm: 2.3.1
30-
bundler_args: "--without guard tools"
31-
script: bundle exec rake test:integration OS='ubuntu'
32-
gemfile: Gemfile
33-
- rvm: 2.3.1
34-
bundler_args: "--without guard tools"
35-
script: bundle exec rake test:integration OS='debian'
36-
gemfile: Gemfile
38+
- before_script:
39+
- eval "$(/opt/chefdk/bin/chef shell-init bash)"
40+
- /opt/chefdk/embedded/bin/chef --version
41+
- /opt/chefdk/embedded/bin/cookstyle --version
42+
- /opt/chefdk/embedded/bin/foodcritic --version
43+
- script:
44+
- /opt/chefdk/bin/chef exec rake
45+
env: UNIT_AND_LINT=1

Berksfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# encoding: utf-8
22

3-
source 'https://supermarket.getchef.com'
3+
source 'https://supermarket.chef.io'
44

55
metadata
66

7-
cookbook 'chef_nginx', '~> 3.1'
8-
cookbook 'chef-solo-search', git: 'https://github.com/edelight/chef-solo-search'
7+
cookbook 'apt'

0 commit comments

Comments
 (0)