Defined Type: apache::vhost
- Defined in:
- manifests/vhost.pp
Summary
Allows specialised configurations for virtual hosts that possess requirements outside of the defaults.Overview
The apache module allows a lot of flexibility in the setup and configuration of virtual hosts. This flexibility is due, in part, to ‘vhost` being a defined resource type, which allows Apache to evaluate it multiple times with different parameters.<br /> The `apache::vhost` defined type allows you to have specialized configurations for virtual hosts that have requirements outside the defaults. You can set up a default virtual host within the base `::apache` class, as well as set a customized virtual host as the default. Customized virtual hosts have a lower numeric `priority` than the base class’s, causing Apache to process the customized virtual host first.<br /> The ‘apache::vhost` defined type uses `concat::fragment` to build the configuration file. To inject custom fragments for pieces of the configuration that the defined type doesn’t inherently support, add a custom fragment.<br /> For the custom fragment’s ‘order` parameter, the `apache::vhost` defined type uses multiples of 10, so any `order` that isn’t a multiple of 10 should work.<br /> > Note: When creating an ‘apache::vhost`, it cannot be named `default` or `default-ssl`, because vhosts with these titles are always managed by the module. This means that you cannot override `Apache::Vhost` or `Apache::Vhost` resources. An optional workaround is to create a vhost named something else, such as `my default`, and ensure that the `default` and `default_ssl` vhosts are set to `false`:
1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 |
# File 'manifests/vhost.pp', line 1705
define apache::vhost (
Variant[Stdlib::Absolutepath, Boolean] $docroot,
Boolean $manage_docroot = true,
Variant[Stdlib::Absolutepath, Boolean] $virtual_docroot = false,
Boolean $virtual_use_default_docroot = false,
Optional[Variant[Array[Stdlib::Port], Stdlib::Port]] $port = undef,
Optional[
Variant[
Array[Variant[Stdlib::IP::Address, Enum['*']]],
Variant[Stdlib::IP::Address, Enum['*']]
]
] $ip = undef,
Boolean $ip_based = false,
Boolean $add_listen = true,
String $docroot_owner = 'root',
String $docroot_group = $apache::params::root_group,
Optional[Stdlib::Filemode] $docroot_mode = undef,
Array[Enum['h2', 'h2c', 'http/1.1']] $protocols = [],
Optional[Boolean] $protocols_honor_order = undef,
Optional[String] $serveradmin = undef,
Boolean $ssl = false,
Optional[Stdlib::Absolutepath] $ssl_cert = $apache::default_ssl_cert,
Optional[Stdlib::Absolutepath] $ssl_key = $apache::default_ssl_key,
Optional[Stdlib::Absolutepath] $ssl_chain = $apache::default_ssl_chain,
Optional[Stdlib::Absolutepath] $ssl_ca = $apache::default_ssl_ca,
Optional[Stdlib::Absolutepath] $ssl_crl_path = $apache::default_ssl_crl_path,
Optional[Stdlib::Absolutepath] $ssl_crl = $apache::default_ssl_crl,
Optional[String] $ssl_crl_check = $apache::default_ssl_crl_check,
Optional[Stdlib::Absolutepath] $ssl_certs_dir = $apache::params::ssl_certs_dir,
Boolean $ssl_reload_on_change = $apache::default_ssl_reload_on_change,
Optional[Variant[Array[String], String]] $ssl_protocol = undef,
Optional[Variant[Array[String[1]], String[1], Hash[String[1], String[1]]]] $ssl_cipher = undef,
Variant[Boolean, Apache::OnOff, Undef] $ssl_honorcipherorder = undef,
Optional[Enum['none', 'optional', 'require', 'optional_no_ca']] $ssl_verify_client = undef,
Optional[Integer] $ssl_verify_depth = undef,
Optional[Enum['none', 'optional', 'require', 'optional_no_ca']] $ssl_proxy_verify = undef,
Optional[Integer[0]] $ssl_proxy_verify_depth = undef,
Optional[Stdlib::Absolutepath] $ssl_proxy_ca_cert = undef,
Optional[Apache::OnOff] $ssl_proxy_check_peer_cn = undef,
Optional[Apache::OnOff] $ssl_proxy_check_peer_name = undef,
Optional[Apache::OnOff] $ssl_proxy_check_peer_expire = undef,
Optional[Stdlib::Absolutepath] $ssl_proxy_machine_cert = undef,
Optional[Stdlib::Absolutepath] $ssl_proxy_machine_cert_chain = undef,
Optional[String] $ssl_proxy_cipher_suite = undef,
Optional[String] $ssl_proxy_protocol = undef,
Optional[Variant[Array[String], String]] $ssl_options = undef,
Optional[String] $ssl_openssl_conf_cmd = undef,
Boolean $ssl_proxyengine = false,
Optional[Boolean] $ssl_stapling = undef,
Optional[Integer] $ssl_stapling_timeout = undef,
Optional[Apache::OnOff] $ssl_stapling_return_errors = undef,
Optional[String] $ssl_user_name = undef,
Optional[Apache::Vhost::Priority] $priority = undef,
Boolean $default_vhost = false,
Optional[String] $servername = $name,
Variant[Array[String], String] $serveraliases = [],
Array[String] $options = ['Indexes', 'FollowSymLinks', 'MultiViews'],
Array[String] $override = ['None'],
Optional[String] $directoryindex = undef,
String $vhost_name = '*',
Stdlib::Absolutepath $logroot = $apache::logroot,
Enum['directory', 'absent'] $logroot_ensure = 'directory',
Optional[Stdlib::Filemode] $logroot_mode = undef,
Optional[String] $logroot_owner = undef,
Optional[String] $logroot_group = undef,
Optional[Apache::LogLevel] $log_level = undef,
Boolean $access_log = true,
Optional[String[1]] $access_log_file = undef,
Optional[String[1]] $access_log_pipe = undef,
Optional[Variant[String, Boolean]] $access_log_syslog = undef,
Optional[String[1]] $access_log_format = undef,
Optional[Variant[Boolean, String]] $access_log_env_var = undef,
Optional[Array[Hash]] $access_logs = undef,
Boolean $use_servername_for_filenames = false,
Boolean $use_port_for_filenames = false,
Array[Hash[String[1], String[1]]] $aliases = [],
Array[Hash] $directories = [],
Boolean $error_log = true,
Optional[String] $error_log_file = undef,
Optional[String] $error_log_pipe = undef,
Optional[Variant[String, Boolean]] $error_log_syslog = undef,
Optional[
Array[
Variant[
String,
Hash[String, Enum['connection', 'request']]
]
]
] $error_log_format = undef,
Optional[Pattern[/^((Strict|Unsafe)?\s*(\b(Registered|Lenient)Methods)?\s*(\b(Allow0\.9|Require1\.0))?)$/]] $http_protocol_options = undef,
Optional[Variant[String, Boolean]] $modsec_audit_log = undef,
Optional[String] $modsec_audit_log_file = undef,
Optional[String] $modsec_audit_log_pipe = undef,
Variant[Array[Hash], String] $error_documents = [],
Optional[Variant[Stdlib::Absolutepath, Enum['disabled']]] $fallbackresource = undef,
Optional[String] $scriptalias = undef,
Optional[Integer] $limitreqfieldsize = undef,
Optional[Integer] $limitreqfields = undef,
Optional[Integer] $limitreqline = undef,
Optional[Integer] $limitreqbody = undef,
Optional[String] $proxy_dest = undef,
Optional[String] $proxy_dest_match = undef,
Optional[String] $proxy_dest_reverse_match = undef,
Optional[Variant[Array[Hash], Hash]] $proxy_pass = undef,
Optional[Variant[Array[Hash], Hash]] $proxy_pass_match = undef,
Boolean $proxy_requests = false,
Hash $php_flags = {},
Hash $php_values = {},
Variant[Array[String], Hash] $php_admin_flags = {},
Variant[Array[String], Hash] $php_admin_values = {},
Variant[Array[String], String] $no_proxy_uris = [],
Variant[Array[String], String] $no_proxy_uris_match = [],
Boolean $proxy_preserve_host = false,
Optional[Variant[String, Boolean]] $proxy_add_headers = undef,
Boolean $proxy_error_override = false,
Variant[String, Array[String]] $redirect_source = '/',
Optional[Variant[Array[String], String]] $redirect_dest = undef,
Optional[Variant[Array[String], String]] $redirect_status = undef,
Optional[Variant[Array[String], String]] $redirectmatch_status = undef,
Optional[Variant[Array[String], String]] $redirectmatch_regexp = undef,
Optional[Variant[Array[String], String]] $redirectmatch_dest = undef,
Array[String[1]] $headers = [],
Array[String[1]] $request_headers = [],
Array[String[1]] $filters = [],
Array[Hash] $rewrites = [],
Optional[String[1]] $rewrite_base = undef,
Optional[Variant[Array[String[1]], String[1]]] $rewrite_rule = undef,
Array[String[1]] $rewrite_cond = [],
Boolean $rewrite_inherit = false,
Variant[Array[String], String] $setenv = [],
Variant[Array[String], String] $setenvif = [],
Variant[Array[String], String] $setenvifnocase = [],
Variant[Array[String], String] $block = [],
Enum['absent', 'present'] $ensure = 'present',
Optional[String] $wsgi_application_group = undef,
Optional[Variant[String, Hash]] $wsgi_daemon_process = undef,
Optional[Hash] $wsgi_daemon_process_options = undef,
Optional[String] $wsgi_import_script = undef,
Optional[Hash] $wsgi_import_script_options = undef,
Optional[String] $wsgi_process_group = undef,
Optional[Hash] $wsgi_script_aliases_match = undef,
Optional[Hash] $wsgi_script_aliases = undef,
Optional[Apache::OnOff] $wsgi_pass_authorization = undef,
Optional[Apache::OnOff] $wsgi_chunked_request = undef,
Optional[String] $custom_fragment = undef,
Optional[Hash] $itk = undef,
Optional[String] $action = undef,
Variant[Array[String], String] $additional_includes = [],
Boolean $use_optional_includes = $apache::use_optional_includes,
Optional[Variant[Apache::OnOff, Enum['nodecode']]] $allow_encoded_slashes = undef,
Optional[Pattern[/^[\w-]+ [\w-]+$/]] $suexec_user_group = undef,
Optional[Boolean] $h2_copy_files = undef,
Optional[Boolean] $h2_direct = undef,
Optional[Boolean] $h2_early_hints = undef,
Optional[Integer] $h2_max_session_streams = undef,
Optional[Boolean] $h2_modern_tls_only = undef,
Optional[Boolean] $h2_push = undef,
Optional[Integer] $h2_push_diary_size = undef,
Array[String] $h2_push_priority = [],
Array[String] $h2_push_resource = [],
Optional[Boolean] $h2_serialize_headers = undef,
Optional[Integer] $h2_stream_max_mem_size = undef,
Optional[Integer] $h2_tls_cool_down_secs = undef,
Optional[Integer] $h2_tls_warm_up_size = undef,
Optional[Boolean] $h2_upgrade = undef,
Optional[Integer] $h2_window_size = undef,
Optional[Boolean] $passenger_enabled = undef,
Optional[String] $passenger_base_uri = undef,
Optional[Stdlib::Absolutepath] $passenger_ruby = undef,
Optional[Stdlib::Absolutepath] $passenger_python = undef,
Optional[Stdlib::Absolutepath] $passenger_nodejs = undef,
Optional[String] $passenger_meteor_app_settings = undef,
Optional[String] $passenger_app_env = undef,
Optional[Stdlib::Absolutepath] $passenger_app_root = undef,
Optional[String] $passenger_app_group_name = undef,
Optional[String] $passenger_app_start_command = undef,
Optional[Enum['meteor', 'node', 'rack', 'wsgi']] $passenger_app_type = undef,
Optional[String] $passenger_startup_file = undef,
Optional[String] $passenger_restart_dir = undef,
Optional[Enum['direct', 'smart']] $passenger_spawn_method = undef,
Optional[Boolean] $passenger_load_shell_envvars = undef,
Optional[Boolean] $passenger_preload_bundler = undef,
Optional[Boolean] $passenger_rolling_restarts = undef,
Optional[Boolean] $passenger_resist_deployment_errors = undef,
Optional[String] $passenger_user = undef,
Optional[String] $passenger_group = undef,
Optional[Boolean] $passenger_friendly_error_pages = undef,
Optional[Integer] $passenger_min_instances = undef,
Optional[Integer] $passenger_max_instances = undef,
Optional[Integer] $passenger_max_preloader_idle_time = undef,
Optional[Integer] $passenger_force_max_concurrent_requests_per_process = undef,
Optional[Integer] $passenger_start_timeout = undef,
Optional[Enum['process', 'thread']] $passenger_concurrency_model = undef,
Optional[Integer] $passenger_thread_count = undef,
Optional[Integer] $passenger_max_requests = undef,
Optional[Integer] $passenger_max_request_time = undef,
Optional[Integer] $passenger_memory_limit = undef,
Optional[Integer] $passenger_stat_throttle_rate = undef,
Optional[Variant[String, Array[String]]] $passenger_pre_start = undef,
Optional[Boolean] $passenger_high_performance = undef,
Optional[Boolean] $passenger_buffer_upload = undef,
Optional[Boolean] $passenger_buffer_response = undef,
Optional[Boolean] $passenger_error_override = undef,
Optional[Integer] $passenger_max_request_queue_size = undef,
Optional[Integer] $passenger_max_request_queue_time = undef,
Optional[Boolean] $passenger_sticky_sessions = undef,
Optional[String] $passenger_sticky_sessions_cookie_name = undef,
Optional[String] $passenger_sticky_sessions_cookie_attributes = undef,
Optional[Boolean] $passenger_allow_encoded_slashes = undef,
Optional[String] $passenger_app_log_file = undef,
Optional[Boolean] $passenger_debugger = undef,
Optional[Integer] $passenger_lve_min_uid = undef,
Optional[String] $passenger_admin_panel_url = undef,
Optional[Enum['basic']] $passenger_admin_panel_auth_type = undef,
Optional[String] $passenger_admin_panel_username = undef,
Optional[String] $passenger_admin_panel_password = undef,
Optional[String] $passenger_dump_config_manifest = undef,
Optional[String] $add_default_charset = undef,
Boolean $modsec_disable_vhost = false,
Optional[Variant[Hash, Array]] $modsec_disable_ids = undef,
Array[String[1]] $modsec_disable_ips = [],
Optional[Variant[Hash, Array]] $modsec_disable_msgs = undef,
Optional[Variant[Hash, Array]] $modsec_disable_tags = undef,
Optional[String] $modsec_body_limit = undef,
Optional[Integer[1, default]] $modsec_inbound_anomaly_threshold = undef,
Optional[Integer[1, default]] $modsec_outbound_anomaly_threshold = undef,
Optional[String] $modsec_allowed_methods = undef,
Array[Hash] $jk_mounts = [],
Boolean $auth_kerb = false,
Apache::OnOff $krb_method_negotiate = 'on',
Apache::OnOff $krb_method_k5passwd = 'on',
Apache::OnOff $krb_authoritative = 'on',
Array[String] $krb_auth_realms = [],
Optional[String] $krb_5keytab = undef,
Optional[Apache::OnOff] $krb_local_user_mapping = undef,
Apache::OnOff $krb_verify_kdc = 'on',
String $krb_servicename = 'HTTP',
Apache::OnOff $krb_save_credentials = 'off',
Optional[Apache::OnOff] $keepalive = undef,
Optional[Variant[Integer, String]] $keepalive_timeout = undef,
Optional[Variant[Integer, String]] $max_keepalive_requests = undef,
Optional[String] $cas_attribute_prefix = undef,
Optional[String] $cas_attribute_delimiter = undef,
Optional[String] $cas_root_proxied_as = undef,
Boolean $cas_scrub_request_headers = false,
Boolean $cas_sso_enabled = false,
Optional[String] $cas_login_url = undef,
Optional[String] $cas_validate_url = undef,
Boolean $cas_validate_saml = false,
Optional[String] $cas_cookie_path = undef,
Optional[String] $shib_compat_valid_user = undef,
Optional[Variant[Apache::OnOff, Enum['DNS', 'dns']]] $use_canonical_name = undef,
Optional[Variant[String, Array[String]]] $comment = undef,
Hash $define = {},
Boolean $auth_oidc = false,
Apache::OIDCSettings $oidc_settings = {},
Optional[Variant[Boolean, String]] $mdomain = undef,
Optional[Variant[String[1], Array[String[1]]]] $userdir = undef,
) {
# The base class must be included first because it is used by parameter defaults
if ! defined(Class['apache']) {
fail('You must include the apache base class before using any apache defined resources')
}
$apache_name = $apache::apache_name
# Input validation begins
if $access_log_file and $access_log_pipe {
fail("Apache::Vhost[${name}]: 'access_log_file' and 'access_log_pipe' cannot be defined at the same time")
}
if $error_log_file and $error_log_pipe {
fail("Apache::Vhost[${name}]: 'error_log_file' and 'error_log_pipe' cannot be defined at the same time")
}
if $modsec_audit_log_file and $modsec_audit_log_pipe {
fail("Apache::Vhost[${name}]: 'modsec_audit_log_file' and 'modsec_audit_log_pipe' cannot be defined at the same time")
}
# Input validation ends
if $ssl_honorcipherorder =~ Boolean or $ssl_honorcipherorder == undef {
$_ssl_honorcipherorder = $ssl_honorcipherorder
} else {
$_ssl_honorcipherorder = $ssl_honorcipherorder ? {
'on' => true,
'On' => true,
'off' => false,
'Off' => false,
default => true,
}
}
# Configure the defaultness of a vhost
if $priority {
$priority_real = "${priority}-"
} elsif $priority == false {
$priority_real = ''
} elsif $default_vhost {
$priority_real = '10-'
} else {
$priority_real = '25-'
}
# https://httpd.apache.org/docs/2.4/fr/mod/core.html#servername
# Syntax: ServerName [scheme://]domain-name|ip-address[:port]
# Sometimes, the server runs behind a device that processes SSL, such as a reverse proxy, load balancer or SSL offload
# appliance.
# When this is the case, specify the https:// scheme and the port number to which the clients connect in the ServerName
# directive to make sure that the server generates the correct self-referential URLs.
$normalized_servername = regsubst($servername, '(https?:\/\/)?([a-z0-9\/%_+.,#?!@&=-]+)(:?\d+)?', '\2', 'G')
# IAC-1186: A number of configuration and log file names are generated using the $name parameter. It is possible for
# the $name parameter to contain spaces, which could then be transferred to the log / config filenames. Although
# POSIX compliant, this can be cumbersome.
#
# It seems more appropriate to use the $servername parameter to derive default log / config filenames from. We should
# also perform some sanitiation on the $servername parameter to strip spaces from it, as it defaults to the value of
# $name, should $servername NOT be defined.
#
# Because a single hostname may be use by multiple virtual hosts listening on different ports, the $port paramter can
# optionaly be used to avoid duplicate resources.
$filename = $use_servername_for_filenames ? {
true => $use_port_for_filenames ? {
true => regsubst("${normalized_servername}-${port}", ' ', '_', 'G'),
false => regsubst($normalized_servername, ' ', '_', 'G'),
},
false => $name,
}
# This ensures that the docroot exists
# But enables it to be specified across multiple vhost resources
if $manage_docroot and $docroot and ! defined(File[$docroot]) {
file { $docroot:
ensure => directory,
owner => $docroot_owner,
group => $docroot_group,
mode => $docroot_mode,
require => Package['httpd'],
before => Concat["${priority_real}${filename}.conf"],
}
}
# Same as above, but for logroot
if ! defined(File[$logroot]) {
file { $logroot:
ensure => $logroot_ensure,
owner => $logroot_owner,
group => $logroot_group,
mode => $logroot_mode,
require => Package['httpd'],
before => Concat["${priority_real}${filename}.conf"],
notify => Class['Apache::Service'],
}
}
# Is apache::mod::shib enabled (or apache::mod['shib2'])
$shibboleth_enabled = defined(Apache::Mod['shib2'])
# Is apache::mod::cas enabled (or apache::mod['cas'])
$cas_enabled = defined(Apache::Mod['auth_cas'])
if $access_log and !$access_logs {
$_access_logs = [{
'file' => $access_log_file,
'pipe' => $access_log_pipe,
'syslog' => $access_log_syslog,
'format' => $access_log_format,
'env' => $access_log_env_var
}]
} elsif $access_logs {
$_access_logs = $access_logs
} else {
$_access_logs = []
}
if $error_log_file {
if $error_log_file =~ /^\// {
# Absolute path provided - don't prepend $logroot
$error_log_destination = $error_log_file
} else {
$error_log_destination = "${logroot}/${error_log_file}"
}
} elsif $error_log_pipe {
$error_log_destination = $error_log_pipe
} elsif $error_log_syslog {
$error_log_destination = $error_log_syslog
} else {
if $ssl {
$error_log_destination = "${logroot}/${filename}_error_ssl.log"
} else {
$error_log_destination = "${logroot}/${filename}_error.log"
}
}
if $modsec_audit_log == false {
$modsec_audit_log_destination = undef
} elsif $modsec_audit_log_file {
$modsec_audit_log_destination = "${logroot}/${modsec_audit_log_file}"
} elsif $modsec_audit_log_pipe {
$modsec_audit_log_destination = $modsec_audit_log_pipe
} elsif $modsec_audit_log {
if $ssl {
$modsec_audit_log_destination = "${logroot}/${filename}_security_ssl.log"
} else {
$modsec_audit_log_destination = "${logroot}/${filename}_security.log"
}
} else {
$modsec_audit_log_destination = undef
}
if $ip {
$_ip = any2array(enclose_ipv6($ip))
if $port {
$_port = any2array($port)
$listen_addr_port = split(inline_template("<%= @_ip.product(@_port).map {|x| x.join(':') }.join(',')%>"), ',')
$nvh_addr_port = split(inline_template("<%= @_ip.product(@_port).map {|x| x.join(':') }.join(',')%>"), ',')
} else {
$listen_addr_port = undef
$nvh_addr_port = $_ip
if ! $servername and ! $ip_based {
fail("Apache::Vhost[${name}]: must pass 'ip' and/or 'port' parameters for name-based vhosts")
}
}
} else {
if $port {
$listen_addr_port = $port
$nvh_addr_port = prefix(any2array($port), "${vhost_name}:")
} else {
$listen_addr_port = undef
$nvh_addr_port = $name
if ! $servername and $servername != '' {
fail("Apache::Vhost[${name}]: must pass 'ip' and/or 'port' parameters, and/or 'servername' parameter")
}
}
}
if $add_listen {
if $ip and defined(Apache::Listen[String($port)]) {
fail("Apache::Vhost[${name}]: Mixing IP and non-IP Listen directives is not possible; check the add_listen parameter of the apache::vhost define to disable this")
}
if $listen_addr_port and $ensure == 'present' {
ensure_resource('apache::listen', $listen_addr_port)
}
}
## Create a default directory list if none defined
if !empty($directories) {
$_directories = $directories
} elsif $docroot {
$_directories = [
{
provider => 'directory',
path => $docroot,
options => $options,
allow_override => $override,
directoryindex => $directoryindex,
require => 'all granted',
},
]
} else {
$_directories = []
}
## Create a global LocationMatch if locations aren't defined
if $modsec_disable_ids {
if $modsec_disable_ids =~ Array {
$_modsec_disable_ids = { '.*' => $modsec_disable_ids }
} else {
$_modsec_disable_ids = $modsec_disable_ids
}
}
if $modsec_disable_msgs {
if $modsec_disable_msgs =~ Array {
$_modsec_disable_msgs = { '.*' => $modsec_disable_msgs }
} else {
$_modsec_disable_msgs = $modsec_disable_msgs
}
}
if $modsec_disable_tags {
if $modsec_disable_tags =~ Array {
$_modsec_disable_tags = { '.*' => $modsec_disable_tags }
} else {
$_modsec_disable_tags = $modsec_disable_tags
}
}
concat { "${priority_real}${filename}.conf":
ensure => $ensure,
path => "${apache::vhost_dir}/${priority_real}${filename}.conf",
owner => 'root',
group => $apache::params::root_group,
mode => $apache::file_mode,
order => 'numeric',
require => Package['httpd'],
notify => Class['apache::service'],
}
# NOTE(pabelanger): This code is duplicated in ::apache::vhost::custom and
# needs to be converted into something generic.
if $apache::vhost_enable_dir {
$vhost_enable_dir = $apache::vhost_enable_dir
$vhost_symlink_ensure = $ensure ? {
'present' => link,
default => $ensure,
}
file { "${priority_real}${filename}.conf symlink":
ensure => $vhost_symlink_ensure,
path => "${vhost_enable_dir}/${priority_real}${filename}.conf",
target => "${apache::vhost_dir}/${priority_real}${filename}.conf",
owner => 'root',
group => $apache::params::root_group,
mode => $apache::file_mode,
require => Concat["${priority_real}${filename}.conf"],
notify => Class['apache::service'],
}
}
$file_header_params = {
'comment' => $comment,
'nvh_addr_port' => $nvh_addr_port,
'mdomain' => $mdomain,
'servername' => $servername,
'define' => $define,
'protocols' => $protocols,
'protocols_honor_order' => $protocols_honor_order,
'limitreqfieldsize' => $limitreqfieldsize,
'limitreqfields' => $limitreqfields,
'limitreqline' => $limitreqline,
'limitreqbody' => $limitreqbody,
'serveradmin' => $serveradmin,
}
concat::fragment { "${name}-apache-header":
target => "${priority_real}${filename}.conf",
order => 0,
content => epp('apache/vhost/_file_header.epp', $file_header_params),
}
if $docroot and $ensure == 'present' {
if $virtual_docroot {
include apache::mod::vhost_alias
}
$docroot_params = {
'virtual_docroot' => $virtual_docroot,
'docroot' => $docroot,
'virtual_use_default_docroot' => $virtual_use_default_docroot,
}
concat::fragment { "${name}-docroot":
target => "${priority_real}${filename}.conf",
order => 10,
content => epp('apache/vhost/_docroot.epp', $docroot_params),
}
}
if ! empty($aliases) and $ensure == 'present' {
include apache::mod::alias
$aliases_params = {
'aliases' => $aliases,
}
concat::fragment { "${name}-aliases":
target => "${priority_real}${filename}.conf",
order => 20,
content => epp('apache/vhost/_aliases.epp', $aliases_params),
}
}
if $itk and ! empty($itk) {
$itk_params = {
'itk' => $itk,
'kernelversion' => $facts['kernelversion'],
}
concat::fragment { "${name}-itk":
target => "${priority_real}${filename}.conf",
order => 30,
content => epp('apache/vhost/_itk.epp', $itk_params),
}
}
if $fallbackresource {
$fall_back_res_params = {
'fallbackresource' => $fallbackresource,
}
concat::fragment { "${name}-fallbackresource":
target => "${priority_real}${filename}.conf",
order => 40,
content => epp('apache/vhost/_fallbackresource.epp', $fall_back_res_params),
}
}
if $allow_encoded_slashes {
$allow_encoded_slashes_params = {
'allow_encoded_slashes' => $allow_encoded_slashes,
}
concat::fragment { "${name}-allow_encoded_slashes":
target => "${priority_real}${filename}.conf",
order => 50,
content => epp('apache/vhost/_allow_encoded_slashes.epp', $allow_encoded_slashes_params),
}
}
if $ensure == 'present' {
$_directories.each |Hash $directory| {
if 'auth_basic_authoritative' in $directory or 'auth_basic_fake' in $directory or 'auth_basic_provider' in $directory {
include apache::mod::auth_basic
}
if 'auth_user_file' in $directory {
include apache::mod::authn_file
}
if 'auth_group_file' in $directory {
include apache::mod::authz_groupfile
}
if 'gssapi' in $directory {
include apache::mod::auth_gssapi
}
if $directory['provider'] and $directory['provider'] =~ 'location' and ('proxy_pass' in $directory or 'proxy_pass_match' in $directory) {
include apache::mod::proxy_http
# To match processing in templates/vhost/_directories.erb
if $directory['proxy_pass_match'] {
Array($directory['proxy_pass_match']).each |$proxy| {
if $proxy['url'] =~ /"h2c?:\/\// {
include apache::mod::proxy_http2
}
}
} elsif $directory['proxy_pass'] {
Array($directory['proxy_pass']).each |$proxy| {
if $proxy['url'] =~ /"h2c?:\/\// {
include apache::mod::proxy_http2
}
}
}
}
if 'request_headers' in $directory {
include apache::mod::headers
}
if 'rewrites' in $directory {
include apache::mod::rewrite
}
if 'setenv' in $directory {
include apache::mod::env
}
}
# Template uses:
# - $_directories
# - $docroot
# - $shibboleth_enabled
# - $cas_enabled
unless empty($_directories) {
concat::fragment { "${name}-directories":
target => "${priority_real}${filename}.conf",
order => 60,
content => template('apache/vhost/_directories.erb'),
}
}
}
# Template uses:
# - $additional_includes
# - $use_optional_includes
if $additional_includes and ! empty($additional_includes) {
concat::fragment { "${name}-additional_includes":
target => "${priority_real}${filename}.conf",
order => 70,
content => template('apache/vhost/_additional_includes.erb'),
}
}
if $error_log or $log_level {
$logging_params = {
'error_log' => $error_log,
'log_level' => $log_level,
'error_log_destination' => $error_log_destination,
'error_log_format' => $error_log_format,
}
concat::fragment { "${name}-logging":
target => "${priority_real}${filename}.conf",
order => 80,
content => epp('apache/vhost/_logging.epp', $logging_params),
}
}
# Template uses no variables
concat::fragment { "${name}-serversignature":
target => "${priority_real}${filename}.conf",
order => 90,
content => " ServerSignature Off\n",
}
# Template uses:
# - $_access_logs
# - $_access_log_env_var
# - $access_log_destination
# - $_access_log_format
# - $_access_log_env_var
if !empty($_access_logs) {
concat::fragment { "${name}-access_log":
target => "${priority_real}${filename}.conf",
order => 100,
content => template('apache/vhost/_access_log.erb'),
}
}
if $action {
concat::fragment { "${name}-action":
target => "${priority_real}${filename}.conf",
order => 110,
content => epp('apache/vhost/_action.epp', { 'action' => $action }),
}
}
# Template uses:
# - $block
if $block and ! empty($block) {
concat::fragment { "${name}-block":
target => "${priority_real}${filename}.conf",
order => 120,
content => template('apache/vhost/_block.erb'),
}
}
# Template uses:
# - $error_documents
if $error_documents and ! empty($error_documents) {
concat::fragment { "${name}-error_document":
target => "${priority_real}${filename}.conf",
order => 130,
content => template('apache/vhost/_error_document.erb'),
}
}
if ! empty($headers) and $ensure == 'present' {
include apache::mod::headers
concat::fragment { "${name}-header":
target => "${priority_real}${filename}.conf",
order => 140,
content => epp('apache/vhost/_header.epp', { 'headers' => $headers }),
}
}
if ! empty($request_headers) and $ensure == 'present' {
include apache::mod::headers
concat::fragment { "${name}-requestheader":
target => "${priority_real}${filename}.conf",
order => 150,
content => epp('apache/vhost/_requestheader.epp', { 'request_headers' => $request_headers }),
}
}
if $ssl_proxyengine {
$ssl_proxy_params = {
'ssl_proxyengine' => $ssl_proxyengine,
'ssl_proxy_verify' => $ssl_proxy_verify,
'ssl_proxy_verify_depth' => $ssl_proxy_verify_depth,
'ssl_proxy_ca_cert' => $ssl_proxy_ca_cert,
'ssl_proxy_check_peer_cn' => $ssl_proxy_check_peer_cn,
'ssl_proxy_check_peer_name' => $ssl_proxy_check_peer_name,
'ssl_proxy_check_peer_expire' => $ssl_proxy_check_peer_expire,
'ssl_proxy_machine_cert' => $ssl_proxy_machine_cert,
'ssl_proxy_machine_cert_chain' => $ssl_proxy_machine_cert_chain,
'ssl_proxy_cipher_suite' => $ssl_proxy_cipher_suite,
'ssl_proxy_protocol' => $ssl_proxy_protocol,
}
concat::fragment { "${name}-sslproxy":
target => "${priority_real}${filename}.conf",
order => 160,
content => epp('apache/vhost/_sslproxy.epp', $ssl_proxy_params),
}
}
if ($proxy_dest or $proxy_pass or $proxy_pass_match or $proxy_dest_match or $proxy_preserve_host or ($proxy_add_headers =~ NotUndef)) and $ensure == 'present' {
include apache::mod::proxy_http
# To match processing in templates/vhost/_proxy.erb
if $proxy_dest =~ Pattern[/^h2c?:\/\//] or $proxy_dest_match =~ Pattern[/^h2c?:\/\//] {
include apache::mod::proxy_http2
}
[$proxy_pass, $proxy_pass_match].flatten.each |$proxy| {
if $proxy and $proxy['url'] =~ Pattern[/^h2c?:\/\//] {
include apache::mod::proxy_http2
}
}
concat::fragment { "${name}-proxy":
target => "${priority_real}${filename}.conf",
order => 170,
content => template('apache/vhost/_proxy.erb'),
}
}
# Template uses:
# - $redirect_source
# - $redirect_dest
# - $redirect_status
# - $redirect_dest_a
# - $redirect_source_a
# - $redirect_status_a
# - $redirectmatch_status
# - $redirectmatch_regexp
# - $redirectmatch_dest
# - $redirectmatch_status_a
# - $redirectmatch_regexp_a
# - $redirectmatch_dest
if (($redirect_source and $redirect_dest) or ($redirectmatch_regexp and $redirectmatch_dest)) and $ensure == 'present' {
include apache::mod::alias
concat::fragment { "${name}-redirect":
target => "${priority_real}${filename}.conf",
order => 180,
content => template('apache/vhost/_redirect.erb'),
}
}
# Template uses:
# - $rewrites
# - $rewrite_inherit
# - $rewrite_base
# - $rewrite_rule
# - $rewrite_cond
# - $rewrite_map
if (! empty($rewrites) or $rewrite_rule or $rewrite_inherit) and $ensure == 'present' {
include apache::mod::rewrite
concat::fragment { "${name}-rewrite":
target => "${priority_real}${filename}.conf",
order => 190,
content => template('apache/vhost/_rewrite.erb'),
}
}
if $scriptalias and $ensure == 'present' {
include apache::mod::alias
concat::fragment { "${name}-scriptalias":
target => "${priority_real}${filename}.conf",
order => 200,
content => epp('apache/vhost/_scriptalias.epp', { 'scriptalias' => $scriptalias }),
}
}
if ! empty($serveraliases) and $ensure == 'present' {
concat::fragment { "${name}-serveralias":
target => "${priority_real}${filename}.conf",
order => 210,
content => epp('apache/vhost/_serveralias.epp', { 'serveraliases' => $serveraliases }),
}
}
# Template uses:
# - $setenv
# - $setenvif
# - $setenvifnocase
$use_env_mod = !empty($setenv)
$use_setenvif_mod = !empty($setenvif) or !empty($setenvifnocase)
if ($use_env_mod or $use_setenvif_mod) and $ensure == 'present' {
if $use_env_mod {
include apache::mod::env
}
if $use_setenvif_mod {
include apache::mod::setenvif
}
concat::fragment { "${name}-setenv":
target => "${priority_real}${filename}.conf",
order => 220,
content => template('apache/vhost/_setenv.erb'),
}
}
# Template uses:
# - $ssl
# - $ssl_cert
# - $ssl_key
# - $ssl_chain
# - $ssl_certs_dir
# - $ssl_ca
# - $ssl_crl_path
# - $ssl_crl
# - $ssl_crl_check
# - $ssl_protocol
# - $ssl_cipher
# - $_ssl_honorcipherorder
# - $ssl_verify_client
# - $ssl_verify_depth
# - $ssl_options
# - $ssl_openssl_conf_cmd
# - $ssl_stapling
# - $mdomain
if $ssl and $ensure == 'present' {
include apache::mod::ssl
concat::fragment { "${name}-ssl":
target => "${priority_real}${filename}.conf",
order => 230,
content => template('apache/vhost/_ssl.erb'),
}
if $ssl_reload_on_change {
[$ssl_cert, $ssl_key, $ssl_ca, $ssl_chain, $ssl_crl].each |$ssl_file| {
if $ssl_file {
include apache::mod::ssl::reload
$_ssl_file_copy = regsubst($ssl_file, '/', '_', 'G')
file { "${filename}${_ssl_file_copy}":
path => "${apache::params::puppet_ssl_dir}/${filename}${_ssl_file_copy}",
source => "file://${ssl_file}",
owner => 'root',
group => $apache::params::root_group,
mode => '0640',
seltype => 'cert_t',
notify => Class['apache::service'],
}
}
}
}
}
if $auth_kerb and $ensure == 'present' {
include apache::mod::auth_kerb
concat::fragment { "${name}-auth_kerb":
target => "${priority_real}${filename}.conf",
order => 230,
content => stdlib::deferrable_epp('apache/vhost/_auth_kerb.epp', {
'auth_kerb' => $auth_kerb,
'krb_method_negotiate' => $krb_method_negotiate,
'krb_method_k5passwd' => Deferred('sprintf', [$krb_method_k5passwd]),
'krb_authoritative' => $krb_authoritative,
'krb_auth_realms' => $krb_auth_realms,
'krb_5keytab' => $krb_5keytab,
'krb_local_user_mapping' => $krb_local_user_mapping,
'krb_verify_kdc' => $krb_verify_kdc,
'krb_servicename' => $krb_servicename,
'krb_save_credentials' => $krb_save_credentials,
}),
}
}
# Template uses:
# - $php_values
# - $php_flags
if ($php_values and ! empty($php_values)) or ($php_flags and ! empty($php_flags)) {
concat::fragment { "${name}-php":
target => "${priority_real}${filename}.conf",
order => 240,
content => template('apache/vhost/_php.erb'),
}
}
# Template uses:
# - $php_admin_values
# - $php_admin_flags
if ($php_admin_values and ! empty($php_admin_values)) or ($php_admin_flags and ! empty($php_admin_flags)) {
concat::fragment { "${name}-php_admin":
target => "${priority_real}${filename}.conf",
order => 250,
content => template('apache/vhost/_php_admin.erb'),
}
}
if $wsgi_daemon_process_options {
deprecation('apache::vhost::wsgi_daemon_process_options', 'This parameter is deprecated. Please add values inside Hash `wsgi_daemon_process`.')
}
if ($wsgi_application_group or $wsgi_daemon_process or ($wsgi_import_script and $wsgi_import_script_options) or $wsgi_process_group or ($wsgi_script_aliases and ! empty($wsgi_script_aliases)) or $wsgi_pass_authorization) and $ensure == 'present' {
include apache::mod::wsgi
$wsgi_params = {
'wsgi_application_group' => $wsgi_application_group,
'wsgi_daemon_process' => $wsgi_daemon_process,
'wsgi_import_script' => $wsgi_import_script,
'wsgi_process_group' => $wsgi_process_group,
'wsgi_daemon_process_options'=> $wsgi_daemon_process_options,
'wsgi_import_script_options' => $wsgi_import_script_options,
'wsgi_script_aliases' => $wsgi_script_aliases,
'wsgi_pass_authorization' => $wsgi_pass_authorization,
'wsgi_chunked_request' => $wsgi_chunked_request,
'wsgi_script_aliases_match' => $wsgi_script_aliases_match,
}
concat::fragment { "${name}-wsgi":
target => "${priority_real}${filename}.conf",
order => 260,
content => epp('apache/vhost/_wsgi.epp', $wsgi_params),
}
}
if $custom_fragment {
$custom_fragment_params = {
'custom_fragment' => $custom_fragment,
}
concat::fragment { "${name}-custom_fragment":
target => "${priority_real}${filename}.conf",
order => 270,
content => epp('apache/vhost/_custom_fragment.epp', $custom_fragment_params),
}
}
if $suexec_user_group and $ensure == 'present' {
include apache::mod::suexec
concat::fragment { "${name}-suexec":
target => "${priority_real}${filename}.conf",
order => 290,
content => " SuexecUserGroup ${suexec_user_group}\n",
}
}
if ('h2' in $protocols or 'h2c' in $protocols or $h2_copy_files != undef or $h2_direct != undef or $h2_early_hints != undef or $h2_max_session_streams != undef or $h2_modern_tls_only != undef or $h2_push != undef or $h2_push_diary_size != undef or $h2_push_priority != [] or $h2_push_resource != [] or $h2_serialize_headers != undef or $h2_stream_max_mem_size != undef or $h2_tls_cool_down_secs != undef or $h2_tls_warm_up_size != undef or $h2_upgrade != undef or $h2_window_size != undef) and $ensure == 'present' {
include apache::mod::http2
$http2_params = {
'h2_copy_files' => $h2_copy_files,
'h2_direct' => $h2_direct,
'h2_early_hints' => $h2_early_hints,
'h2_max_session_streams' => $h2_max_session_streams,
'h2_modern_tls_only' => $h2_modern_tls_only,
'h2_push' => $h2_push,
'h2_push_diary_size' => $h2_push_diary_size,
'h2_push_priority' => $h2_push_priority,
'h2_push_resource' => $h2_push_resource,
'h2_serialize_headers' => $h2_serialize_headers,
'h2_stream_max_mem_size' => $h2_stream_max_mem_size,
'h2_tls_cool_down_secs' => $h2_tls_cool_down_secs,
'h2_tls_warm_up_size' => $h2_tls_warm_up_size,
'h2_upgrade' => $h2_upgrade,
'h2_window_size' => $h2_window_size,
}
concat::fragment { "${name}-http2":
target => "${priority_real}${filename}.conf",
order => 300,
content => epp('apache/vhost/_http2.epp', $http2_params),
}
}
if $mdomain and $ensure == 'present' {
include apache::mod::md
}
if $userdir and $ensure == 'present' {
include apache::mod::userdir
concat::fragment { "${name}-userdir":
target => "${priority_real}${filename}.conf",
order => 300,
content => epp('apache/vhost/_userdir.epp', { 'userdir' => $userdir }),
}
}
if ($passenger_enabled != undef or $passenger_start_timeout != undef or $passenger_ruby != undef or $passenger_python != undef or $passenger_nodejs != undef or $passenger_meteor_app_settings != undef or $passenger_app_env != undef or $passenger_app_root != undef or $passenger_app_group_name != undef or $passenger_app_start_command != undef or $passenger_app_type != undef or$passenger_startup_file != undef or $passenger_restart_dir != undef or $passenger_spawn_method != undef or $passenger_load_shell_envvars != undef or $passenger_preload_bundler != undef or $passenger_rolling_restarts != undef or $passenger_resist_deployment_errors != undef or $passenger_min_instances != undef or $passenger_max_instances != undef or $passenger_max_preloader_idle_time != undef or $passenger_force_max_concurrent_requests_per_process != undef or $passenger_concurrency_model != undef or $passenger_thread_count != undef or $passenger_high_performance != undef or $passenger_max_request_queue_size != undef or $passenger_max_request_queue_time != undef or $passenger_user != undef or $passenger_group != undef or $passenger_friendly_error_pages != undef or $passenger_buffer_upload != undef or $passenger_buffer_response != undef or $passenger_allow_encoded_slashes != undef or $passenger_lve_min_uid != undef or $passenger_base_uri != undef or $passenger_error_override != undef or $passenger_sticky_sessions != undef or $passenger_sticky_sessions_cookie_name != undef or $passenger_sticky_sessions_cookie_attributes != undef or $passenger_app_log_file != undef or $passenger_debugger != undef or $passenger_max_requests != undef or $passenger_max_request_time != undef or $passenger_memory_limit != undef or $passenger_dump_config_manifest != undef) and $ensure == 'present' {
include apache::mod::passenger
$passenger_params = {
'passenger_enabled' => $passenger_enabled,
'passenger_base_uri' => $passenger_base_uri,
'passenger_ruby' => $passenger_ruby,
'passenger_python' => $passenger_python,
'passenger_nodejs' => $passenger_nodejs,
'passenger_meteor_app_settings' => $passenger_meteor_app_settings,
'passenger_app_env' => $passenger_app_env,
'passenger_app_root' => $passenger_app_root,
'passenger_app_group_name' => $passenger_app_group_name,
'passenger_app_start_command' => $passenger_app_start_command,
'passenger_app_type' => $passenger_app_type,
'passenger_startup_file' => $passenger_startup_file,
'passenger_restart_dir' => $passenger_restart_dir,
'passenger_spawn_method' => $passenger_spawn_method,
'passenger_load_shell_envvars' => $passenger_load_shell_envvars,
'passenger_preload_bundler' => $passenger_preload_bundler,
'passenger_rolling_restarts' => $passenger_rolling_restarts,
'passenger_resist_deployment_errors' => $passenger_resist_deployment_errors,
'passenger_user' => $passenger_user,
'passenger_group' => $passenger_group,
'passenger_friendly_error_pages' => $passenger_friendly_error_pages,
'passenger_min_instances' => $passenger_min_instances,
'passenger_max_instances' => $passenger_max_instances,
'passenger_max_preloader_idle_time' => $passenger_max_preloader_idle_time,
'passenger_force_max_concurrent_requests_per_process' => $passenger_force_max_concurrent_requests_per_process,
'passenger_start_timeout' => $passenger_start_timeout,
'passenger_concurrency_model' => $passenger_concurrency_model,
'passenger_thread_count' => $passenger_thread_count,
'passenger_max_requests' => $passenger_max_requests,
'passenger_max_request_time' => $passenger_max_request_time,
'passenger_memory_limit' => $passenger_memory_limit,
'passenger_stat_throttle_rate' => $passenger_stat_throttle_rate,
'passenger_high_performance' => $passenger_high_performance,
'passenger_buffer_upload' => $passenger_buffer_upload,
'passenger_buffer_response' => $passenger_buffer_response,
'passenger_error_override' => $passenger_error_override,
'passenger_max_request_queue_size' => $passenger_max_request_queue_size,
'passenger_max_request_queue_time' => $passenger_max_request_queue_time,
'passenger_sticky_sessions' => $passenger_sticky_sessions,
'passenger_sticky_sessions_cookie_name' => $passenger_sticky_sessions_cookie_name,
'passenger_sticky_sessions_cookie_attributes' => $passenger_sticky_sessions_cookie_attributes,
'passenger_allow_encoded_slashes' => $passenger_allow_encoded_slashes,
'passenger_app_log_file' => $passenger_app_log_file,
'passenger_debugger' => $passenger_debugger,
'passenger_lve_min_uid' => $passenger_lve_min_uid,
}
concat::fragment { "${name}-passenger":
target => "${priority_real}${filename}.conf",
order => 300,
content => epp('apache/vhost/_passenger.epp', $passenger_params),
}
}
if $add_default_charset {
$charsets_params = {
'add_default_charset' => $add_default_charset,
}
concat::fragment { "${name}-charsets":
target => "${priority_real}${filename}.conf",
order => 310,
content => epp('apache/vhost/_charsets.epp', $charsets_params),
}
}
if $modsec_disable_vhost or $modsec_disable_ids or !empty($modsec_disable_ips) or $modsec_disable_msgs or $modsec_disable_tags or $modsec_audit_log_destination or ($modsec_inbound_anomaly_threshold and $modsec_outbound_anomaly_threshold) or $modsec_allowed_methods {
$security_params = {
'modsec_disable_vhost' => $modsec_disable_vhost,
'modsec_audit_log_destination' => $modsec_audit_log_destination,
'_modsec_disable_ids' => $modsec_disable_ids,
'modsec_disable_ips' => $modsec_disable_ips,
'_modsec_disable_msgs' => $modsec_disable_msgs,
'_modsec_disable_tags' => $modsec_disable_tags,
'modsec_body_limit' => $modsec_body_limit,
'modsec_inbound_anomaly_threshold' => $modsec_inbound_anomaly_threshold,
'modsec_outbound_anomaly_threshold' => $modsec_outbound_anomaly_threshold,
'modsec_allowed_methods' => $modsec_allowed_methods,
}
concat::fragment { "${name}-security":
target => "${priority_real}${filename}.conf",
order => 320,
content => epp('apache/vhost/_security.epp', $security_params),
}
}
if ! empty($filters) and $ensure == 'present' {
include apache::mod::filter
concat::fragment { "${name}-filters":
target => "${priority_real}${filename}.conf",
order => 330,
content => epp('apache/vhost/_filters.epp', { 'filters' => $filters }),
}
}
if !empty($jk_mounts) and $ensure == 'present' {
include apache::mod::jk
concat::fragment { "${name}-jk_mounts":
target => "${priority_real}${filename}.conf",
order => 340,
content => epp('apache/vhost/_jk_mounts.epp', { 'jk_mounts' => $jk_mounts }),
}
}
if $keepalive or $keepalive_timeout or $max_keepalive_requests {
$keep_alive_params = {
'keepalive' => $keepalive,
'keepalive_timeout' => $keepalive_timeout,
'max_keepalive_requests' => $max_keepalive_requests,
}
concat::fragment { "${name}-keepalive_options":
target => "${priority_real}${filename}.conf",
order => 350,
content => epp('apache/vhost/_keepalive_options.epp', $keep_alive_params),
}
}
if $cas_enabled {
$auth_cas_params = {
'cas_enabled' => $cas_enabled,
'cas_cookie_path' => $cas_cookie_path,
'cas_login_url' => $cas_login_url,
'cas_validate_url' => $cas_validate_url,
'cas_version' => $apache::mod::auth_cas::cas_version,
'cas_debug' => $apache::mod::auth_cas::cas_debug,
'cas_certificate_path' => $apache::mod::auth_cas::cas_certificate_path,
'cas_proxy_validate_url' => $apache::mod::auth_cas::cas_proxy_validate_url,
'cas_validate_depth' => $apache::mod::auth_cas::cas_validate_depth,
'cas_root_proxied_as' => $cas_root_proxied_as,
'cas_cookie_entropy' => $apache::mod::auth_cas::cas_cookie_entropy,
'cas_timeout' => $apache::mod::auth_cas::cas_timeout,
'cas_idle_timeout' => $apache::mod::auth_cas::cas_idle_timeout,
'cas_cache_clean_interval' => $apache::mod::auth_cas::cas_cache_clean_interval,
'cas_cookie_domain' => $apache::mod::auth_cas::cas_cookie_domain,
'cas_cookie_http_only' => $apache::mod::auth_cas::cas_cookie_http_only,
'cas_authoritative' => $apache::mod::auth_cas::cas_authoritative,
'cas_sso_enabled' => $cas_sso_enabled,
'cas_validate_saml' => $cas_validate_saml,
'cas_attribute_prefix' => $cas_attribute_prefix,
'cas_attribute_delimiter' => $cas_attribute_delimiter,
'cas_scrub_request_headers' => $cas_scrub_request_headers,
}
concat::fragment { "${name}-auth_cas":
target => "${priority_real}${filename}.conf",
order => 350,
content => epp('apache/vhost/_auth_cas.epp', $auth_cas_params),
}
}
if $http_protocol_options {
concat::fragment { "${name}-http_protocol_options":
target => "${priority_real}${filename}.conf",
order => 350,
content => epp('apache/vhost/_http_protocol_options.epp', { 'http_protocol_options' => $http_protocol_options }),
}
}
if $auth_oidc and $ensure == 'present' {
include apache::mod::auth_openidc
concat::fragment { "${name}-auth_oidc":
target => "${priority_real}${filename}.conf",
order => 360,
content => stdlib::deferrable_epp('apache/vhost/_auth_oidc.epp', {
'auth_oidc' => $auth_oidc,
'oidc_settings' => $oidc_settings,
}),
}
}
if $shibboleth_enabled {
concat::fragment { "${name}-shibboleth":
target => "${priority_real}${filename}.conf",
order => 370,
content => epp('apache/vhost/_shib.epp', { 'shib_compat_valid_user' => $shib_compat_valid_user }),
}
}
if $use_canonical_name {
concat::fragment { "${name}-use_canonical_name":
target => "${priority_real}${filename}.conf",
order => 360,
content => "UseCanonicalName ${use_canonical_name}",
}
}
$file_footer_params = {
'define' => $define,
'passenger_pre_start' => $passenger_pre_start,
}
concat::fragment { "${name}-file_footer":
target => "${priority_real}${filename}.conf",
order => 999,
content => epp('apache/vhost/_file_footer.epp', $file_footer_params),
}
}
|