@@ -1035,6 +1035,11 @@ def install_repo_configs_from_url(host, repo_config_url, copy_dir = nil)
10351035 end
10361036 scp_to ( host , repo , to_path )
10371037
1038+ variant , version , arch , codename = host [ 'platform' ] . to_array
1039+ if variant =~ /^ubuntu$/ && version . split ( '.' ) . first . to_i >= 18
1040+ # Allow the use of unsigned repos with Ubuntu 18.04+
1041+ on host , "echo 'Acquire::AllowInsecureRepositories \" true\" ;' > /etc/apt/apt.conf.d/90insecure"
1042+ end
10381043 on ( host , 'apt-get update' ) if host [ 'platform' ] =~ /ubuntu-|debian-|cumulus-|huaweios-/
10391044 nil
10401045 end
@@ -1080,6 +1085,11 @@ def install_puppetlabs_dev_repo ( host, package_name, build_version,
10801085 dev_builds_url = protocol + hostname
10811086 dev_builds_url = opts [ :dev_builds_url ] if variant =~ /^(fedora|el|centos)$/
10821087
1088+ if variant =~ /^ubuntu$/ && version . split ( '.' ) . first . to_i >= 18
1089+ # Allow the use of unsigned repos with Ubuntu 18.04+
1090+ on host , "echo 'Acquire::AllowInsecureRepositories \" true\" ;' > /etc/apt/apt.conf.d/90insecure"
1091+ end
1092+
10831093 install_repo_configs ( host , dev_builds_url , package_name ,
10841094 build_version , platform_configs_dir )
10851095
@@ -1177,10 +1187,6 @@ def install_puppet_agent_dev_repo_on( hosts, global_opts )
11771187 if arch == 's390x' || host [ 'hypervisor' ] == 'ec2'
11781188 logger . trace ( "#install_puppet_agent_dev_repo_on: unsupported host #{ host } for repo detected. using dev package" )
11791189 else
1180- if variant =~ /^ubuntu$/ && version . split ( '.' ) . first . to_i >= 18
1181- # Allow the use of unsigned repos with Ubuntu 18.04+
1182- on host , "echo 'Acquire::AllowInsecureRepositories \" true\" ;' > /etc/apt/apt.conf.d/90insecure"
1183- end
11841190 install_puppetlabs_dev_repo ( host , 'puppet-agent' , puppet_agent_version , nil , opts )
11851191 host . install_package ( 'puppet-agent' )
11861192 logger . trace ( "#install_puppet_agent_dev_repo_on: install_puppetlabs_dev_repo finished" )
0 commit comments