Skip to content

Latest commit

 

History

History
285 lines (163 loc) · 6.27 KB

REFERENCE.md

File metadata and controls

285 lines (163 loc) · 6.27 KB

Reference

Table of Contents

Classes

Public Classes

  • caddy: Main class, includes all other classes.

Private Classes

  • caddy::config: This class handles the Caddy config.
  • caddy::install: This class handles the Caddy archive.
  • caddy::service: This class handles the Caddy service.

Defined types

  • caddy::vhost: This defined type handles the Caddy virtual hosts.

Classes

caddy

Main class, includes all other classes.

Examples

Basic usage
include caddy
Install customised version of Caddy
class { 'caddy':
  caddy_features => 'http.git,http.filter,http.ipfilter',
}
Install specific version of Caddy
class { 'caddy':
  version        => '2.0.0',
  install_method => 'github',
}

Parameters

The following parameters are available in the caddy class:

version

Data type: String[1]

Which version is used.

Default value: '2.0.0'

install_method

Data type: Optional[Enum['github']]

Which source is used.

Default value: undef

install_path

Data type: Stdlib::Absolutepath

Directory where the Caddy binary is stored.

Default value: '/opt/caddy'

caddy_user

Data type: String[1]

The user used by the Caddy process.

Default value: 'caddy'

caddy_group

Data type: String[1]

The group used by the Caddy process.

Default value: 'caddy'

caddy_shell

Data type: Stdlib::Absolutepath

Which shell is used.

Default value: '/sbin/nologin'

caddy_log_dir

Data type: Stdlib::Absolutepath

Directory where the log files are stored.

Default value: '/var/log/caddy'

caddy_home

Data type: Stdlib::Absolutepath

Directory where the Caddy data is stored.

Default value: '/var/lib/caddy'

caddy_ssl_dir

Data type: Stdlib::Absolutepath

Directory where Let's Encrypt certificates are stored.

Default value: '/etc/ssl/caddy'

caddy_license

Data type: Enum['personal', 'commercial']

Whether a personal or commercial license is used.

Default value: 'personal'

caddy_telemetry

Data type: Enum['on','off']

Whether telemetry data should be collected.

Default value: 'off'

caddy_features

Data type: String[1]

A list of features the Caddy binary should support.

Default value: 'http.git,http.filter,http.ipfilter'

caddy_architecture

Data type: String[1]

A temporary variable, required for the download URL.

Default value: $facts['os']['architecture']

caddy_account_id

Data type: Optional[String[1]]

The account ID, required for the commercial license.

Default value: undef

caddy_api_key

Data type: Optional[String[1]]

The API key, required for the commercial license.

Default value: undef

systemd_limit_processes

Data type: Integer[0]

The number of processes.

Default value: 64

systemd_private_devices

Data type: Boolean

Whether the process has access to physical devices.

Default value: true

systemd_capability_bounding_set

Data type: Optional[String[1]]

Controls which capabilities to include in the capability bounding set for the executed process.

Default value: undef

systemd_ambient_capabilities

Data type: String[1]

Controls which capabilities to include in the ambient capability set for the executed process.

Default value: 'CAP_NET_BIND_SERVICE'

systemd_no_new_privileges

Data type: Optional[Boolean]

Whether the process and all its children can gain new privileges through execve().

Default value: undef

Defined types

caddy::vhost

This defined type handles the Caddy virtual hosts.

Examples

Configure virtual host, based on source
caddy::vhost { 'example1':
  source => 'puppet:///modules/caddy/etc/caddy/config/example1.conf',
}
Configure virtual host, based on content
caddy::vhost { 'example2:
  content => 'localhost:2015',
}

Parameters

The following parameters are available in the caddy::vhost defined type:

source

Data type: Optional[Stdlib::Filesource]

source (path) for the caddy vhost configuration

Default value: undef

content

Data type: Optional[String]

string with the caddy vhost configuration

Default value: undef