3030 "ca_cert_config" : "/etc/ca-certificates/conf.d/cloud-init.conf" ,
3131 "ca_cert_update_cmd" : ["update-ca-bundle" ],
3232 },
33- "fedora" : {
34- "ca_cert_path" : "/etc/pki/ca-trust/" ,
35- "ca_cert_local_path" : "/usr/share/pki/ca-trust-source/" ,
36- "ca_cert_filename" : "anchors/cloud-init-ca-cert-{cert_index}.crt" ,
37- "ca_cert_config" : None ,
38- "ca_cert_update_cmd" : ["update-ca-trust" ],
39- },
4033 "rhel" : {
4134 "ca_cert_path" : "/etc/pki/ca-trust/" ,
4235 "ca_cert_local_path" : "/usr/share/pki/ca-trust-source/" ,
6053 },
6154}
6255
63- for distro in (
64- "opensuse-microos" ,
65- "opensuse-tumbleweed" ,
66- "opensuse-leap" ,
67- "sle_hpc" ,
68- "sle-micro" ,
69- "sles" ,
70- ):
71- DISTRO_OVERRIDES [distro ] = DISTRO_OVERRIDES ["opensuse" ]
72-
73- for distro in (
74- "almalinux" ,
75- "centos" ,
76- "cloudlinux" ,
77- "rocky" ,
78- ):
79- DISTRO_OVERRIDES [distro ] = DISTRO_OVERRIDES ["rhel" ]
80-
81- distros = [
82- "almalinux" ,
56+ DISTRO_FAMILY = {
57+ "almalinux" : "rhel" ,
58+ "amazon" : "rhel" ,
59+ "centos" : "rhel" ,
60+ "cloudlinux" : "rhel" ,
61+ "fedora" : "rhel" ,
62+ "opensuse-microos" : "opensuse" ,
63+ "opensuse-tumbleweed" : "opensuse" ,
64+ "opensuse-leap" : "opensuse" ,
65+ "rocky" : "rhel" ,
66+ "sle_hpc" : "opensuse" ,
67+ "sle-micro" : "opensuse" ,
68+ "sles" : "opensuse" ,
69+ }
70+
71+ distros = list (DISTRO_FAMILY .keys ()) + [
8372 "aosc" ,
84- "centos" ,
85- "cloudlinux" ,
8673 "alpine" ,
8774 "debian" ,
88- "fedora" ,
8975 "raspberry-pi-os" ,
9076 "rhel" ,
91- "rocky" ,
9277 "opensuse" ,
93- "opensuse-microos" ,
94- "opensuse-tumbleweed" ,
95- "opensuse-leap" ,
96- "sle_hpc" ,
97- "sle-micro" ,
98- "sles" ,
9978 "ubuntu" ,
10079 "photon" ,
10180]
@@ -114,6 +93,8 @@ def _distro_ca_certs_configs(distro_name):
11493 @param distro_name: String providing the distro class name.
11594 @returns: Dict of distro configurations for ca_cert.
11695 """
96+ if distro_name in DISTRO_FAMILY :
97+ distro_name = DISTRO_FAMILY [distro_name ]
11798 cfg = DISTRO_OVERRIDES .get (distro_name , DEFAULT_CONFIG )
11899 cfg ["ca_cert_full_path" ] = os .path .join (
119100 cfg ["ca_cert_local_path" ], cfg ["ca_cert_filename" ]
@@ -160,7 +141,7 @@ def disable_default_ca_certs(distro_name, distro_cfg):
160141 @param distro_name: String providing the distro class name.
161142 @param distro_cfg: A hash providing _distro_ca_certs_configs function.
162143 """
163- if distro_name in ["rhel" , "photon" ]:
144+ if distro_name in ["rhel" , "photon" , "amazon" ]:
164145 remove_default_ca_certs (distro_cfg )
165146 elif distro_name in [
166147 "alpine" ,
0 commit comments