promote develop to master #6

Merged
unkinben merged 449 commits from develop into master 2024-06-01 14:48:48 +10:00
6 changed files with 84 additions and 24 deletions
Showing only changes of commit 82f2d75888 - Show all commits

View File

@ -1,8 +1,24 @@
--- ---
# mappings # mappings
profiles::haproxy::mappings::list: profiles::haproxy::mappings:
- 'puppetboard.main.unkin.net be_puppetboard' fe_https:
- 'puppetdbapi.main.unkin.net be_puppetdbapi' ensure: present
mappings:
- 'puppetboard.main.unkin.net be_puppetboard'
- 'puppetdbapi.main.unkin.net be_puppetdbapi'
# profiles::haproxy::listeners:
# ls_puppetdbapi_direct:
# collect_exported: false # handled in custom function
# ipaddress: "%{facts.networking.ip}"
# ports:
# - 8081
# mode: tcp
# options:
# option:
# - tcplog
# - ssl-hello-chk
# balance: roundrobin
profiles::haproxy::backends: profiles::haproxy::backends:
be_puppetboard: be_puppetboard:

View File

@ -0,0 +1,19 @@
# profiles::haproxy::backends
class profiles::haproxy::backends {
# set location_environment
$location_environment = "${facts['country']}-${facts['region']}-${facts['environment']}"
# for each backend:
$backends = lookup('profiles::haproxy::backends', Hash, 'deep', {})
$backends.each |$backend, $data| {
# create backend
haproxy::backend { $backend:
* => $data,
}
# collect exported resources
$tag = "${backend}_${location_environment}"
Haproxy::Balancermember <<| tag == $tag |>>
}
}

View File

@ -0,0 +1,14 @@
# profiles::haproxy::frontends
class profiles::haproxy::frontends {
# for each frontend:
$frontends = lookup('profiles::haproxy::frontends', Hash, 'deep', {})
$frontends.each |$frontend, $data| {
# create frontends
haproxy::frontend { $frontend:
* => $data,
}
}
}

View File

@ -0,0 +1,19 @@
# profiles::haproxy::listeners
class profiles::haproxy::listeners {
# set location_environment
$location_environment = "${facts['country']}-${facts['region']}-${facts['environment']}"
# for each listener:
$listeners = lookup('profiles::haproxy::listeners', Hash, 'deep', {})
$listeners.each |$listen, $data| {
# create listener
haproxy::listen { $listen:
* => $data,
}
# collect exported resources
$tag = "${listen}_${location_environment}"
Haproxy::Balancermember <<| tag == $tag |>>
}
}

View File

@ -1,9 +1,13 @@
# profiles::haproxy::mappings # profiles::haproxy::mappings
class profiles::haproxy::mappings ( class profiles::haproxy::mappings {
Array $list = []
) { # for each mapping:
haproxy::mapfile { 'domains-to-backends': $mappings = lookup('profiles::haproxy::mappings')
ensure => 'present', $mappings.each |$mapping, $data| {
mappings => $list,
# create mapping
haproxy::mapfile { $mapping:
* => $data,
}
} }
} }

View File

@ -2,7 +2,6 @@
class profiles::haproxy::server ( class profiles::haproxy::server (
Hash $globals = {}, Hash $globals = {},
Hash $defaults = {}, Hash $defaults = {},
Array $cnames = [],
){ ){
# default global/defaults arrays # default global/defaults arrays
@ -52,19 +51,8 @@ class profiles::haproxy::server (
include profiles::haproxy::fe_http # default http frontend include profiles::haproxy::fe_http # default http frontend
include profiles::haproxy::fe_https # default https frontend include profiles::haproxy::fe_https # default https frontend
include profiles::haproxy::dns # manage dns for haproxy include profiles::haproxy::dns # manage dns for haproxy
include profiles::haproxy::frontends # create frontends
include profiles::haproxy::backends # create backends
include profiles::haproxy::listeners # create listeners
# for each backend:
$backends = lookup('profiles::haproxy::backends')
$backends.each |$backend, $data| {
# create backend
haproxy::backend { $backend:
* => $data,
}
# collect exported resources
$location_environment = "${facts['country']}-${facts['region']}-${facts['environment']}"
$tag = "${backend}_${location_environment}"
Haproxy::Balancermember <<| tag == $tag |>>
}
} }