Skip to content

Commit 74bc4c7

Browse files
committed
Enable cloud-init apt-configure module for Azure stemcells
Azure stemcells now properly use Azure-optimized APT mirrors (azure.archive.ubuntu.com) by enabling the apt-configure module in cloud-init configuration. The LISA (Linux Integration Services Automation) test suite's verify_repository_installed test was failing because Azure VMs were using archive.ubuntu.com instead of azure.archive.ubuntu.com for APT package repositories. While the Azure mirror configuration existed in /etc/cloud/cloud.cfg.d/90-azure-apt-sources.cfg, it was never applied because the apt-configure module was not enabled in cloud-init's module list. Added apt-configure to the cloud_init_modules list in cloud.cfg, which instructs cloud-init to read and apply the Azure APT mirror configuration at VM boot time. This ensures /etc/apt/sources.list is automatically updated to use Azure-optimized mirrors.
1 parent b600c01 commit 74bc4c7

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

  • bosh-stemcell/spec/stemcells
  • stemcell_builder/stages/system_azure_init/assets/etc/cloud-init

bosh-stemcell/spec/stemcells/azure_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@
4141
end
4242
end
4343

44+
context 'cloud-init Azure APT mirror configuration' do
45+
describe file('/etc/cloud/cloud.cfg.d/90-azure-apt-sources.cfg') do
46+
it { should be_file }
47+
its(:content) { should include('http://azure.archive.ubuntu.com/ubuntu/') }
48+
end
49+
50+
describe file('/etc/cloud/cloud.cfg') do
51+
it { should be_file }
52+
its(:content) { should include('apt-configure') }
53+
end
54+
end
55+
4456
context 'installed by system_azure_init', {
4557
exclude_on_alicloud: true,
4658
exclude_on_aws: true,

stemcell_builder/stages/system_azure_init/assets/etc/cloud-init/cloud.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ cloud_init_modules:
1010
- update_etc_hosts
1111
- users-groups
1212
- ssh
13+
- apt-configure
1314
cloud_config_modules:
1415
- ssh-import-id
1516
- set-passwords

0 commit comments

Comments
 (0)