Forge Home

trafficserver

Manage Apache Traffic Server installation and configuration

24,286 downloads

17,900 latest version

4.3 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 1.0.6 (latest)
  • 1.0.5
  • 1.0.4
  • 1.0.3 (deleted)
  • 0.2.3
  • 0.2.2
  • 0.2.1
  • 0.2.0
released Dec 5th 2016
This version is compatible with:
  • Puppet Enterprise 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 3.0.0 < 5.0.0
  • Ubuntu, Debian, RedHat, CentOS, FreeBSD

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'brainsware-trafficserver', '1.0.6'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add brainsware-trafficserver
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install brainsware-trafficserver --version 1.0.6

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

brainsware/trafficserver — version 1.0.6 Dec 5th 2016

Puppet Module for Apache Traffic Server

manage installation and configuration of Apache Traffic Server.

Currently supported modes: Forward, Reverse and mixed. Supported Platforms: Debian/Ubuntu, FreeBSD: partially. Solaris/Illumos: untested.

It allows to separately configure plugins, SSL certs and Remap Rules. Storage is configured globally.

This plugin assumes that you have current version of Apache Traffic Server in your packagemanager's repositories. See my ppa for a current version for all Ubuntu LTSes.

Documentation

Install Traffic Server

include trafficserver

Installing Traffic Server, enabling SSL.

class { 'trafficserver':
  ssl => true,
}

Install it in some weird prefix:

class { 'trafficserver':
  prefix     => '/opt/es',
  sysconfdir => '/etc/es/trafficserver',
}

Install it, assign a couple of disks:

include ::trafficserver
trafficserver::storage { '/dev/sda': }
trafficserver::storage { '/dev/sdb': }

Maybe you would prefer to keep cache in a directory on one disk:

trafficserver::storage { '/var/cache/trafficserver': }

Plugins

Configure gzip plugin:

trafficserver_plugin { 'gzip.so':
  arguments => '/etc/trafficserver/gzip.config'
}

Configure stats_over_http plugin. Really, this should be some default:

trafficserver_plugin { 'stats_over_http.so': }

Configure balancer plugin. Don't use plugin class. Configure a couple of balancer map:

Remap

Configure a couple of remaps:

trafficserver::remap { 'example.com'
  from => 'http://example.com',
  to   => 'http://backend-web01',
}
trafficserver::remap { 'example.org
  from => 'http://example.org,
  to => 'http://backend-web21',
}
trafficserver::remap { 'example.net':
  from => 'http://example.net',
  to   => 'http://backend-web42',
}

trafficserver::remap { 'rev example.com':
  type => reverse_map,
  from => 'http://backend-web01',
  to   => 'http://example.com',
}
trafficserver::remap { 'rev example.org':
  type => reverse_map,
  from => 'http://backend-web21',
  to   => 'http://example.org',
}
trafficserver::remap { 'rev example.org':
  type => reverse_map,
  from => 'http://backend-web42'
  to   => 'http://example.net',
}

trafficserver::remap { 'redirect co.uk':
  type => redirect,
  from => 'http://example.co.uk',
  to   => 'http://example.com/uk',
}

SSL

Similarily to remap, we can can setup multiple SSL virtual hosts.

trafficserver_ssl_multicert { 'example.com':
  ssl_cert_name => 'www.example.com.crt',
  ssl_key_name  => 'www.example.com.key',
}
trafficserver_ssl_multicert { 'mail.example.com':
  ssl_cert_name => 'mail.example.com.crt',
  ssl_key_name  => 'mail.example.com.key',
}

Filters

Using trafficserver::remap::definefilter we can define filters:

trafficserver::remap::definefilter { 'title for disable_delete_purge':
  name   => 'disable_delete_purge',
  filter => [
    '@action=deny',
    '@method=delete',
    '@method=purge',
  ],
}

trafficserver::remap::definefilter { 'internal_only':
  filter => [
    '@action=allow',
    '@src_ip=192.168.0.1-192.168.0.254',
    '@src_ip=10.0.0.1-10.0.0.254',
  ],
}

…and then reuse them:

trafficserver::remap { 'activate delete_purge':
  activatefilter => 'disable_delete_purge',
  order          => -1,
}

trafficserver::remap { 'foo to bar':
  from => 'http://foo.example.com/',
  to   => 'http://bar.example.com/',
}

trafficserver::remap { 'map admin (internal only)':
  activatefilter   => 'internal_only',
  from             => 'http://www.example.com/admin',
  to               => 'http://internal.example.com/admin',
  deactivatefilter => 'internal_only',
}

trafficserver::remap { 'example':
  from => 'http://www.example.com/',
  to   => 'http://internal.example.com/',
}

Release process

When cutting a new release, please

  • make sure that all tests pass
  • make sure that the documentation is up-to-date
  • verify that all dependencies are correct, and up-to-date
  • create a new, signed tag and a package, using rake travis_release:

License

Apache Software License 2.0

Contact

You can send us questions via mail puppet@brainsware.org, or reach us IRC: igalic hangs out in #puppet

Support

Please log tickets and issues at our Project's issue tracker