Skip to content

Commit

Permalink
Initial working cookbook that configures the VictorOps repository and…
Browse files Browse the repository at this point in the history
… installs

the `victorops-zabbix` packages

The following platforms have been tested with Test Kitchen:

- Ubuntu 12.04
- Ubuntu 14.04
- CentOs 6.6
- CentOs 7.1
  • Loading branch information
nshenry03 committed Jul 14, 2015
1 parent 6d53ab8 commit d491aa8
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ Gemfile.lock
bin/*
.bundle/*

# Test Kitchen
.kitchen/*

VERSION
24 changes: 24 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
driver:
name: vagrant

driver_config:
require_chef_omnibus: true

platforms:
- name: ubuntu-12.04
- name: ubuntu-14.04
- name: centos-6.6
- name: centos-7.1

provisioner:
name: chef_zero

suites:
- name: default
run_list:
- "recipe[victorops::default]"

- name: zabbix
run_list:
- "recipe[victorops::zabbix]"
62 changes: 40 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,21 @@
# victorops-cookbook

TODO: Enter the cookbook description here.
VictorOps Cookbook
=====================
This cookbook configures the VictorOps repository on RHEL/Debian servers and
can be used to install VictorOps packages such as Zabbix.

## Supported Platforms

TODO: List your supported platforms.

## Attributes

<table>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td><tt>['victorops']['bacon']</tt></td>
<td>Boolean</td>
<td>whether to include bacon</td>
<td><tt>true</tt></td>
</tr>
</table>
The following platforms have been tested with Test Kitchen:

- Ubuntu 12.04
- Ubuntu 14.04
- CentOs 6.6
- CentOs 7.1

## Usage

### victorops::default
Configures the VictorOps repository on RHEL/Debian servers.

Include `victorops` in your node's `run_list`:

Expand All @@ -37,6 +27,34 @@ Include `victorops` in your node's `run_list`:
}
```

### victorops::zabbix
Installs the `victorops-zabbix` package (automatically includes/runs
`victorops::default` first)

Include `victorops::zabbix` in your node's `run_list`:

```json
{
"run_list": [
"recipe[victorops::zabbix]"
]
}
```

## License and Authors

Author:: Nick Henry (<[email protected]>)
- Author:: Nick Henry (<[email protected]>)

```text
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
2 changes: 2 additions & 0 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
long_description 'Installs/Configures victorops'
version IO.read(File.join(File.dirname(__FILE__), 'VERSION'))

depends 'apt'
depends 'yum'
28 changes: 28 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,31 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

# TODO(nshenry03):
# - When VictorOps signs their packages, get rid of the `trusted true` and
# `gpgcheck false` statements.
# - VictorOps only seems to have a package for `precise`; however, that seems
# to work fine on Ubuntu 14.04; when they support other distributions,
# switch from `distribution 'precise'` to something like `distribution
# node['lsb']['codename']`

case node['platform']
when 'ubuntu', 'debian'
include_recipe 'apt::default'
apt_repository 'victorops' do
uri 'http://software.victorops.com/apt'
components ['main']
distribution 'precise'
trusted true
action :add
end
when 'redhat', 'centos', 'scientific', 'amazon', 'oracle'
include_recipe 'yum::default'
yum_repository 'victorops' do
description 'VictorOps Base repo'
baseurl 'http://software.victorops.com/yum/'
gpgcheck false
action :create
end
end
22 changes: 22 additions & 0 deletions recipes/zabbix.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Cookbook Name:: victorops
# Recipe:: zabbix
#
# Copyright (C) 2015 Nick Henry
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

include_recipe 'victorops::default'

package 'victorops-zabbix'

0 comments on commit d491aa8

Please sign in to comment.