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

Clean up chef vault #299

Merged
merged 4 commits into from
Mar 19, 2016
Merged
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: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
source 'https://rubygems.org'
gem 'chef-vault', '~> 2.6'
gem 'poise', '~> 2.2'
gem 'poise-service', '~> 1.0'
gem 'poise-boiler'
Expand All @@ -10,14 +9,15 @@ group :lint do
end

group :unit, :integration do
gem 'chef-sugar'
gem 'chefspec'
gem 'berkshelf'
gem 'serverspec'
end

group :development do
gem 'awesome_print'
gem 'github_changelog_generator'
# gem 'github_changelog_generator'
gem 'rake'
gem 'stove'
end
Expand Down
2 changes: 1 addition & 1 deletion libraries/consul_installation_webui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def self.default_archive_url
"https://releases.hashicorp.com/consul/%{version}/%{basename}" # rubocop:disable Style/StringLiterals
end

def self.binary_basename(node, resource)
def self.binary_basename(_node, resource)
['consul', resource.version, 'web_ui'].join('_').concat('.zip')
end

Expand Down
8 changes: 4 additions & 4 deletions libraries/consul_service_windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ def action_enable
end
powershell_script 'Trigger consul restart' do
action :nothing
code "restart-service consul"
code 'restart-service consul'
end
end
# Check if the service is running, but don't bother if we're already
# changing some nssm parameters
unless nssm_service_status?(%w{SERVICE_RUNNING}) && mismatch_params.empty?
powershell_script 'Trigger consul restart' do
code "restart-service consul"
code 'restart-service consul'
end
end
end
Expand All @@ -69,7 +69,7 @@ def action_reload

def action_restart
powershell_script 'Restart consul' do
code "restart-service consul"
code 'restart-service consul'
end
end

Expand All @@ -78,7 +78,7 @@ def action_disable
# nssm resource doesn't stop the service before it removes it
powershell_script 'Stop consul' do
action :run
code "stop-service consul"
code 'stop-service consul'
only_if { nssm_service_installed? && nssm_service_status?(%w{SERVICE_RUNNING SERVICE_PAUSED}) }
end

Expand Down
1 change: 0 additions & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

depends 'build-essential'
depends 'chef-sugar'
depends 'chef-vault', '~> 1.3'
depends 'nssm'
depends 'golang'
depends 'firewall', '~> 2.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
consul_installation 'webui'
18 changes: 18 additions & 0 deletions test/spec/libraries/consul_installation_webui_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'spec_helper'
require_relative '../../../libraries/consul_installation'

describe ConsulCookbook::Resource::ConsulInstallation do
step_into(:consul_installation)
let(:chefspec_options) { {platform: 'ubuntu', version: '14.04'} }

context 'consul ui install' do
recipe 'consul_spec::consul_installation_webui'

it do is_expected.to unzip_zipfile('consul_0.6.4_web_ui.zip')
.with(owner: 'myconsul',
group: 'myconsul',
remote_url: 'https://releases.hashicorp.com/consul/0.5.1/consul_0.5.1_web_ui.zip',
install_path: '/opt')
end
end
end
18 changes: 0 additions & 18 deletions test/spec/libraries/consul_ui_spec.rb

This file was deleted.