|
@@ -0,0 +1,35 @@
|
|
|
+#
|
|
|
+# Cookbook:: apt_repositories
|
|
|
+# Recipe:: _terraform
|
|
|
+#
|
|
|
+# Copyright:: 2022, The Authors, All Rights Reserved.
|
|
|
+#
|
|
|
+# Cookbook:: workstation
|
|
|
+# Recipe:: _podman
|
|
|
+#
|
|
|
+# Copyright:: 2022, The Authors, All Rights Reserved.
|
|
|
+
|
|
|
+
|
|
|
+include_recipe 'apt_repositories::_packages'
|
|
|
+
|
|
|
+remote_file ::File.join(Chef::Config['file_cache_path'], 'hashicorp.key') do
|
|
|
+ source 'https://apt.releases.hashicorp.com/gpg'
|
|
|
+ action :create_if_missing
|
|
|
+end
|
|
|
+
|
|
|
+key_path = '/etc/apt/trusted.gpg.d'
|
|
|
+keygpg = ::File.join(key_path, 'hashicorp.gpg')
|
|
|
+
|
|
|
+execute 'GPG key for Hashicorp' do
|
|
|
+ command "cat #{::File.join(Chef::Config['file_cache_path'], 'hashicorp.key')} | gpg --dearmor | tee #{keygpg} > /dev/null"
|
|
|
+ not_if { ::File.exist?(keygpg) }
|
|
|
+end
|
|
|
+
|
|
|
+apt_repository 'hashicorp' do
|
|
|
+ arch 'amd64'
|
|
|
+ uri 'https://apt.releases.hashicorp.com'
|
|
|
+ distribution lazy { Mixlib::ShellOut.new('lsb_release -cs').run_command.stdout.chomp }
|
|
|
+ components %w{main}
|
|
|
+ deb_src false
|
|
|
+ action :add
|
|
|
+end
|