From 48c51e6c1eeb023ffe80ded41c299daf15090f74 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 27 Jun 2024 16:19:19 +0200 Subject: [PATCH] Change Stdlib::Host to no longer accept subnets A host should be a specific IP and not allow a subnet. --- spec/type_aliases/host_spec.rb | 2 ++ types/host.pp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/type_aliases/host_spec.rb b/spec/type_aliases/host_spec.rb index 6cfd3d94b..6e059f89f 100644 --- a/spec/type_aliases/host_spec.rb +++ b/spec/type_aliases/host_spec.rb @@ -35,6 +35,8 @@ 'bob@example.com', '%.example.com', '2001:0d8', + '192.0.2.0/24', + '2001:db8::/32', ].each do |value| describe value.inspect do it { is_expected.not_to allow_value(value) } diff --git a/types/host.pp b/types/host.pp index 46f349bac..447e4f5f7 100644 --- a/types/host.pp +++ b/types/host.pp @@ -1,2 +1,2 @@ # @summary Validate a host (FQDN or IP address) -type Stdlib::Host = Variant[Stdlib::Fqdn, Stdlib::IP::Address] +type Stdlib::Host = Variant[Stdlib::Fqdn, Stdlib::IP::Address::Nosubnet]