Closed kleini closed 9 years ago
I solved it by manually importing our own build keys using
zypper_repo repositoryAlias do
uri url
autorefresh true
action :nothing
end
execute 'import-oxbuilkey' do
command "rpm --import #{node['open-xchange']['repository']['buildkey']}"
action :nothing
notifies :add, "zypper_repo[#{repositoryAlias}]"
end
# Ensure package curl is installed. RPM uses curl to download the public key but the rpm package lacks a dependency on curl
package 'curl' do
action :install
notifies :run, 'execute[import-oxbuilkey]', :immediately
end
Please notice the workaround for the missing curl dependency on the rpm package of SUSE Linux Enterprise Server 12.
Thanks for opening this issue. I will take a look at adding this functionality.
It does not work using the notify mechanism of Chef. Instead I had to reorder the resources. Otherwise added zypper repositories are not considered for packages to be installed.
# Workaround for https://bugzilla.opensuse.org/show_bug.cgi?id=941804
package 'curl' do
action :install
end
execute 'import-oxbuilkey' do
command "rpm --import #{node['open-xchange']['repository']['buildkey']}"
action :run
end
node['open-xchange']['repository']['repos'].each do |reponame, enable|
next unless enable
zypper_repo "Open-Xchange_#{reponame}" do
uri OXRepo.build_url(reponame, node)
autorefresh true
action :add
end
end
execute 'update-repositories' do
command 'zypper refresh'
action :run
end
@kleini does PR #2 solve this for you?
Your PR #2 looks good. I will test it, when I get time for that.
It works now using the following code to add our repositories:
node['open-xchange']['repository']['repos'].each do |reponame, enable|
next unless enable
zypper_repo "Open-Xchange_#{reponame}" do
uri OXRepo.build_url(reponame, node)
autorefresh true
action :add
key node['open-xchange']['repository']['buildkey']
end
end
When will a release with this change be available?
A new release should now be available on Supermarket.
Great!
We sign our packages for SUSE Linux distributions with our own build key. When adding our software repositories using this cookbook we currently do no have the possibility to download and add our build key within the zypper_repo resource.
The apt and yum cookbooks provide support for own build keys.