Skip to content

Commit

Permalink
v0.2.0 - freshen up
Browse files Browse the repository at this point in the history
  • Loading branch information
barnumbirr committed Nov 14, 2019
1 parent b57852a commit acac22f
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 76 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build and publish to Puppet Forge

on:
push:
tags:
- v*
- v.*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v1
- name: Build and publish module
uses: barnumbirr/action-forge-publish@master
env:
FORGE_API_KEY: ${{ secrets.FORGE_API_KEY }}
REPOSITORY_URL: https://forgeapi.puppet.com/v3/releases

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
42 changes: 42 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.git/
.*.sw[op]
.metadata
.yardoc
.yardwarns
*.iml
/.bundle/
/.idea/
/.vagrant/
/coverage/
/bin/
/doc/
/Gemfile.local
/Gemfile.lock
/junit/
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/tmp/
/vendor/
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/appveyor.yml
/.fixtures.yml
/Gemfile
/.gitattributes
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/Rakefile
/rakelib/
/.rspec
/.rubocop.yml
/.travis.yml
/.yardopts
/spec/
/.vscode/
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![Puppet Forge](https://img.shields.io/puppetforge/v/barnumbirr/rinetd.svg)](https://forge.puppetlabs.com/barnumbirr/rinetd)
[![Puppet Forge - downloads](https://img.shields.io/puppetforge/dt/barnumbirr/rinetd.svg)](https://forge.puppetlabs.com/barnumbirr/rinetd)
[![Puppet Forge - scores](https://img.shields.io/puppetforge/f/barnumbirr/rinetd.svg)](https://forge.puppetlabs.com/barnumbirr/rinetd)

1. [Description](#description)
2. [Usage - Configuration options](#usage)
Expand All @@ -12,7 +11,7 @@

## Description

Install and manage [rinetd(8) - internet “redirection server”](https://www.boutell.com/rinetd/) via Puppet.
Install and manage [rinetd(8) - internet “redirection server”](https://github.com/boutell/rinetd) via Puppet.

## Usage

Expand All @@ -33,7 +32,7 @@ class { 'rinetd':

##### Using hiera

```puppet
```yaml
rinetd::allow:
- '192.168.178.1'
- '10.24.0.1'
Expand All @@ -56,7 +55,7 @@ class { 'rinetd':

##### Using hiera

```puppet
```yaml
rinetd::rules:
- '192.168.178.1 8080 10.24.0.1 443'
- '10.24.42.1 5901 192.168.7.49 3456'
Expand Down Expand Up @@ -86,7 +85,7 @@ class { 'rinetd':

##### Using hiera

```puppet
```yaml
rinetd::logcommon: true
```

Expand All @@ -95,12 +94,11 @@ rinetd::logcommon: true
| Parameter | Type | Default | Description |
| :-------------------| :------ |:------------------- | :---------- |
| allow | array | [] | set allow rules |
| autoupgrade | boolean | false | ugrade package automatically if there is a newer version |
| deny | array | [] | set deny rules |
| rules | array | [] | set forwarding rules |
| logfile | string | /var/log/rinetd.log | set logfile path |
| logcommon | boolean | false | use web-server style logfile format |
| ensure | string | present | latest,present or absent |
| package_ensure | string | present | latest,present or absent |
| service_manage | boolean | true | manage rinetd service state |
| service_restart | boolean | true | manage service restart |

Expand Down
7 changes: 0 additions & 7 deletions TODO.md

This file was deleted.

63 changes: 16 additions & 47 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
# Activate web server-style "common log format" logging.
# Default: false
#
# [*ensure*]
# Ensure if present or absent.
# [*package_ensure*]
# Ensure present, latest or absent.
# Default: present
#
# [*service_manage*]
Expand All @@ -51,53 +51,22 @@
# See README
#
class rinetd(
$allow = [],
$autoupgrade = false,
$deny = [],
$rules = [],
$logfile = '/var/log/rinetd.log',
$logcommon = false,
$ensure = 'present',
$service_manage = true,
$service_restart = true,
Array $allow = [],
Array $deny = [],
Array $rules = [],
Stdlib::Absolutepath $logfile = '/var/log/rinetd.log',
Boolean $logcommon = false,
Enum['present', 'latest', 'absent'] $package_ensure = 'present',
Boolean $service_manage = true,
Boolean $service_restart = true,
) {

validate_array($allow)
validate_array($deny)
validate_array($rules)

validate_bool($autoupgrade)
validate_bool($logcommon)
validate_bool($service_manage)
validate_bool($service_restart)

validate_absolute_path($logfile)

validate_string($ensure)

case $ensure {
/(present)/: {
if $autoupgrade == true {
$package_ensure = 'latest'
} else {
$package_ensure = 'present'
}
$service_ensure = 'running'
$service_enable = true
}
/(absent)/: {
$package_ensure = 'absent'
$service_ensure = 'stopped'
$service_enable = false
}
/(purged)/: {
$package_ensure = 'purged'
$service_ensure = 'stopped'
$service_enable = false
}
default: {
fail('ensure parameter must be present, absent or purged')
}
if $package_ensure == 'absent' {
$service_ensure = 'stopped'
$service_enable = false
} else {
$service_ensure = 'running'
$service_enable = true
}

package { 'rinetd':
Expand Down
44 changes: 29 additions & 15 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
{
"name": "barnumbirr-rinetd",
"version": "0.1.0",
"version": "0.2.0",
"author": "barnumbirr",
"summary": "Install and manage rinetd(8) via Puppet",
"license": "Apache-2.0",
"description": "Install and manage rinetd(8) via Puppet",
"source": "https://github.com/barnumbirr/puppet-rinetd.git",
"project_page": "https://github.com/barnumbirr/puppet-rinetd",
"issues_url": "https://github.com/barnumbirr/puppet-rinetd/issues",
"tags": [
"networking",
"TCP",
"proxy",
"rinetd"
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": ">=2.6.0 < 7.0.0"
}
],
"operatingsystem_support": [
{
"operatingsystem": "Debian"
"operatingsystem": "Debian",
"operatingsystemrelease": [
"8",
"9",
"10"
]
},
{
"operatingsystem": "Ubuntu"
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"14.04",
"16.04",
"18.04",
"19.04"
]
}
],
"requirements": [
Expand All @@ -28,10 +38,14 @@
"version_requirement": ">=4.10.0 < 7.0.0"
}
],
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": ">=2.6.0 < 7.0.0"
}
]
"description": "Install and manage rinetd(8) via Puppet",
"tags": [
"networking",
"TCP",
"proxy",
"rinetd"
],
"pdk-version": "1.14.1",
"template-url": "pdk-default#1.10.0",
"template-ref": "1.10.0-0-gbba9ac3"
}

0 comments on commit acac22f

Please sign in to comment.