From 87899a2f16f5bedff1c878857c3677902b4b4bd3 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Wed, 28 Sep 2022 14:04:24 +0200 Subject: [PATCH] rocky - add to multiple if base_distro statements Change-Id: Ib068117237a199db380fcdfb757d5d0e5d34326b (cherry picked from commit 9d5f9080dae018855b074a4daf09e7c62a51dffb) --- ansible/roles/cinder/templates/cinder-wsgi.conf.j2 | 2 +- .../roles/heat/templates/wsgi-heat-api-cfn.conf.j2 | 2 +- ansible/roles/heat/templates/wsgi-heat-api.conf.j2 | 2 +- ansible/roles/horizon/templates/horizon.conf.j2 | 2 +- .../roles/ironic/templates/ironic-api-wsgi.conf.j2 | 2 +- ansible/roles/ironic/templates/ironic-tftp.json.j2 | 11 ++++++++++- .../roles/keystone/templates/wsgi-keystone.conf.j2 | 2 +- ansible/roles/nova/templates/nova-api-wsgi.conf.j2 | 2 +- ansible/roles/octavia/templates/octavia-wsgi.conf.j2 | 2 +- .../placement/templates/placement-api-wsgi.conf.j2 | 2 +- tests/templates/globals-default.j2 | 4 ++-- 11 files changed, 21 insertions(+), 12 deletions(-) diff --git a/ansible/roles/cinder/templates/cinder-wsgi.conf.j2 b/ansible/roles/cinder/templates/cinder-wsgi.conf.j2 index 5ca975c208..e4ef70dd68 100644 --- a/ansible/roles/cinder/templates/cinder-wsgi.conf.j2 +++ b/ansible/roles/cinder/templates/cinder-wsgi.conf.j2 @@ -1,5 +1,5 @@ {% if cinder_enable_tls_backend | bool %} -{% if kolla_base_distro in ['centos'] %} +{% if kolla_base_distro in ['centos', 'rocky'] %} LoadModule ssl_module /usr/lib64/httpd/modules/mod_ssl.so {% else %} LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so diff --git a/ansible/roles/heat/templates/wsgi-heat-api-cfn.conf.j2 b/ansible/roles/heat/templates/wsgi-heat-api-cfn.conf.j2 index ab4e1a1fb1..a5fd76b418 100644 --- a/ansible/roles/heat/templates/wsgi-heat-api-cfn.conf.j2 +++ b/ansible/roles/heat/templates/wsgi-heat-api-cfn.conf.j2 @@ -1,7 +1,7 @@ {% set heat_log_dir = '/var/log/kolla/heat' %} {% set binary_path = '/usr/bin' if heat_install_type == 'binary' else '/var/lib/kolla/venv/bin' %} {% if heat_enable_tls_backend | bool %} -{% if kolla_base_distro in ['centos'] %} +{% if kolla_base_distro in ['centos', 'rocky'] %} LoadModule ssl_module /usr/lib64/httpd/modules/mod_ssl.so {% else %} LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so diff --git a/ansible/roles/heat/templates/wsgi-heat-api.conf.j2 b/ansible/roles/heat/templates/wsgi-heat-api.conf.j2 index a164af2dbd..8b97213e15 100644 --- a/ansible/roles/heat/templates/wsgi-heat-api.conf.j2 +++ b/ansible/roles/heat/templates/wsgi-heat-api.conf.j2 @@ -1,7 +1,7 @@ {% set heat_log_dir = '/var/log/kolla/heat' %} {% set binary_path = '/usr/bin' if heat_install_type == 'binary' else '/var/lib/kolla/venv/bin' %} {% if heat_enable_tls_backend | bool %} -{% if kolla_base_distro in ['centos'] %} +{% if kolla_base_distro in ['centos', 'rocky'] %} LoadModule ssl_module /usr/lib64/httpd/modules/mod_ssl.so {% else %} LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so diff --git a/ansible/roles/horizon/templates/horizon.conf.j2 b/ansible/roles/horizon/templates/horizon.conf.j2 index e9671a2d07..e526f609f5 100644 --- a/ansible/roles/horizon/templates/horizon.conf.j2 +++ b/ansible/roles/horizon/templates/horizon.conf.j2 @@ -1,7 +1,7 @@ {% set python_path = '/usr/share/openstack-dashboard' if horizon_install_type == 'binary' else '/var/lib/kolla/venv/lib/python' + distro_python_version + '/site-packages' %} {% if horizon_enable_tls_backend | bool %} -{% if kolla_base_distro in ['centos'] %} +{% if kolla_base_distro in ['centos', 'rocky'] %} LoadModule ssl_module /usr/lib64/httpd/modules/mod_ssl.so {% else %} LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so diff --git a/ansible/roles/ironic/templates/ironic-api-wsgi.conf.j2 b/ansible/roles/ironic/templates/ironic-api-wsgi.conf.j2 index bc5c13c9f4..2b4a1656a2 100644 --- a/ansible/roles/ironic/templates/ironic-api-wsgi.conf.j2 +++ b/ansible/roles/ironic/templates/ironic-api-wsgi.conf.j2 @@ -1,7 +1,7 @@ {% set ironic_log_dir = '/var/log/kolla/ironic' %} {% set wsgi_directory = '/usr/bin' if ironic_install_type == 'binary' else '/var/lib/kolla/venv/bin' %} {% if ironic_enable_tls_backend | bool %} -{% if kolla_base_distro in ['centos'] %} +{% if kolla_base_distro in ['centos', 'rocky'] %} LoadModule ssl_module /usr/lib64/httpd/modules/mod_ssl.so {% else %} LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so diff --git a/ansible/roles/ironic/templates/ironic-tftp.json.j2 b/ansible/roles/ironic/templates/ironic-tftp.json.j2 index 46859ef61d..28b394e0cf 100644 --- a/ansible/roles/ironic/templates/ironic-tftp.json.j2 +++ b/ansible/roles/ironic/templates/ironic-tftp.json.j2 @@ -1,4 +1,13 @@ -{% set pxe_dir = ('/var/lib/ironic/tftpboot/grub' if kolla_base_distro in ['ubuntu', 'debian'] else '/var/lib/ironic/tftpboot/EFI/centos') if enable_ironic_pxe_uefi | bool else '/var/lib/ironic/tftpboot/pxelinux.cfg' %} +{% if enable_ironic_pxe_uefi | bool %} + {% if kolla_base_distro in ['debian', 'ubuntu'] %} + {% set pxe_dir = '/var/lib/ironic/tftpboot/grub' %} + {% elif kolla_base_distro in ['centos', 'rocky'] %} + {% set pxe_dir = '/var/lib/ironic/tftpboot/EFI/{{ kolla_base_distro }}' %} + {% endif %} +{% else %} + {% set pxe_dir = '/var/lib/ironic/tftpboot/pxelinux.cfg' %} +{% endif %} + {% set pxe_cfg = 'grub.cfg' if enable_ironic_pxe_uefi | bool else 'default' %} { diff --git a/ansible/roles/keystone/templates/wsgi-keystone.conf.j2 b/ansible/roles/keystone/templates/wsgi-keystone.conf.j2 index c9f3c00ad8..13de8ac88d 100644 --- a/ansible/roles/keystone/templates/wsgi-keystone.conf.j2 +++ b/ansible/roles/keystone/templates/wsgi-keystone.conf.j2 @@ -1,7 +1,7 @@ {% set keystone_log_dir = '/var/log/kolla/keystone' %} {% set binary_path = '/usr/bin' if keystone_install_type == 'binary' else '/var/lib/kolla/venv/bin' %} {% if keystone_enable_tls_backend | bool %} -{% if kolla_base_distro in ['centos'] %} +{% if kolla_base_distro in ['centos', 'rocky'] %} LoadModule ssl_module /usr/lib64/httpd/modules/mod_ssl.so {% else %} LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so diff --git a/ansible/roles/nova/templates/nova-api-wsgi.conf.j2 b/ansible/roles/nova/templates/nova-api-wsgi.conf.j2 index 798547cde0..3af29b9b82 100644 --- a/ansible/roles/nova/templates/nova-api-wsgi.conf.j2 +++ b/ansible/roles/nova/templates/nova-api-wsgi.conf.j2 @@ -1,7 +1,7 @@ {% set nova_log_dir = '/var/log/kolla/nova' %} {% set wsgi_directory = '/usr/bin' if nova_install_type == 'binary' else '/var/lib/kolla/venv/bin' %} {% if nova_enable_tls_backend | bool %} -{% if kolla_base_distro in ['centos'] %} +{% if kolla_base_distro in ['centos', 'rocky'] %} LoadModule ssl_module /usr/lib64/httpd/modules/mod_ssl.so {% else %} LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so diff --git a/ansible/roles/octavia/templates/octavia-wsgi.conf.j2 b/ansible/roles/octavia/templates/octavia-wsgi.conf.j2 index c0c0bb40de..85c4e5a851 100644 --- a/ansible/roles/octavia/templates/octavia-wsgi.conf.j2 +++ b/ansible/roles/octavia/templates/octavia-wsgi.conf.j2 @@ -1,6 +1,6 @@ {% set wsgi_directory = '/usr/bin' if octavia_install_type == 'binary' else '/var/lib/kolla/venv/bin' %} {% if octavia_enable_tls_backend | bool %} -{% if kolla_base_distro in ['centos'] %} +{% if kolla_base_distro in ['centos', 'rocky'] %} LoadModule ssl_module /usr/lib64/httpd/modules/mod_ssl.so {% else %} LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so diff --git a/ansible/roles/placement/templates/placement-api-wsgi.conf.j2 b/ansible/roles/placement/templates/placement-api-wsgi.conf.j2 index 2d99f8d12d..7dca409fed 100644 --- a/ansible/roles/placement/templates/placement-api-wsgi.conf.j2 +++ b/ansible/roles/placement/templates/placement-api-wsgi.conf.j2 @@ -1,7 +1,7 @@ {% set log_dir = '/var/log/kolla/placement' %} {% set wsgi_directory = '/usr/bin' if placement_install_type == 'binary' else '/var/lib/kolla/venv/bin' %} {% if placement_enable_tls_backend | bool %} -{% if kolla_base_distro in ['centos'] %} +{% if kolla_base_distro in ['centos', 'rocky'] %} LoadModule ssl_module /usr/lib64/httpd/modules/mod_ssl.so {% else %} LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so diff --git a/tests/templates/globals-default.j2 b/tests/templates/globals-default.j2 index 88632db725..77b4c27c81 100644 --- a/tests/templates/globals-default.j2 +++ b/tests/templates/globals-default.j2 @@ -137,10 +137,10 @@ kolla_enable_tls_external: "yes" kolla_enable_tls_internal: "yes" kolla_copy_ca_into_containers: "yes" kolla_enable_tls_backend: "yes" -{% if base_distro == "ubuntu" or base_distro == "debian" %} +{% if base_distro in ["debian", "ubuntu"] %} openstack_cacert: "/etc/ssl/certs/ca-certificates.crt" {% endif %} -{% if base_distro == "centos" %} +{% if base_distro in ["centos", "rocky"] %} openstack_cacert: "/etc/pki/tls/certs/ca-bundle.crt" {% endif %} kolla_admin_openrc_cacert: "{% raw %}{{ kolla_certificates_dir }}{% endraw %}/ca/root.crt"