Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f6a429bdf1 | |||
| 20a65dafcd | |||
| 368e98f747 | |||
| b1ee318394 | |||
| 2651449d57 | |||
| 674f51a44b | |||
| 3e90f5907c | |||
| 9d25ba1d9a | |||
| f35b385714 |
@@ -2,6 +2,6 @@
|
||||
profiles::consul::server::bootstrap_count: 3
|
||||
profiles::consul::server::raft_multiplier: 10
|
||||
profiles::consul::server::primary_datacenter: 'au-syd1'
|
||||
profiles::consul::server::join_remote_regions: true
|
||||
profiles::consul::server::join_remote_regions: false
|
||||
profiles::consul::server::remote_regions:
|
||||
- syd1
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
profiles::consul::server::bootstrap_count: 3
|
||||
profiles::consul::server::raft_multiplier: 10
|
||||
profiles::consul::server::primary_datacenter: 'au-syd1'
|
||||
profiles::consul::server::join_remote_regions: true
|
||||
profiles::consul::server::join_remote_regions: false
|
||||
profiles::consul::server::remote_regions:
|
||||
- drw1
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
---
|
||||
profiles::postfix::gateway::myhostname: 'mta2.edge.unkin.net'
|
||||
@@ -1,2 +0,0 @@
|
||||
---
|
||||
profiles::postfix::gateway::myhostname: 'mta1.edge.unkin.net'
|
||||
@@ -1,19 +1,26 @@
|
||||
---
|
||||
|
||||
# additional altnames
|
||||
profiles::pki::vault::alt_names:
|
||||
- in-mta.main.unkin.net
|
||||
|
||||
# base postfix configuration (passed to postfix class)
|
||||
postfix::relayhost: 'direct'
|
||||
postfix::myorigin: 'unkin.net'
|
||||
postfix::myorigin: 'main.unkin.net'
|
||||
postfix::mydestination: 'blank'
|
||||
postfix::mynetworks: '127.0.0.0/8 [::1]/128 103.216.191.185/32'
|
||||
postfix::mynetworks: '127.0.0.0/8 [::1]/128'
|
||||
postfix::mta: true
|
||||
postfix::manage_aliases: true
|
||||
|
||||
# profile parameters for customization
|
||||
profiles::postfix::gateway::myhostname: 'in-mta.main.unkin.net'
|
||||
|
||||
# postfix map content (templates)
|
||||
profiles::postfix::gateway::relay_recipients_maps:
|
||||
'@unkin.net': 'OK'
|
||||
'@main.unkin.net': 'OK'
|
||||
|
||||
profiles::postfix::gateway::relay_domains_maps:
|
||||
'unkin.net': 'OK'
|
||||
'main.unkin.net': 'OK'
|
||||
|
||||
profiles::postfix::gateway::postscreen_access_maps:
|
||||
'127.0.0.1/32': 'permit'
|
||||
@@ -25,24 +32,21 @@ profiles::postfix::gateway::helo_access_maps:
|
||||
'unknown': 'REJECT'
|
||||
'localhost': 'REJECT You are not localhost'
|
||||
|
||||
profiles::postfix::gateway::smtp_tls_policy_maps:
|
||||
'[mail-in.main.unkin.net]:25': 'secure match=hostname'
|
||||
|
||||
# postfix transports
|
||||
postfix::transports:
|
||||
'unkin.net':
|
||||
'main.unkin.net':
|
||||
ensure: present
|
||||
destination: 'relay'
|
||||
nexthop: '[mail-in.main.unkin.net]:25'
|
||||
nexthop: 'mail-in.main.unkin.net:25'
|
||||
|
||||
# postfix virtuals
|
||||
postfix::virtuals:
|
||||
'root':
|
||||
ensure: present
|
||||
destination: 'ben@unkin.net'
|
||||
destination: 'ben@main.unkin.net'
|
||||
'postmaster':
|
||||
ensure: present
|
||||
destination: 'ben@unkin.net'
|
||||
destination: 'ben@main.unkin.net'
|
||||
'abuse':
|
||||
ensure: present
|
||||
destination: 'ben@unkin.net'
|
||||
destination: 'ben@main.unkin.net'
|
||||
|
||||
@@ -13,9 +13,19 @@ profiles::consul::server::addresses:
|
||||
grpc_tls: "%{::networking.ip}"
|
||||
profiles::consul::server::ports:
|
||||
grpc: 8502
|
||||
grpc_tls: 8503
|
||||
dns: 8600
|
||||
http: 8500
|
||||
https: -1
|
||||
profiles::consul::server::tls:
|
||||
defaults:
|
||||
ca_file: /etc/pki/ca-trust/source/anchors/vaultcaroot.pem
|
||||
cert_file: /etc/pki/tls/vault/full_chain.crt
|
||||
key_file: /etc/pki/tls/vault/private.key
|
||||
internal_rpc:
|
||||
verify_incoming: false
|
||||
verify_outgoing: false
|
||||
verify_server_hostname: false
|
||||
profiles::consul::server::acl:
|
||||
enabled: true
|
||||
default_policy: 'deny'
|
||||
@@ -48,6 +58,18 @@ profiles::consul::client::node_rules:
|
||||
- resource: service
|
||||
segment: frr_exporter
|
||||
disposition: write
|
||||
- resource: service
|
||||
segment: mesh-gateway
|
||||
disposition: write
|
||||
- resource: service_prefix
|
||||
segment: ''
|
||||
disposition: read
|
||||
- resource: node_prefix
|
||||
segment: ''
|
||||
disposition: read
|
||||
- resource: agent_prefix
|
||||
segment: ''
|
||||
disposition: read
|
||||
profiles::consul::prepared_query::rules:
|
||||
vault:
|
||||
ensure: 'present'
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
# profiles::consul::mesh_gateway
|
||||
class profiles::consul::mesh_gateway (
|
||||
Stdlib::IP::Address $address = $facts['networking']['ip'],
|
||||
Stdlib::Port $port = 8443,
|
||||
Stdlib::Port $http_port = 8500,
|
||||
Stdlib::Port $grpc_port = 8502,
|
||||
Stdlib::Absolutepath $token_file = '/etc/consul.d/mesh-gateway.token',
|
||||
) {
|
||||
include profiles::consul::client
|
||||
|
||||
# include after profiles::consul::server, which declares Class['consul'] only once /data is mounted
|
||||
if defined(Class['consul']) {
|
||||
package { 'envoy':
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
file { $token_file:
|
||||
ensure => file,
|
||||
owner => 'consul',
|
||||
group => 'consul',
|
||||
mode => '0600',
|
||||
require => Class['consul'],
|
||||
content => Sensitive(fqdn_uuid("${facts['networking']['fqdn']}-${profiles::consul::client::secret_id_salt}")),
|
||||
}
|
||||
|
||||
systemd::unit_file { 'consul-mesh-gateway.service':
|
||||
enable => true,
|
||||
active => true,
|
||||
content => @("UNIT"),
|
||||
[Unit]
|
||||
Description=Consul mesh gateway (envoy)
|
||||
Requires=consul.service
|
||||
After=consul.service
|
||||
|
||||
[Service]
|
||||
User=consul
|
||||
Group=consul
|
||||
ExecStart=/usr/bin/consul connect envoy -gateway=mesh -register -service=mesh-gateway -expose-servers \
|
||||
-address=${address}:${port} -wan-address=${address}:${port} \
|
||||
-http-addr=http://${address}:${http_port} -grpc-addr=http://${address}:${grpc_port} \
|
||||
-token-file=${token_file}
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
| UNIT
|
||||
require => [Package['envoy'], Class['consul']],
|
||||
subscribe => File[$token_file],
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ class profiles::consul::server (
|
||||
Hash $acl = {},
|
||||
Hash $ports = {},
|
||||
Hash $addresses = {},
|
||||
Hash $tls = {},
|
||||
Boolean $members_lookup = false,
|
||||
String $members_role = undef,
|
||||
Array $consul_servers = [],
|
||||
@@ -112,6 +113,8 @@ class profiles::consul::server (
|
||||
'acl' => $acl,
|
||||
'ports' => $ports,
|
||||
'addresses' => $addresses,
|
||||
'tls' => $tls,
|
||||
'auto_reload_config' => true,
|
||||
'disable_remote_exec' => $disable_remote_exec,
|
||||
'disable_update_check' => $disable_update_check,
|
||||
'domain' => $domain,
|
||||
@@ -129,7 +132,7 @@ class profiles::consul::server (
|
||||
'advertise_addr' => $advertise_addr,
|
||||
'retry_join' => $servers_array,
|
||||
'retry_join_wan' => $remote_servers_array,
|
||||
'connect' => { 'enabled' => true },
|
||||
'connect' => { 'enabled' => true, 'enable_mesh_gateway_wan_federation' => true },
|
||||
'recursors' => ['198.18.19.16'],
|
||||
},
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@ class profiles::postfix::gateway (
|
||||
Stdlib::Absolutepath $tls_key_file = '/etc/pki/tls/vault/certificate.pem',
|
||||
Stdlib::Absolutepath $tls_ca_file = '/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem',
|
||||
String $myhostname = $trusted['certname'],
|
||||
String $message_size_limit = '52428800',
|
||||
String $message_size_limit = '133169152',
|
||||
String $mailbox_size_limit = '133169152',
|
||||
String $local_transport = 'error:No local mail delivery',
|
||||
Boolean $enable_postscreen = true,
|
||||
Array[String] $alias_maps = [
|
||||
@@ -11,12 +12,12 @@ class profiles::postfix::gateway (
|
||||
'hash:/etc/postfix/aliases',
|
||||
],
|
||||
Array[String] $postscreen_dnsbl_sites = [
|
||||
'zen.spamhaus.org=127.0.0.[2..11]*3',
|
||||
'b.barracudacentral.org=127.0.0.2*2',
|
||||
'bl.mailspike.net=127.0.0.2*1',
|
||||
'psbl.surriel.com=127.0.0.2*1',
|
||||
'bl.spameatingmonkey.net=127.0.0.2*2',
|
||||
'bl.spamcop.net=127.0.0.2',
|
||||
'zen.spamhaus.org*3',
|
||||
'b.barracudacentral.org=127.0.0.[2..11]*2',
|
||||
'bl.spameatingmonkey.net*2',
|
||||
'bl.spamcop.net',
|
||||
'dnsbl.sorbs.net',
|
||||
'swl.spamhaus.org*-4',
|
||||
'list.dnswl.org=127.[0..255].[0..255].0*-2',
|
||||
'list.dnswl.org=127.[0..255].[0..255].1*-4',
|
||||
'list.dnswl.org=127.[0..255].[0..255].[2..3]*-6',
|
||||
@@ -24,6 +25,7 @@ class profiles::postfix::gateway (
|
||||
Array[String] $smtpd_client_restrictions = [
|
||||
'permit_sasl_authenticated',
|
||||
'permit_mynetworks',
|
||||
'reject_rbl_client zen.spamhaus.org',
|
||||
],
|
||||
Array[String] $smtpd_sender_restrictions = [
|
||||
'permit_sasl_authenticated',
|
||||
@@ -45,7 +47,6 @@ class profiles::postfix::gateway (
|
||||
'permit_mynetworks',
|
||||
'reject_unauth_destination',
|
||||
],
|
||||
String $smtpd_milters = 'inet:127.0.0.1:11332',
|
||||
Hash[String, String] $smtp_tls_policy_maps = {},
|
||||
Hash[String, String] $sender_canonical_maps = {},
|
||||
Hash[String, String] $sender_access_maps = {},
|
||||
@@ -72,7 +73,7 @@ class profiles::postfix::gateway (
|
||||
'value' => 'permit_mynetworks, cidr:/etc/postfix/postscreen_access'
|
||||
},
|
||||
'postscreen_blacklist_action' => {
|
||||
'value' => 'drop'
|
||||
'value' => 'enforce'
|
||||
},
|
||||
'postscreen_cache_map' => {
|
||||
'value' => 'btree:$data_directory/postscreen_cache'
|
||||
@@ -86,10 +87,6 @@ class profiles::postfix::gateway (
|
||||
'postscreen_dnsbl_threshold' => {
|
||||
'value' => '2'
|
||||
},
|
||||
# el9 ships postfix 3.5, before the allowlist rename
|
||||
'postscreen_dnsbl_whitelist_threshold' => {
|
||||
'value' => '-1'
|
||||
},
|
||||
'postscreen_greet_action' => {
|
||||
'value' => 'enforce'
|
||||
},
|
||||
@@ -111,6 +108,9 @@ class profiles::postfix::gateway (
|
||||
'alias_database' => {
|
||||
'value' => $alias_maps_string
|
||||
},
|
||||
'default_destination_recipient_limit' => {
|
||||
'value' => '1'
|
||||
},
|
||||
'disable_vrfy_command' => {
|
||||
'value' => 'yes'
|
||||
},
|
||||
@@ -129,6 +129,9 @@ class profiles::postfix::gateway (
|
||||
'local_transport' => {
|
||||
'value' => $local_transport
|
||||
},
|
||||
'mailbox_size_limit' => {
|
||||
'value' => $mailbox_size_limit
|
||||
},
|
||||
'message_size_limit' => {
|
||||
'value' => $message_size_limit
|
||||
},
|
||||
@@ -138,20 +141,8 @@ class profiles::postfix::gateway (
|
||||
'non_smtpd_milters' => {
|
||||
'ensure' => 'blank'
|
||||
},
|
||||
'milter_connect_timeout' => {
|
||||
'value' => '10s'
|
||||
},
|
||||
'milter_content_timeout' => {
|
||||
'value' => '60s'
|
||||
},
|
||||
'milter_default_action' => {
|
||||
'value' => 'tempfail'
|
||||
},
|
||||
'milter_mail_macros' => {
|
||||
'value' => 'i {mail_addr} {client_addr} {client_name} {auth_authen}'
|
||||
},
|
||||
'milter_protocol' => {
|
||||
'value' => '6'
|
||||
'qmqpd_authorized_clients' => {
|
||||
'value' => '127.0.0.1 [::1]'
|
||||
},
|
||||
'recipient_canonical_maps' => {
|
||||
'value' => 'hash:/etc/postfix/recipient_canonical'
|
||||
@@ -186,7 +177,7 @@ class profiles::postfix::gateway (
|
||||
'smtp_tls_session_cache_database' => {
|
||||
'value' => 'btree:/var/lib/postfix/smtp_tls_session_cache'
|
||||
},
|
||||
'smtp_send_xforward_command' => {
|
||||
'smtp_use_tls' => {
|
||||
'value' => 'yes'
|
||||
},
|
||||
'smtpd_banner' => {
|
||||
@@ -220,7 +211,7 @@ class profiles::postfix::gateway (
|
||||
'value' => 'check_helo_access hash:/etc/postfix/helo_access, reject_invalid_hostname'
|
||||
},
|
||||
'smtpd_milters' => {
|
||||
'value' => $smtpd_milters
|
||||
'value' => 'inet:127.0.0.1:33333'
|
||||
},
|
||||
'smtpd_recipient_restrictions' => {
|
||||
'value' => join($smtpd_recipient_restrictions, ', ')
|
||||
@@ -264,10 +255,13 @@ class profiles::postfix::gateway (
|
||||
'smtpd_tls_session_cache_timeout' => {
|
||||
'value' => '3600s'
|
||||
},
|
||||
'smtpd_use_tls' => {
|
||||
'value' => 'yes'
|
||||
},
|
||||
'tls_medium_cipherlist' => {
|
||||
'value' => join([
|
||||
'ECDSA+AESGCM:ECDH+AESGCM:DH+AESGCM:ECDSA+AES:ECDH+AES:DH+AES',
|
||||
'RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS:!3DES'
|
||||
'ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS'
|
||||
], ':')
|
||||
},
|
||||
'tls_preempt_cipherlist' => {
|
||||
|
||||
@@ -8,5 +8,6 @@ class roles::infra::storage::consul {
|
||||
include profiles::base
|
||||
include profiles::base::datavol
|
||||
include profiles::consul::server
|
||||
include profiles::consul::mesh_gateway
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user