https://github.com/mybuilder/puppet-kongfig
Puppet module for installing Kongfig
https://github.com/mybuilder/puppet-kongfig
Last synced: about 2 months ago
JSON representation
Puppet module for installing Kongfig
- Host: GitHub
- URL: https://github.com/mybuilder/puppet-kongfig
- Owner: mybuilder
- License: apache-2.0
- Created: 2015-10-23T09:23:59.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-01-04T23:27:02.000Z (over 6 years ago)
- Last Synced: 2025-03-06T20:14:03.213Z (over 1 year ago)
- Language: Ruby
- Size: 12.7 KB
- Stars: 1
- Watchers: 9
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Puppet module for installing and managing [Kongfig](https://github.com/mybuilder/kongfig) - a tool for [Kong](https://getkong.org/) to allow declarative configuration.
# Kongfig
This module is currently tested on:
- Debian (8.0, 7.8)
- Ubuntu (14.04)
It may work on other distros.
## Configuring Kong
Configuring a new api is easy, simply call `kongfig::setup` with an array of apis and consumers you want configured.
```puppet
$apis = [
{
'name' => "test-api",
'ensure' => "present",
'attributes' => {
'upstream_url' => "http://test-api.internal.example.com",
'request_host' => "test-api.example.com",
},
'plugins' => [
{ 'name' => 'cors' },
{ 'name' => 'file-log', 'attributes' => { 'config.path' => '/var/log/kong.log' } },
]
},
{
'name' => "old-api",
'ensure' => "removed",
'attributes' => {
'upstream_url' => "http://old-api.internal.example.com",
'request_host' => "old-api.example.com",
},
'plugins' => [
{ 'name' => 'cors' },
]
}
]
$consumers = [
{
'username' => 'iphone-app',
'credentials' => [
{
'name' => 'key-auth',
'attributes' => {
'key' => 'very-secret-key'
}
}
]
}
]
kongfig::setup { 'test-api':
kong_server => '127.0.0.1',
kong_port => 8001,
apis => $apis,
consumers => $consumers
}
```
## Installing Kongfig
Whenever you use `kongfig:setup` it will ensure that the latest version of [Kongfig](https://www.npmjs.com/package/kongfig) is installed.
If you want to install a specific version you can do this
```puppet
class { 'kongfig':
version => '1.0.3',
directory => '/tmp'
}
```
---
Created by [MyBuilder](http://www.mybuilder.com/) - Check out our [blog](http://tech.mybuilder.com/) for more information and our other open-source projects.