Skip to content
This repository has been archived by the owner on Jan 29, 2022. It is now read-only.

Final updates before release #101

Merged
merged 1 commit into from
May 17, 2019
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: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ gem 'activerecord', '4.2.11', require: 'active_record'
gem 'bcrypt'
gem 'github_changelog_generator'
gem 'mcollective-client'
gem 'pry'
gem 'puma'
gem 'puppet_forge', '2.2.8'
gem 'r10k'
Expand All @@ -25,6 +24,9 @@ gem 'warden'

group :development do
gem 'debase'
gem 'pry'
gem 'pry-byebug'
gem 'rack-console'
gem 'rubocop'
gem 'ruby-debug-ide'
gem 'yard'
Expand Down
9 changes: 9 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ GEM
bcrypt (3.1.12)
bond (0.5.1)
builder (3.2.3)
byebug (11.0.1)
capybara (3.15.0)
addressable
mini_mime (>= 0.1.3)
Expand Down Expand Up @@ -109,6 +110,9 @@ GEM
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
pry-byebug (3.7.0)
byebug (~> 11.0)
pry (~> 0.10)
psych (3.1.0)
public_suffix (3.0.3)
puma (3.12.1)
Expand All @@ -126,6 +130,9 @@ GEM
multi_json (~> 1.10)
puppet_forge (~> 2.2.8)
rack (2.0.6)
rack-console (1.3.1)
rack (>= 1.1)
rack-test
rack-protection (2.0.5)
rack
rack-test (1.1.0)
Expand Down Expand Up @@ -251,9 +258,11 @@ DEPENDENCIES
github_changelog_generator
mcollective-client
pry
pry-byebug
puma
puppet_forge (= 2.2.8)
r10k
rack-console
rack-test
rake
require_all
Expand Down
98 changes: 98 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,101 @@ $ cd /opt/puppet_webhook && bundle install
$ bundle exec puma config.ru
```

#### Docker Compose
Experience with Docker and Docker Compose are assumed. The Docker Compose setup expects that the Webhook API container volumes will have access to the codedir, either via NFS or on system.

1. Download the sample `docker-compose.yml` file from the github repo:
```
$ wget -O docker-compose.yml https://raw.githubusercontent.com/voxpupuli/puppet_webhook/master/build/docker/docker-compose.yml
```
2. Edit the image, environment, and volumes keys based on your own needs.
3. run `docker-compose up`

#### What about RPM/DEB/Arch/Helm/ETC

Packages for RPM and Deb systems are in the works, but are taking a bit longer to roll out due to needing to package the dependencies with the application. An Arch package is also on the way.

A Helm chart is planned for the future, but not currently in development as we work to iron out any issues with the Webhook API Server after the initial 2.x release.

## Configuration

Puppet Webhook API configuration is maintained by the config.yml file in the `APP_ROOT/config` directory. Many options have sane defaults applied, but a few are required for base functionality.

### Authentication

#### `protected`

type: Boolean
description: Enforces authentication via basic auth or API token.
default: false

#### `user`

type: String
description: Username to use for Basic Authorization. Optional
default: `nil`

#### `password`

type: String
description: Password to use for Basic Authorization. Optional
default: `nil`

### Chatops Notifications

#### `chatops`

type: Boolean
description: Send notifications to a chatops service. Required.
default: false

#### `chatops_service`

type: String
description: Which chatops service to send to. Only `slack` and `rocketchat` supported at this time.
default: `nil`

#### `chatops_url`

type: String
description: Webhook/Notification url to send to.
default: `nil`

#### `chatops_channel`

type: String
description: Channel/Room to post notification to.
default: `nil`

#### `chatops_user`

type: String
description: User to post notification as.
default: `nil`

#### `chatops_options`

type: String
description: Any additional options to pass the chatops service.
default: `nil`

### R10K Settings

#### `default_branch`

type: String
description: Default controlrepo branch to use if none specified.
Default: `production`

#### `ignore_environments`

type: Array[String]
description: Any environments to ignore.
Default: []

#### `allow_uppercase`

type: Boolean
description: Allow uppercase within the name of the module or environment passed to the API.
default: true

6 changes: 3 additions & 3 deletions build/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
version: '3.7'
version: '3'
services:
app:
image: 'voxpupuli/puppet_webhook:nightly'
image: 'voxpupuli/puppet_webhook:latest'
ports:
- "9292:9292"
environment:
Expand All @@ -14,7 +14,7 @@ services:
redis:
image: "redis:alpine"
sidekiq:
image: "voxpupuli/puppet_webhook:nightly"
image: "voxpupuli/puppet_webhook:latest"
entrypoint: ""
command: "bash -c 'cd app/ && bundle exec sidekiq -r /app/config/environment.rb'"
environment:
Expand Down
8 changes: 1 addition & 7 deletions config/config.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@ development:
user: puppet
pass: puppet

# Mcollective
use_mcollective: false

# Chatops Notification
chatops: false

# R10k
default_branch: production
ignore_environments: []
prefix_command: ''
r10k_deploy_arguments: "-pv"
allow_uppercase: true
command_prefix: 'umask 0022;'

test: &development
test: &development