This repository has been archived by the owner on Jul 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #224 from evertrue/refactor-for-chef-14-and-beyond
Refactor for Chef 14 and beyond
- Loading branch information
Showing
36 changed files
with
232 additions
and
856 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--- | ||
# Offense count: 1 | ||
Style/ClassVars: | ||
Exclude: | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
rules: | ||
line-length: disable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
@@ -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` | ||
|
@@ -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`) | ||
|
@@ -111,7 +97,7 @@ config_hash = { | |
zookeeper_config 'zoo.cfg' do | ||
config config_hash | ||
user 'zookeeper' | ||
action :render | ||
action :create | ||
end | ||
``` | ||
|
||
|
@@ -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 |
Oops, something went wrong.