Puppet Class: hashicorp::consul
- Defined in:
- manifests/consul.pp
Overview
ex: syntax=puppet si sw=2 ts=2 et
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'manifests/consul.pp', line 2
class hashicorp::consul (
$version,
$config_dir = undef,
$advertise_addr = undef,
$advertise_addr_wan = undef,
$bind_addr = undef,
$bootstrap_expect = undef,
$client_addr = undef,
$datacenter = undef,
$data_dir = undef,
$domain = undef,
$encrypt = undef,
$log_level = undef,
$node_name = undef,
$raft_protocol = undef,
$retry_join = undef,
$retry_join_wan = undef,
$server = undef,
$service = undef,
$service_ensure = undef,
$service_enable = undef,
) {
include ::hashicorp
hashicorp::download { 'consul':
version => $version,
}
File {
ensure => present,
owner => $::hashicorp::defaults::config_owner,
group => $::hashicorp::defaults::config_group,
mode => '0640',
}
file { $config_dir:
ensure => directory,
mode => '0755',
}
file { "${config_dir}/config.json":
content => template('hashicorp/consul.conf.erb'),
before => Anchor['hashicorp::config::consul'],
}
anchor { 'hashicorp::config::consul': }
if $service {
class { 'hashicorp::consul::service':
ensure => $service_ensure,
enable => $service_enable,
}
File["${config_dir}/config.json"] ~> Service['consul']
}
}
|