Azure bug verified with the following script:
-----------------------------------
import logging
import os

from pycloudlib.azure.cloud import Azure


api = Azure(
    tag="test-azure",
    client_id=os.getenv("UACLIENT_BEHAVE_AZ_CLIENT_ID"),
    client_secret=os.getenv("UACLIENT_BEHAVE_AZ_CLIENT_SECRET"),
    tenant_id=os.getenv("UACLIENT_BEHAVE_AZ_TENANT_ID"),
    subscription_id=os.getenv("UACLIENT_BEHAVE_AZ_SUBSCRIPTION_ID")
)

image_id = "Canonical:0001-com-ubuntu-pro-focal:pro-20_04-lts"  # Focal pro 
image
key_name = "test-key"
private_key_path = "azure-priv-{}.pem".format(key_name)
pub_key_path = "azure-pub-{}.txt".format(key_name)

pub_key, priv_key = api.create_key_pair(
    key_name=key_name
)

with open(pub_key_path, "w") as stream:
    stream.write(pub_key)

with open(private_key_path, "w") as stream:
    stream.write(priv_key)

os.chmod(pub_key_path, 0o600)
os.chmod(private_key_path, 0o600)

api.use_key(pub_key_path, private_key_path, key_name)
instance = api.launch(image_id)

print("--- Creating base instance")
print(instance.execute("lsb_release -a"))
instance.execute("sh -c 'sudo apt-get update > /dev/null'")
instance.execute("sh -c 'sudo apt-get install ubuntu-advantage-tools > 
/dev/null'")
print(instance.execute("ua version"))
print(instance.execute("sudo ua enable fips --assume-yes"))
print("------------------")

print("--- Updating ua package")
cmd = "sudo sh -c \"echo 'deb http://archive.ubuntu.com/ubuntu/ {}-proposed 
restricted main multiverse universe' >> 
/etc/apt/sources.list.d/proposed-repositories.list\""
instance.execute(cmd.format("focal"))
instance.execute("sh -c 'sudo apt-get update > /dev/null'")
instance.execute("sh -c 'sudo apt-get install ubuntu-advantage-tools > 
/dev/null'")
print(instance.execute("ua version"))
print(instance.execute("sudo ua enable fips --assume-yes"))
print("------------------")
instance.delete()
-------------------------------------

Test output:

--- Creating base instance                                                      
                                                                              
Distributor ID: Ubuntu                                                          
                                                                              
Description:    Ubuntu 20.04.3 LTS                                              
                                                                              
Release:        20.04                                                           
                                                                              
Codename:       focal                                                           
                                                                              
27.2.2~20.04.1                                                                  
                                                                              
One moment, checking your subscription first                                    
                                                                              
Updating package lists                                                          
                                                                              
Installing FIPS packages                                                        
                                                                              
Updating package lists                                                          
                                                                              
Could not enable FIPS.                                                          
                                                                              
------------------                                                              
                                                                              
--- Updating ua package                                                         
                                                                              
27.3~20.04.1                                                                    
                                                                              
One moment, checking your subscription first                                    
                                                                              
Ubuntu Focal does not provide an Azure optimized FIPS kernel                    
                                                                              
For help see: https://ubuntu.com/advantage.                                     
                                                                              
------------------  


** Tags removed: verification-needed verification-needed-bionic 
verification-needed-focal verification-needed-hirsute 
verification-needed-impish verification-needed-xenial
** Tags added: verification-done verification-done-bionic 
verification-done-focal verification-done-hirsute verification-done-impish 
verification-done-xenial

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1939932

Title:
  Ubuntu PRO Focal on AWS and Azure should not install the generic FIPS
  kernel via ubuntu-fips metapackage

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/1939932/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to