From 1ffa1998d66df9aa6c85be6d9d195470d7340278 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Thu, 24 Aug 2017 15:24:04 -0700 Subject: Auto import gpg keys in zypper_repository Without this anything that's gpg signed will fail waiting for the user to accept or deny the key. If users don't want this I've provided a new property to disable it. Signed-off-by: Tim Smith --- lib/chef/provider/zypper_repository.rb | 2 +- lib/chef/resource/zypper_repository.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/chef/provider/zypper_repository.rb b/lib/chef/provider/zypper_repository.rb index 83d3f9982e..805741706b 100644 --- a/lib/chef/provider/zypper_repository.rb +++ b/lib/chef/provider/zypper_repository.rb @@ -57,7 +57,7 @@ class Chef end action :refresh do - declare_resource(:execute, "zypper refresh #{escaped_repo_name}") do + declare_resource(:execute, "zypper#{' --gpg-auto-import-keys' if new_resource.gpgautoimportkeys} refresh #{escaped_repo_name}") do only_if "zypper lr #{escaped_repo_name}" end end diff --git a/lib/chef/resource/zypper_repository.rb b/lib/chef/resource/zypper_repository.rb index 11db8642b2..69a96b42cf 100644 --- a/lib/chef/resource/zypper_repository.rb +++ b/lib/chef/resource/zypper_repository.rb @@ -39,6 +39,7 @@ class Chef property :mode, default: "0644" property :refresh_cache, [true, false], default: true property :source, String, regex: /.*/ + property :gpgautoimportkeys, [true, false], default: true default_action :create allowed_actions :create, :remove, :add, :refresh -- cgit v1.2.1