caddy: Main class, includes all other classes.
caddy::config: This class handles the Caddy config.caddy::install: This class handles the Caddy archive.caddy::install::github: This class handles Caddy installation from Githubcaddy::install::repo: This class handles Caddy installation from a package repositorycaddy::install::site: This class handles Caddy installation from the official sitecaddy::service: This class handles the Caddy service.
caddy::configfile: This defined type handles a Caddy config filecaddy::vhost: This defined type handles a Caddy virtual host
Caddy::Config: Caddy config file typeCaddy::VirtualHost: Caddy virtual host type
Main class, includes all other classes.
include caddyclass { 'caddy':
caddy_features => 'http.git,http.filter,http.ipfilter',
}class { 'caddy':
version => '2.0.0',
install_method => 'github',
}The following parameters are available in the caddy class:
versioninstall_methodinstall_pathmanage_usercaddy_usermanage_groupcaddy_groupcaddy_shellcaddy_log_dircaddy_homecaddy_ssl_dircaddy_licensecaddy_telemetrycaddy_featurescaddy_architecturecaddy_account_idcaddy_api_keymanage_systemd_unitsystemd_limit_processessystemd_private_devicessystemd_capability_bounding_setsystemd_ambient_capabilitiessystemd_no_new_privilegesmanage_serviceservice_nameservice_ensureservice_enablemanage_reporepo_settingspackage_namepackage_ensuremanage_caddyfilecaddyfile_sourcecaddyfile_contentconfig_file_extensionconfig_dirpurge_config_dirconfig_enable_dirpurge_config_enable_dirconfig_filesvhost_dirpurge_vhost_dirvhost_enable_dirpurge_vhost_enable_dirvhosts
Data type: Optional[String[1]]
Which version of caddy to install when install_method is github. Must not be set otherwise.
Default value: undef
Data type: Enum['github', 'repo', 'site']
Which source to use for the Caddy installation. See https://caddyserver.com/docs/install.
github- download from Github releases (version must be set in this case)repo- install from an OS repositorysite(default) - download from the official Caddy site
Default value: 'site'
Data type: Stdlib::Absolutepath
Directory where the Caddy binary is stored. Not used when $install_method is 'repo'.
Default value: '/opt/caddy'
Data type: Boolean
Whether or not the module should create the user.
Default value: true
Data type: String[1]
The user used by the Caddy process.
Default value: 'caddy'
Data type: Boolean
Whether or not the module should create the group.
Default value: true
Data type: String[1]
The group used by the Caddy process.
Default value: 'caddy'
Data type: Stdlib::Absolutepath
Which shell is used.
Default value: '/sbin/nologin'
Data type: Stdlib::Absolutepath
Directory where the log files are stored.
Default value: '/var/log/caddy'
Data type: Stdlib::Absolutepath
Directory where the Caddy data is stored.
Default value: '/var/lib/caddy'
Data type: Stdlib::Absolutepath
Directory where Let's Encrypt certificates are stored.
Default value: '/etc/ssl/caddy'
Data type: Enum['personal', 'commercial']
Whether a personal or commercial license is used.
Default value: 'personal'
Data type: Enum['on', 'off']
Whether telemetry data should be collected.
Default value: 'off'
Data type: String[1]
A list of features the Caddy binary should support.
Default value: 'http.git,http.filter,http.ipfilter'
Data type: String[1]
A temporary variable, required for the download URL.
Default value: $facts['os']['architecture']
Data type: Optional[String[1]]
The account ID, required for the commercial license.
Default value: undef
Data type: Optional[String[1]]
The API key, required for the commercial license.
Default value: undef
Data type: Boolean
Whether or not the module should create the systemd unit file.
Default value: true
Data type: Integer[0]
The number of processes.
Default value: 64
Data type: Boolean
Whether the process has access to physical devices.
Default value: true
Data type: Optional[String[1]]
Controls which capabilities to include in the capability bounding set for the executed process.
Default value: undef
Data type: String[1]
Controls which capabilities to include in the ambient capability set for the executed process.
Default value: 'CAP_NET_BIND_SERVICE'
Data type: Optional[Boolean]
Whether the process and all its children can gain new privileges through execve().
Default value: undef
Data type: Boolean
Whether or not the module should manage the service.
Default value: true
Data type: String[1]
Customize the name of the system service.
Default value: 'caddy'
Data type: Stdlib::Ensure::Service
Whether the service should be running or stopped.
Default value: 'running'
Data type: Boolean
Whether the service should be enabled or disabled.
Default value: true
Data type: Boolean
Whether the APT/YUM(COPR) repository should be installed. Only relevant when $install_method is 'repo'.
Default value: true
Data type: Hash[String[1],Any]
Distro-specific repository settings.
Default value: {}
Data type: String[1]
Name of the caddy package to use. Only relevant when $install_method is 'repo'.
Default value: 'caddy'
Data type: Optional[String[1]]
Whether to install or remove the caddy package. Only relevant when $install_method is 'repo'.
Default value: undef
Data type: Boolean
Whether to manage Caddyfile.
Default value: true
Data type: Optional[Stdlib::Filesource]
Caddyfile source.
Default value: undef
Data type: Optional[String[1]]
Caddyfile content.
Default value: undef
Data type: Variant[Enum[''], Pattern[/^\./]]
Default extension for config and virtual host files (must include leading .)
Default value: '.conf'
Data type: Stdlib::Absolutepath
Where to store Caddy configs. Set this to /etc/caddy/conf-available to simulate nginx/apache behavior (see config_enable_dir also).
Default value: '/etc/caddy/config'
Data type: Boolean
Whether to purge Caddy config directory.
Default value: true
Data type: Optional[Stdlib::Absolutepath]
Where to load Caddy configs from. Set this parameter to /etc/caddy/conf-enabled to simulate nginx/apache behavior.
Default value: undef
Data type: Boolean
Whether to purge Caddy enabled config directory.
Default value: $purge_config_dir
Data type: Hash[String[1], Caddy::Config]
Hash of config files to create.
Default value: {}
Data type: Stdlib::Absolutepath
Where to store Caddy available virtual host configs. Set this to /etc/caddy/vhost.d if you'd prefer to keep virtual hosts separated from configs. Set this to /etc/caddy/sites-available to simulate nginx/apache behavior (see vhost_enable_dir also).
Default value: '/etc/caddy/config'
Data type: Boolean
Whether to purge Caddy available virtual host directory.
Default value: $purge_config_dir
Data type: Optional[Stdlib::Absolutepath]
Where to load Caddy virtual host configs from. Set this parameter to /etc/caddy/sites-enabled to simulate nginx/apache behavior.
Default value: undef
Data type: Boolean
Whether to purge Caddy enabled virtual host directory.
Default value: $purge_vhost_dir
Data type: Hash[String[1], Caddy::VirtualHost]
Hash of virtual hosts to create.
Default value: {}
This defined type handles a Caddy config file
caddy::configfile { 'subdomain-log':
source => 'puppet:///modules/caddy/etc/caddy/config/logging.conf',
}$log_config = @(SUBDOMAIN_LOG)
(subdomain-log) {
log {
hostnames {args[0]}
output file /var/log/caddy/{args[0]}.log
}
}
| SUBDOMAIN_LOG
caddy::configfile { 'subdomain-log':
content => $log_config,
}The following parameters are available in the caddy::configfile defined type:
Data type: Enum['present','enabled','disabled','absent']
Make the config file either present (same as disabled), enabled, disabled or absent.
Default value: 'enabled'
Data type: Optional[Stdlib::Filesource]
Source (path) for the caddy config file.
Default value: undef
Data type: Optional[String]
String with the caddy config file.
Default value: undef
Data type: Stdlib::Absolutepath
Where to store the config file.
Default value: $caddy::config_dir
Data type: Optional[Stdlib::Absolutepath]
Directory to symlink the config config file into (conf-enabled e.g.) if any.
Default value: $caddy::config_enable_dir
Data type: Variant[Enum[''], Pattern[/^\./]]
Default extension for the config file (must include leading .)
Default value: $caddy::config_file_extension
This defined type handles a Caddy virtual host
caddy::vhost { 'example1':
source => 'puppet:///modules/caddy/etc/caddy/config/example1.conf',
}caddy::vhost { 'example2:
content => 'localhost:2015',
}The following parameters are available in the caddy::vhost defined type:
Data type: Enum['present','enabled','disabled','absent']
Make the vhost either present (same as disabled), enabled, disabled or absent.
Default value: 'enabled'
Data type: Optional[Stdlib::Filesource]
Source (path) for the caddy vhost configuration.
Default value: undef
Data type: Optional[String]
String with the caddy vhost configuration.
Default value: undef
Data type: Stdlib::Absolutepath
Where to store the vhost config file.
Default value: $caddy::vhost_dir
Data type: Optional[Stdlib::Absolutepath]
Directory to symlink the vhost config file into (sites-enabled e.g.) if any.
Default value: $caddy::vhost_enable_dir
Data type: Variant[Enum[''], Pattern[/^\./]]
Default extension for the vhost config file (must include leading .)
Default value: $caddy::config_file_extension
Caddy config file type
Alias of
Struct[{
ensure => Optional[Enum['present','enabled','disabled','absent']],
source => Optional[Stdlib::Filesource],
content => Optional[String[1]],
}]Caddy virtual host type
Alias of
Struct[{
ensure => Optional[Enum['present','enabled','disabled','absent']],
source => Optional[Stdlib::Filesource],
content => Optional[String[1]],
}]