Skip to content

Commit

Permalink
Various enhancements - refer to README
Browse files Browse the repository at this point in the history
  • Loading branch information
earsdown committed Oct 22, 2015
1 parent b0d054c commit 6d584fe
Show file tree
Hide file tree
Showing 13 changed files with 299 additions and 245 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pkg
6 changes: 5 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Copyright 2015 Johan Lyheden
Copyright holders:
2013-2015 Johan Lyheden
2015 Teaspoon of Concrete Pty Ltd

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -11,3 +13,5 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


9 changes: 0 additions & 9 deletions Modulefile

This file was deleted.

53 changes: 0 additions & 53 deletions README.markdown

This file was deleted.

68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
What is it?
===========

A Puppet module that manages tinyproxy

A fork of [Johan Lyheden's excellent tinyproxy puppet module](https://github.com/jlyheden/puppet-tinyproxy.git) with the following enhancements:
* Manage the contents of the filter file (via new `filtercontent` parameter)
* Debug support switches DefaultErrorFile to use debug.html (enable via new `debugmode` parameter)
* Manage the XTinyproxy configuration directive (via new `xtinyproxy` parameter)
* Alignment with the Puppet style guide and address puppet-lint warnings

Released under the Apache 2.0 license

Dependencies:
-------------

* puppet-concat: https://forge.puppetlabs.com/puppetlabs/concat
* puppet-stdlib: https://forge.puppetlabs.com/puppetlabs/stdlib

Usage:
------

You can install, configure and start the service simply by including the class
```puppet
include tinyproxy
```

The module supports most of tinyproxy's parameters, check init.pp for more details.
Here's an example on how to override a few parameters:
```puppet
class { 'tinyproxy':
listen => '127.0.0.1',
port => '8080',
connection_timeout => '60',
}
```

In addition you can add ACLs, headers and upstream proxies via separate resource definitions:
```puppet
tinyproxy::header { 'X-My-Header':
ensure => 'present',
value => 'Powered by Tinyproxy'
}
tinyproxy::upstream { 'my_upstream':
ensure => 'present',
proxy => 'myproxy:8080',
match => '.domain.com'
}
tinyproxy::noupstream { 'my_noupstream':
ensure => 'present',
match => '.internal.domain.com'
}
tinyproxy::reversepath { 'my_reversepath':
ensure => 'present',
path => '/mypath/',
target => 'http://www.some.server.com'
}
```

Contributing
------------
* Fork it
* Create a feature branch
* Make your changes
* Submit a PR
17 changes: 10 additions & 7 deletions manifests/header.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,28 @@
# [*namevar*]
# Required. Name of header
#
# [*ensure*]
# Optional. Ensure parameter
#
# [*value*]
# Required. Value of header
#
# [*ensure*]
# Optional. Ensure parameter
#
# === Sample usage
#
# tinyproxy::header { 'X-My-Header':
# ensure => present,
# value => 'MyValue',
# }
#
define tinyproxy::header ( $ensure = present, $value ) {
define tinyproxy::header (
$value,
$ensure = 'present',
) {
include tinyproxy::params
concat::fragment { "tinyproxy_header_${name}":
target => $tinyproxy::params::configfile,
ensure => $ensure,
target => $tinyproxy::params::configfile,
content => "AddHeader \"${name}\" \"${value}\"\n",
order => 20
order => 20,
}
}
}
Loading

0 comments on commit 6d584fe

Please sign in to comment.