Skip to content

Commit

Permalink
Merge pull request #9 from kplimack/2.1.0
Browse files Browse the repository at this point in the history
put version attribute to use - 2.1.0
  • Loading branch information
silviabotros authored Oct 6, 2017
2 parents 012cc9b + 96ddfbe commit 875b428
Show file tree
Hide file tree
Showing 21 changed files with 414 additions and 227 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ bin/*

.kitchen/
.kitchen.local.yml
bundle
34 changes: 34 additions & 0 deletions .kitchen.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
driver:
name: proxy
host: localhost
reset_command: "exit 0"
port: <%= ENV["machine_port"] %>
username: <%= ENV["machine_user"] %>
password: <%= ENV["machine_pass"] %>

provisioner:
name: chef_zero

verifier:
name: inspec

platforms:
- name: centos-6.6
attributes:
orchestrator:
package:
version: 2.1.5-1
url: 'https://github.com/kplimack/orchestrator-rpm/raw/master/orchestrator-2.1.5-1.x86_64.rpm'
checksum: 392a2d6b3d5cea85053dfad3b6c2dceae838674d56f267046c854e4d1ceee2a3
- name: centos-7.2
- name: debian-8.9
attributes:
orchestrator:
package:
version: ~

suites:
- name: default
run_list:
- recipe[orchestrator::default]
19 changes: 14 additions & 5 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,25 @@ driver:

provisioner:
name: chef_zero
require_chef_omnibus: true
always_update_cookbooks: true

verifier:
name: inspec
sudo: true

platforms:
- name: centos-6.6
driver_config:
box: sendgrid_centos-6_chef-11
box_url: http://repo.sjc1.sendgrid.net/images/vagrant/metadata/sendgrid_centos-6_chef-11.json
attributes:
orchestrator:
package:
version: 2.1.5-1
url: 'https://github.com/kplimack/orchestrator-rpm/raw/master/orchestrator-2.1.5-1.x86_64.rpm'
checksum: 392a2d6b3d5cea85053dfad3b6c2dceae838674d56f267046c854e4d1ceee2a3
- name: centos-7.2
- name: debian-8.9

suites:
- name: default
run_list:
- recipe[orchestrator::default]
- recipe[minitest-handler]
attributes:
52 changes: 52 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
AllCops:
TargetRubyVersion: 2.1
Exclude:
- bin/**/*
- script/**/*
- vendor/**/*
- cookbooks/**/*
- bundle/**/*

ClassLength:
Enabled: false
CyclomaticComplexity:
Enabled: false
Documentation:
Enabled: false
Encoding:
Enabled: false
LineLength:
Enabled: false
MethodLength:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/ModuleLength:
Enabled: false
PerceivedComplexity:
Enabled: false
Style/SpaceBeforeFirstArg:
Enabled: true
Style/ClassAndModuleChildren:
Enabled: false
Style/EmptyLinesAroundBlockBody:
Enabled: true
Style/FileName:
Enabled: true
Style/RescueModifier:
Enabled: true
Style/StringLiterals:
Enabled: true
Metrics/BlockLength:
Enabled: false
Style/NumericLiterals:
Enabled: false
Style/ExtraSpacing:
Enabled: true
AllowForAlignment: false
ForceEqualSignAlignment: false
Style/SymbolArray:
Enabled: false
Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%w': '()'
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: ruby
env:
global:
- machine_user=travis
- machine_pass=travis
- machine_port=22
- KITCHEN_YAML=.kitchen.travis.yml

rvm:
- 2.3.4

gemfile:
- Gemfile

sudo: required
dist: trusty

before_install:
- sudo usermod -p "`openssl passwd -1 'travis'`" travis

script: "bundle exec rake"

3 changes: 1 addition & 2 deletions Berksfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
source :chef_server
source 'https://supermarket.chef.io'

metadata
cookbook 'minitest-handler', git: 'https://github.com/btm/minitest-handler-cookbook.git'
44 changes: 29 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,71 @@
# 2.0.2
# orchestrator

## 2.1.0
* use build-essential to install gcc,make, etc
* rubocop (.rubocop.yml added and files corrected)
* use generic centos-6 VM to test on, not internal sendgrid images
* alphabetize attributes
* replace ruby_block with file resource with sensitive
* add `Debian 8` support
* add `Centos 7` support
* add `travis-ci` config, Gemfile, etc
* allow for orchestrator package source/checksum to be defined and overridden
* replace `minitest` with `inspec`x

## 2.0.2
Orchestrator has officially moved to Github

# 2.0.1
## 2.0.1
Fix spelling mistake in ListenAddress

# 2.0.0
## 2.0.0
Move to a single hash for all config values
Use ruby to create the config from the hash

