|
| 1 | +# SPDX-FileCopyrightText: Helmholtz Centre for Environmental Research (UFZ) |
| 2 | +# SPDX-FileCopyrightText: Helmholtz-Zentrum Dresden-Rossendorf (HZDR) |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: Apache-2.0 |
| 5 | + |
| 6 | +--- |
| 7 | +argument_specs: |
| 8 | + main: |
| 9 | + short_description: "Install and configure HAProxy as a load balancer." |
| 10 | + description: |
| 11 | + - "This Ansible role sets up HAProxy to be used as a load balancer in a high availability and scalability context." |
| 12 | + - "It supports SSL certificate management, statistics interface, and backend server configuration." |
| 13 | + author: |
| 14 | + - "HIFIS Software Services" |
| 15 | + options: |
| 16 | + haproxy_executable_path: |
| 17 | + description: |
| 18 | + - "Path to the HAProxy executable binary." |
| 19 | + type: "str" |
| 20 | + default: "/usr/sbin/haproxy" |
| 21 | + required: false |
| 22 | + haproxy_ppa_version: |
| 23 | + description: |
| 24 | + - "HAProxy PPA repository version to use." |
| 25 | + - "Used to pin the PPA version to a certain value." |
| 26 | + type: "str" |
| 27 | + default: "ppa:vbernat/haproxy-3.2" |
| 28 | + required: false |
| 29 | + haproxy_version: |
| 30 | + description: |
| 31 | + - "HAProxy package version to install." |
| 32 | + - "Used to pin the HAProxy version to a certain value." |
| 33 | + type: "str" |
| 34 | + default: "3.2.*" |
| 35 | + required: false |
| 36 | + haproxy_user: |
| 37 | + description: |
| 38 | + - "System user account under which HAProxy runs." |
| 39 | + type: "str" |
| 40 | + default: "haproxy" |
| 41 | + required: false |
| 42 | + haproxy_group: |
| 43 | + description: |
| 44 | + - "System group under which HAProxy runs." |
| 45 | + type: "str" |
| 46 | + default: "haproxy" |
| 47 | + required: false |
| 48 | + haproxy_dependencies: |
| 49 | + description: |
| 50 | + - "List of package dependencies to be installed for HAProxy." |
| 51 | + type: "list" |
| 52 | + elements: "str" |
| 53 | + default: |
| 54 | + - "software-properties-common" |
| 55 | + - "python3-cryptography" |
| 56 | + - "python3-openssl" |
| 57 | + required: false |
| 58 | + haproxy_nbproc: |
| 59 | + description: |
| 60 | + - "Number of processes used by HAProxy." |
| 61 | + type: "str" |
| 62 | + default: "1" |
| 63 | + required: false |
| 64 | + haproxy_nbthread: |
| 65 | + description: |
| 66 | + - "Number of threads used by HAProxy." |
| 67 | + type: "str" |
| 68 | + default: "2" |
| 69 | + required: false |
| 70 | + haproxy_cpumap: |
| 71 | + description: |
| 72 | + - "CPU mapping configuration for HAProxy multithreading." |
| 73 | + - "Maps threads to CPU cores for performance optimization." |
| 74 | + type: "str" |
| 75 | + default: "auto:1/1-2 0-1" |
| 76 | + required: false |
| 77 | + haproxy_name: |
| 78 | + description: |
| 79 | + - "Name of the HAProxy binary." |
| 80 | + type: "str" |
| 81 | + default: "haproxy" |
| 82 | + required: false |
| 83 | + haproxy_config_template: |
| 84 | + description: |
| 85 | + - "Path to the HAProxy configuration Jinja2 template." |
| 86 | + type: "str" |
| 87 | + default: "haproxy.cfg.j2" |
| 88 | + required: false |
| 89 | + haproxy_conf_dir: |
| 90 | + description: |
| 91 | + - "Directory path where HAProxy configuration files are stored." |
| 92 | + type: "str" |
| 93 | + default: "/etc/haproxy" |
| 94 | + required: false |
| 95 | + haproxy_conf_file_path: |
| 96 | + description: |
| 97 | + - "Full path to the HAProxy configuration file." |
| 98 | + type: "str" |
| 99 | + default: "{{ haproxy_conf_dir }}/{{ haproxy_name }}.cfg" |
| 100 | + required: false |
| 101 | + haproxy_log_socket: |
| 102 | + description: |
| 103 | + - "Path to the HAProxy logging socket." |
| 104 | + type: "str" |
| 105 | + default: "/dev/log" |
| 106 | + required: false |
| 107 | + haproxy_log_level: |
| 108 | + description: |
| 109 | + - "Log level for HAProxy logging." |
| 110 | + - "Possible values are: emerg, alert, crit, err, warning, notice, info, debug." |
| 111 | + type: "str" |
| 112 | + default: "info" |
| 113 | + required: false |
| 114 | + haproxy_socket: |
| 115 | + description: |
| 116 | + - "Path to the HAProxy socket file for runtime API." |
| 117 | + type: "str" |
| 118 | + default: "/run/haproxy/admin.sock" |
| 119 | + required: false |
| 120 | + haproxy_ssl_certificate_dir: |
| 121 | + description: |
| 122 | + - "Directory path where HAProxy SSL certificates are stored." |
| 123 | + type: "str" |
| 124 | + default: "/etc/haproxy/ssl" |
| 125 | + required: false |
| 126 | + haproxy_create_self_signed_cert: |
| 127 | + description: |
| 128 | + - "Whether to generate a self-signed SSL certificate." |
| 129 | + - "If set to false, you must provide haproxy_ssl_cert_chain_src_file_path." |
| 130 | + type: "bool" |
| 131 | + default: true |
| 132 | + required: false |
| 133 | + haproxy_country_name: |
| 134 | + description: |
| 135 | + - "Country name (C) for the SSL certificate." |
| 136 | + type: "str" |
| 137 | + default: "DE" |
| 138 | + required: false |
| 139 | + haproxy_state_or_province_name: |
| 140 | + description: |
| 141 | + - "State or province name (ST) for the SSL certificate." |
| 142 | + type: "str" |
| 143 | + default: "Saxony" |
| 144 | + required: false |
| 145 | + haproxy_locality_name: |
| 146 | + description: |
| 147 | + - "Locality name (L) for the SSL certificate." |
| 148 | + type: "str" |
| 149 | + default: "Dresden" |
| 150 | + required: false |
| 151 | + haproxy_organization_name: |
| 152 | + description: |
| 153 | + - "Organization name (O) for the SSL certificate." |
| 154 | + type: "str" |
| 155 | + default: "Helmholtz-Zentrum Dresden-Rossendorf (HZDR)" |
| 156 | + required: false |
| 157 | + haproxy_organizational_unit_name: |
| 158 | + description: |
| 159 | + - "Organizational unit name (OU) for the SSL certificate." |
| 160 | + type: "str" |
| 161 | + default: "FWCC / Computational Science" |
| 162 | + required: false |
| 163 | + haproxy_email_address: |
| 164 | + description: |
| 165 | + - "Email address for the SSL certificate." |
| 166 | + type: "str" |
| 167 | + default: "hifis-help@hzdr.de" |
| 168 | + required: false |
| 169 | + haproxy_common_name: |
| 170 | + description: |
| 171 | + - "Common name (CN) for the SSL certificate." |
| 172 | + type: "str" |
| 173 | + default: "Helmholtz Association" |
| 174 | + required: false |
| 175 | + haproxy_ssl_certificate_key_file: |
| 176 | + description: |
| 177 | + - "Path to the HAProxy SSL private key file." |
| 178 | + type: "str" |
| 179 | + default: "{{ haproxy_ssl_certificate_dir }}/haproxy.key" |
| 180 | + required: false |
| 181 | + haproxy_ssl_certificate_csr_file: |
| 182 | + description: |
| 183 | + - "Path to the HAProxy SSL certificate signing request file." |
| 184 | + type: "str" |
| 185 | + default: "{{ haproxy_ssl_certificate_dir }}/haproxy.csr" |
| 186 | + required: false |
| 187 | + haproxy_ssl_certificate_crt_file: |
| 188 | + description: |
| 189 | + - "Path to the HAProxy SSL certificate file." |
| 190 | + type: "str" |
| 191 | + default: "{{ haproxy_ssl_certificate_dir }}/haproxy.crt" |
| 192 | + required: false |
| 193 | + haproxy_ssl_certificate_pkcs12_file: |
| 194 | + description: |
| 195 | + - "Path to the HAProxy SSL certificate PKCS12 file." |
| 196 | + type: "str" |
| 197 | + default: "{{ haproxy_ssl_certificate_dir }}/haproxy.p12" |
| 198 | + required: false |
| 199 | + haproxy_ssl_certificate_chain_file: |
| 200 | + description: |
| 201 | + - "Path to the HAProxy SSL certificate chain file." |
| 202 | + - "This file is used by HAProxy and should be in PEM format." |
| 203 | + type: "str" |
| 204 | + default: "{{ haproxy_ssl_certificate_dir }}/haproxy.pem" |
| 205 | + required: false |
| 206 | + haproxy_ssl_cert_chain_src_file_path: |
| 207 | + description: |
| 208 | + - "Path to the HAProxy certificate chain source file on the control node." |
| 209 | + - "This file will be copied to the remote host." |
| 210 | + - "This variable is mandatory when haproxy_create_self_signed_cert is set to false." |
| 211 | + - "The file should be PEM formatted and include at least the public certificate and the private key." |
| 212 | + type: "str" |
| 213 | + required: false |
| 214 | + haproxy_ssl_dhparam_file: |
| 215 | + description: |
| 216 | + - "Path to the Diffie-Hellman parameter file." |
| 217 | + type: "str" |
| 218 | + default: "{{ haproxy_ssl_certificate_dir }}/dhparam.pem" |
| 219 | + required: false |
| 220 | + haproxy_ssl_dhparam_size: |
| 221 | + description: |
| 222 | + - "Size in bits of the generated Diffie-Hellman parameters." |
| 223 | + type: "int" |
| 224 | + default: 4096 |
| 225 | + required: false |
| 226 | + haproxy_stats_enable: |
| 227 | + description: |
| 228 | + - "Whether to enable or disable the HAProxy statistics interface." |
| 229 | + - "Possible values are: enable, disable." |
| 230 | + type: "str" |
| 231 | + default: "enable" |
| 232 | + required: false |
| 233 | + haproxy_stats_admin_user: |
| 234 | + description: |
| 235 | + - "Username for the HAProxy statistics interface admin user." |
| 236 | + type: "str" |
| 237 | + default: "admin" |
| 238 | + required: false |
| 239 | + haproxy_stats_admin_user_password: |
| 240 | + description: |
| 241 | + - "Password for the HAProxy statistics interface admin user." |
| 242 | + - "Should be changed from the default value for security." |
| 243 | + type: "str" |
| 244 | + default: "changeme" |
| 245 | + required: false |
| 246 | + haproxy_frontend_ip: |
| 247 | + description: |
| 248 | + - "Floating IP address for the HAProxy frontend." |
| 249 | + - "This is the IP address that HAProxy will bind to." |
| 250 | + - "This variable is mandatory and must be provided." |
| 251 | + type: "str" |
| 252 | + required: true |
| 253 | + haproxy_backends: |
| 254 | + description: |
| 255 | + - "List of backend servers for HAProxy to load balance." |
| 256 | + - "Each backend server must have a name and IP address." |
| 257 | + - "Port is optional and defaults to 80 if not specified." |
| 258 | + - "This variable is mandatory and must be provided." |
| 259 | + type: "list" |
| 260 | + elements: "dict" |
| 261 | + required: true |
| 262 | + options: |
| 263 | + backend_name: |
| 264 | + description: |
| 265 | + - "Name identifier for the backend server." |
| 266 | + type: "str" |
| 267 | + required: true |
| 268 | + backend_ip: |
| 269 | + description: |
| 270 | + - "IP address of the backend server." |
| 271 | + type: "str" |
| 272 | + required: true |
| 273 | + backend_port: |
| 274 | + description: |
| 275 | + - "Port number on which the backend server listens." |
| 276 | + type: "int" |
| 277 | + default: 80 |
| 278 | + required: false |
| 279 | + |
| 280 | +... |
0 commit comments