# Configures web server for serving package repo. class profiles::repomaster ( String $directory, String $hostname = "repo.${::fqdn}", Boolean $publish_dns = false, Optional[String] $dns_zone = undef, ) { include ::profiles::nginx include ::profiles::certificate letsencrypt::domain { $hostname: cert_name => $profiles::certificate::cert_name, } nginx::resource::server { $hostname: www_root => $directory, autoindex => 'on', use_default_location => true, ipv6_enable => true, ipv6_listen_options => '', listen_options => '', * => letsencrypt::conf::nginx($hostname), } if $publish_dns { # TODO Separate toggles for ipv4 and ipv6 # Since ipv4 might be internal and shouldn't be exported. # @@dns_record { "${hostname} A": # type => 'A', # zone => $dns_zone, # key => $hostname, # value => $facts['ipaddress'], # } @@dns::record { "${hostname} AAAA": type => 'AAAA', zone => $dns_zone, key => $hostname, value => $facts['ipaddress6'], } } }