Skip to content

Commit 600cbc6

Browse files
authored
Develop (#6)
* Testing deployment location logic for when in CircleCI * Testing deployment location logic for when in CircleCI Part 2 * Updated comment [skip ci] * Moved Label up in Dockerfile [skip ci]
1 parent 628d804 commit 600cbc6

File tree

6 files changed

+25
-41
lines changed

6 files changed

+25
-41
lines changed

.kitchen.yml

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,6 @@ suites:
160160
chef_version: '12.19.36'
161161
inside_aws: 'true'
162162
configure_sudoers: 'true'
163-
attributes:
164-
bonusbits_base:
165-
deployment_type: ec2
166-
aws:
167-
inside: true
168163
includes: ["amazon-ec2"]
169164

170165
- name: ec2_base_epel_repo
@@ -211,11 +206,6 @@ suites:
211206
configure_sudoers: 'true'
212207
configure_epel: 'true'
213208
install_epel_packages: 'true'
214-
attributes:
215-
bonusbits_base:
216-
deployment_type: ec2
217-
aws:
218-
inside: true
219209
includes: ["amazon-ec2"]
220210

221211
- name: ec2_base_no_software
@@ -262,11 +252,6 @@ suites:
262252
configure_cloudwatch_logs: 'true'
263253
inside_aws: 'true'
264254
install_packages: 'false'
265-
attributes:
266-
bonusbits_base:
267-
deployment_type: ec2
268-
aws:
269-
inside: true
270255
includes: ["amazon-ec2"]
271256

272257
- name: docker_base
@@ -283,16 +268,12 @@ suites:
283268
git: https://github.com/bonusbits/inspec_bonusbits_base.git
284269
attributes:
285270
chef_version: '12.19.36'
286-
inside_aws: 'false'
287271
configure_sudoers: 'true'
288272
attributes:
273+
<% if ENV['CIRCLECI'] %>
289274
bonusbits_base:
290-
deployment_type: docker
291-
security:
292-
selinux:
293-
configure: false
294-
aws:
295-
inside: false
275+
deployment_location: 'circleci'
276+
<% end %>
296277
includes: ["amazon-docker"]
297278

298279
- name: docker_base_epel_repo
@@ -309,18 +290,14 @@ suites:
309290
git: https://github.com/bonusbits/inspec_bonusbits_base.git
310291
attributes:
311292
chef_version: '12.19.36'
312-
inside_aws: 'false'
313293
configure_sudoers: 'true'
314294
configure_epel: 'true'
315295
install_epel_packages: 'true'
316296
attributes:
297+
<% if ENV['CIRCLECI'] %>
317298
bonusbits_base:
318-
deployment_type: docker
319-
security:
320-
selinux:
321-
configure: false
322-
aws:
323-
inside: false
299+
deployment_location: 'circleci'
300+
<% end %>
324301
includes: ["amazon-docker"]
325302

326303
- name: docker_base_no_software
@@ -341,11 +318,8 @@ suites:
341318
install_packages: 'false'
342319
configure_sudoers: 'true'
343320
attributes:
321+
<% if ENV['CIRCLECI'] %>
344322
bonusbits_base:
345-
deployment_type: docker
346-
security:
347-
selinux:
348-
configure: false
349-
aws:
350-
inside: false
323+
deployment_location: 'circleci'
324+
<% end %>
351325
includes: ["amazon-docker"]

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## CHANGE LOG
22

3+
## 2.1.9 - 04/15/2017 - Levon Becker
4+
* Removed unnecessary attributes in kitchen config now that auto deployment discovery wrote.
5+
* Fixed CircleCI detection
6+
* Conditioned Selinux to not run if Docker
7+
38
## 2.1.8 - 04/15/2017 - Levon Becker
49
* Set to start awslogs at end of cloudwatch_logs recipe so it'll start streaming chef-client.log
510

Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
FROM amazonlinux:latest
22
MAINTAINER Levon Becker "[email protected]"
3+
LABEL version="2.1.9" \
4+
description="Amazon Linux Image built from bonusbits_base cookbook." \
5+
github="https://github.com/bonusbits/bonusbits_base" \
6+
website="https://www.bonusbits.com"
37

48
# Build Cookbook Args
59
#ARG chef_client_version=12.19.36
@@ -9,11 +13,6 @@ ARG chef_role=base
913
ARG chef_environment=bonusbits_base
1014
ARG chef_config_path=/opt/chef-repo
1115

12-
LABEL version="2.1.8" \
13-
description="Amazon Linux Image built from bonusbits_base cookbook." \
14-
github="https://github.com/bonusbits/bonusbits_base" \
15-
website="https://www.bonusbits.com"
16-
1716
# Install Basics
1817
RUN yum clean all
1918
RUN yum update -y --exclude=kernel*

attributes/default.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
end
2828

2929
# Determine Deployment Location
30+
## Circleci Logic Does not work if spawning Docker
31+
## containers in CircleCi because nested VM. Override in Kitchen Config
3032
default['bonusbits_base']['deployment_location'] =
3133
if ENV['CIRCLECI']
3234
'circleci'

metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
license 'MIT'
55
description 'Foundation Wrapper Cookbook for all Nodes'
66
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
7-
version '2.1.8'
7+
version '2.1.9'
88
chef_version '~> 12.5' if respond_to?(:chef_version)
99
source_url 'https://github.com/bonusbits/bonusbits_base'
1010
issues_url 'https://github.com/bonusbits/bonusbits_base/issues'

recipes/security.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
deployment_type = node['bonusbits_base']['deployment_type']
2+
deployment_type_docker = deployment_type == 'docker'
3+
14
case node['os']
25
when 'linux'
36
case node['platform_family']
47
when 'redhat'
58
# Configure SELinux
69
selinux_state 'Disabling SELinux' do
710
action node['bonusbits_base']['linux']['selinux']['action'].to_sym
11+
not_if { deployment_type_docker }
812
end
913
else
1014
return

0 commit comments

Comments
 (0)