From dc55ff9d1c8fbd4974fa91c24c7afb43eb1b4a4f Mon Sep 17 00:00:00 2001 From: Anthony Hinsinger Date: Tue, 7 Jan 2025 23:48:29 +0100 Subject: [PATCH 1/5] Update ruby version fact --- manifests/install/agent.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/install/agent.pp b/manifests/install/agent.pp index dbe80ae8..2975ffe4 100644 --- a/manifests/install/agent.pp +++ b/manifests/install/agent.pp @@ -9,7 +9,7 @@ provider => 'puppet_gem', } - if versioncmp($facts['rubyversion'], '2.3.0') < 0 { + if versioncmp($facts['ruby']['version'], '2.3.0') < 0 { package { 'backport_dig': ensure => present, provider => 'puppet_gem', From 9e2a2ca9ad4e7fbeae9c86e62a41b936e2270e40 Mon Sep 17 00:00:00 2001 From: Anthony Hinsinger Date: Wed, 15 Jan 2025 22:58:29 +0100 Subject: [PATCH 2/5] fixed safe_load arguments --- lib/puppet_x/puppetlabs/cisco_ios/utility.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet_x/puppetlabs/cisco_ios/utility.rb b/lib/puppet_x/puppetlabs/cisco_ios/utility.rb index 2c7aeef4..7ad1faa2 100644 --- a/lib/puppet_x/puppetlabs/cisco_ios/utility.rb +++ b/lib/puppet_x/puppetlabs/cisco_ios/utility.rb @@ -9,7 +9,7 @@ class Utility def self.load_yaml(full_path, replace_double_escapes = true) raise "File #{full_path} doesn't exist." unless File.exist?(full_path) yaml_file = File.read(full_path) - data_hash = YAML.safe_load(yaml_file, [Symbol]) + data_hash = YAML.safe_load(yaml_file, permitted_classes: [Symbol]) data_hash = replace_double_escapes(data_hash) if replace_double_escapes data_hash end From 0916e946645fc89828909581d8d530abda7c7a38 Mon Sep 17 00:00:00 2001 From: Anthony Hinsinger Date: Wed, 15 Jan 2025 23:00:34 +0100 Subject: [PATCH 3/5] Update metadata.json for puppet 8 --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index a7aeecc9..5af8c7b4 100644 --- a/metadata.json +++ b/metadata.json @@ -36,7 +36,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 6.0.0 < 7.0.0" + "version_requirement": ">= 6.0.0 < 8.0.0" } ], "tags": [ From 8f3c5ab1205dcfe91f0409b74f5e28ee4818fb91 Mon Sep 17 00:00:00 2001 From: Anthony Hinsinger Date: Wed, 15 Jan 2025 23:33:06 +0100 Subject: [PATCH 4/5] Adapted safe_load arguments to psych version --- lib/puppet_x/puppetlabs/cisco_ios/utility.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/puppet_x/puppetlabs/cisco_ios/utility.rb b/lib/puppet_x/puppetlabs/cisco_ios/utility.rb index 7ad1faa2..8ab478a7 100644 --- a/lib/puppet_x/puppetlabs/cisco_ios/utility.rb +++ b/lib/puppet_x/puppetlabs/cisco_ios/utility.rb @@ -9,7 +9,11 @@ class Utility def self.load_yaml(full_path, replace_double_escapes = true) raise "File #{full_path} doesn't exist." unless File.exist?(full_path) yaml_file = File.read(full_path) - data_hash = YAML.safe_load(yaml_file, permitted_classes: [Symbol]) + if Gem::Version.new(Psych::VERSION) >= Gem::Version.new("3.1.0.pre1") + data_hash = YAML.safe_load(yaml_file, permitted_classes: [Symbol]) + else + data_hash = YAML.safe_load(yaml_file, [Symbol]) + end data_hash = replace_double_escapes(data_hash) if replace_double_escapes data_hash end From 6819eed1510e527a3ae1d30df32e0eda11a5f7ca Mon Sep 17 00:00:00 2001 From: Anthony Hinsinger Date: Mon, 3 Feb 2025 16:03:12 +0100 Subject: [PATCH 5/5] Update verify_host_key options --- lib/puppet/transport/cisco_ios.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/puppet/transport/cisco_ios.rb b/lib/puppet/transport/cisco_ios.rb index 05219ebd..9f15e769 100644 --- a/lib/puppet/transport/cisco_ios.rb +++ b/lib/puppet/transport/cisco_ios.rb @@ -55,7 +55,7 @@ def create_connection password: config[:password].unwrap, port: config[:port] || 22, timeout: config[:timeout] || 30, - verify_host_key => false, + verify_host_key => :never, user_known_hosts_file: known_hosts_file, append_all_supported_algorithms: true) else @@ -64,7 +64,7 @@ def create_connection password: config[:password].unwrap, port: config[:port] || 22, timeout: config[:timeout] || 30, - verify_host_key => :very, + verify_host_key => :accept_new, user_known_hosts_file: known_hosts_file, append_all_supported_algorithms: true) end