Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #224 from evertrue/refactor-for-chef-14-and-beyond
Browse files Browse the repository at this point in the history
Refactor for Chef 14 and beyond
  • Loading branch information
jeffbyrnes authored May 29, 2020
2 parents 5e94618 + ac85c34 commit 31b2696
Show file tree
Hide file tree
Showing 36 changed files with 232 additions and 856 deletions.
23 changes: 1 addition & 22 deletions .delivery/project.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1 @@
# Delivery Prototype for Local Phases Execution
#
# The purpose of this file is to prototype a new way to execute
# phases locally on your workstation. The delivery-cli will read
# this file and execute the command(s) that are configured for
# each phase. You can customize them by just modifying the phase
# key on this file.
#
# By default these phases are configured for Cookbook Workflow only
#
# As this is still a prototype we are not modifying the current
# config.json file and it will continue working as usual.

[local_phases]
unit = "chef exec rspec spec/"
lint = "chef exec cookstyle --display-cop-names --extra-details"
syntax = "chef exec foodcritic ."
provision = "chef exec kitchen create"
deploy = "chef exec kitchen converge"
smoke = "chef exec kitchen verify"
functional = "echo skipping"
cleanup = "chef exec kitchen destroy"
remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml"
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
name: ci

on:
pull_request:
push:
branches:
- master

jobs:
delivery:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
- name: Run Chef Delivery
uses: actionshub/chef-delivery@master
env:
CHEF_LICENSE: accept-no-persist

yamllint:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
- name: Run yaml Lint
uses: actionshub/yamllint@master

mdl:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
- name: Run Markdown Lint
uses: actionshub/markdownlint@master
with:
path: --rules ~MD004,~MD007,~MD013,~MD024 ./

dokken:
needs:
- yamllint
- delivery
runs-on: ubuntu-latest
strategy:
matrix:
os:
- centos-7
- centos-8
- ubuntu-1604
- ubuntu-1804
- ubuntu-2004
suite:
- default
chef_version:
- 14
- 15
- 16
fail-fast: false

steps:
- name: Check out code
uses: actions/checkout@master
- name: Install Chef
uses: actionshub/chef-install@master
- name: Dokken
uses: actionshub/kitchen-dokken@master
env:
CHEF_LICENSE: accept-no-persist
CHEF_VERSION: ${{ matrix.chef_version }}
with:
suite: ${{ matrix.suite }}
os: ${{ matrix.os }}
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Offense count: 1
Style/ClassVars:
Exclude:
Expand Down
154 changes: 0 additions & 154 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
rules:
line-length: disable
14 changes: 7 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,13 @@ This file is used to list changes made in each version of zookeeper.
* Zookeeper recipe rewritten as LWRP
* Documentation updated slightly
* Tested and verified and (hopefully) as backwards-compatible as possible
- Being a full version bump, there are no backwards-compatibility promises
- Being a full version bump, there are no backwards-compatibility promises
* TODO
- Better documentation
- `zookeeper_service` resource
- `zookeeper_config` resource
- Better tests
- Swap out "community" Java
- Better documentation
- `zookeeper_service` resource
- `zookeeper_config` resource
- Better tests
- Swap out "community" Java

## v1.7.4

Expand Down Expand Up @@ -442,6 +442,6 @@ This file is used to list changes made in each version of zookeeper.

* fix for backwards compatibility with ruby 1.8.7

## v0.1.0:
## v0.1.0

* Initial release of zookeeper
52 changes: 20 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# zookeeper cookbook

[![Build Status](https://travis-ci.org/evertrue/zookeeper-cookbook.svg?branch=master)](https://travis-ci.org/evertrue/zookeeper-cookbook)
![ci](https://github.com/evertrue/zookeeper-cookbook/workflows/ci/badge.svg)
[![Cookbook Version](https://img.shields.io/cookbook/v/zookeeper.svg)](https://supermarket.chef.io/cookbooks/zookeeper)

**Table of Contents**
## Table of Contents

* [Zookeeper](#zookeeper)
- [Usage](#usage)
Expand All @@ -26,22 +26,6 @@ It should be noted that ZooKeeper’s configuration and startup systems are comp

Please be mindful if you decide to install ZooKeeper to a different location that the path to the config directory should remain pointed to the one within the install directory, unless you instead to completely rewire how ZooKeeper runs in your wrapper cookbook.

### Usage

This cookbook is primarily a library cookbook. It implements a `zookeeper` and `zookeeper_config`
resource to handle the installation and configuration of ZooKeeper. It ships
with a default recipe for backwards compatibility pre-LWRP which will work
fine, but is really just an example.

Testing is handled using Test Kitchen, with the expectation that you have it installed as part of the [Chef DK](https://downloads.chef.io/chef-dk/).

### Recipes

* `zookeeper::default` : Installs and configures ZooKeeper. This does not start or manage the service.
* `zookeeper::install` : Installs the ZooKeeper but does not configure it.
* `zookeeper::config_render` : Configures ZooKeeper but does not install it.
* `zookeeper::service` : Starts and manages the ZooKeeper service. Requires ZooKeeper to be installed/configured.

### Resources

#### `zookeeper`
Expand Down Expand Up @@ -75,23 +59,25 @@ end

This resource renders a ZooKeeper configuration file.

Actions: `:render`, `:delete`
Actions: `:create`, `:delete`

Parameters:

* `conf_file` (name attribute): Base name of the config file
* `conf_dir`: Path to write the configuration file to (defaults to `/opt/zookeeper/conf`)
* `config`: Hash of configuration parameters to add to the file
- Defaults to:
```ruby
{
'clientPort' => 2181,
'dataDir' => '/var/lib/zookeeper',
'tickTime' => 2000,
'initLimit' => 5,
'syncLimit' => 2
}
```
- Defaults to:

```ruby
{
'clientPort' => 2181,
'dataDir' => '/var/lib/zookeeper',
'tickTime' => 2000,
'initLimit' => 5,
'syncLimit' => 2
}
```

* `env_vars`: Hash of startup environment variables (defaults to `{}`)
* `log_dir`: Log directory (defaults to `/var/log/zookeeper`)
* `user`: The user to give ownership of the file to (default: `zookeeper`)
Expand All @@ -111,7 +97,7 @@ config_hash = {
zookeeper_config 'zoo.cfg' do
config config_hash
user 'zookeeper'
action :render
action :create
end
```

Expand Down Expand Up @@ -186,6 +172,8 @@ end

## Author and License

EverTrue <[email protected]>
Simple Finance <[email protected]>
* Jeff Byrnes <[email protected]>
* EverTrue <[email protected]>
* Simple Finance <[email protected]>

Apache License, Version 2.0
Loading

0 comments on commit 31b2696

Please sign in to comment.