# 1.5.0
## 1.5.0
Install orchestrator using package cloud repo (Thanks Shlomi for setting that up)
Remove spec tests. Sticking with minitests only
Update the kitchen platforms because it isn't 2012 anymore

# 1.4.1
## 1.4.1
Add new config attribute for HostnameResolveMethod

# 1.4.0
## 1.4.0
Add a new CLI only recipe installation
Set some version constraints to the upstream dependencies
Use supermarket for the cookbook API

# 1.3.3
## 1.3.3
Add ReaadOnly to the config template

# 1.3.2
## 1.3.2
Set a default auth method and actually set a default user and password
Add the auth method to the config template

# 1.3.1
## 1.3.1
GA release 1.2.10 is the default version now
Set Orchestrator to read only by default
Use local template variables in the config file
Moved the minitest file location to match more recent versions of chef-minitest

# 1.3.0
## 1.3.0
Refactored installation into a package recipe
Made the version an attribute
Use the service resource to manage Orchestrator (Thanks Shlomi for adding the init script)

# 1.2.0
## 1.2.0
Added minitests

# 1.1.1
## 1.1.1
Chefspec passes and 100% coverage

# 1.1.0
## 1.1.0
Added Chefspec tests

# 1.0.0
## 1.0.0
First real release. Now converged for both centos and Ubuntu

# 0.1.0
## 0.1.0

Initial release of chef-orchestrator

Expand Down
17 changes: 17 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
source 'https://rubygems.org'

gem 'berkshelf', '= 5.6.4'
gem 'chef', ' ~> 13'
gem 'foodcritic'
gem 'rake'
gem 'rubocop'

group :integration do
gem 'kitchen-inspec'
gem 'test-kitchen'
end

group :vagrant do
gem 'kitchen-vagrant'
gem 'vagrant-wrapper'
end
48 changes: 23 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
# chef-orchestrator-cookbook

This cookbook sets up and runs [mysql-orchestror](https://github.com/github/orchestrator/).

[![Code Climate](https://codeclimate.com/github/silviabotros/chef-orchestrator/badges/gpa.svg)](https://codeclimate.com/github/silviabotros/chef-orchestrator)
[![Issue Count](https://codeclimate.com/github/silviabotros/chef-orchestrator/badges/issue_count.svg)](https://codeclimate.com/github/silviabotros/chef-orchestrator)

# chef-orchestrator-cookbook
This cookbook sets up and runs mysql-orchestror (https://github.com/github/orchestrator/).
## Presumptions

## Presumptions:
- The backend mysql for orchestrator is going to run on the same server as orchestrator itself
- That backend DB is going to use Percona MySQL which is setup using the chef-percona cookbook by Philiper (https://github.com/phlipper/chef-percona.git)
- That you, the end user, own adding privileges for orchestrator to access your existing DB infrastructure
- That backend DB is going to use Percona MySQL which is setup using the [chef-percona](https://github.com/phlipper/chef-percona) cookbook by [Philiper](https://github.com/phlipper)
- That you, the end user, own adding privileges for orchestrator to access your existing DB infrastructure
- That you wrap this cookbook to use the CLI and add your production databases for discovery

## Supported Platforms
Tested with

- Centos 6.5
- Ubuntu 12.04

## Attributes

<table>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td><tt>['orchestrator']['bacon']</tt></td>
<td>Boolean</td>
<td>whether to include bacon</td>
<td><tt>true</tt></td>
</tr>
</table>
| Key | Type | Description | Default |
| --- | ---- | ----------- | ------- |
| ['orchestrator']['package']['version'] | nil | string | version to install, nil provides latest (and will upgrade) |
| ['orchestrator']['package']['url'] | nil | string | URL to download the RPM from |
| ['orchestrator']['package']['checksum'] | nil | string | Checksum for the file provided by URL |

## Usage

### Installation

Starting in version _2.1.0_, the orchestrator cookbook now respects the `version` attribute. If set to `nil` (the default), the cookbook will perform the same steps as previous versions -- always upgrade to the latest version available via the repos available on a node.
Setting this attribute to a specific package version will result in that version being installed. If you want to install the package from an internal source, you can also specify the url and optional checksum to download the orchestrator package.

### orchestrator::default

Include `orchestrator` in your node's `run_list`:
Expand All @@ -49,11 +47,11 @@ Include `orchestrator` in your node's `run_list`:
## Contributing

1. Fork the repository on Github
2. Create a named feature branch (i.e. `add-new-recipe`)
3. Write your change
4. Write tests for your change (if applicable)
5. Run the tests, ensuring they all pass
6. Submit a Pull Request
1. Create a named feature branch (i.e. `add-new-recipe`)
1. Write your change
1. Write tests for your change (if applicable)
1. Run the tests, ensuring they all pass
1. Submit a Pull Request

## License and Authors

Expand Down
Loading

0 comments on commit 875b428

Please sign in to comment.