From 5e702329d55f7808b68aa7fe5899ad2271a43373 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Wed, 10 Mar 2021 12:16:38 +0000 Subject: [PATCH] Remove references to unsupported operating systems All references to Gentoo, SUSE, Debian stretch and Centos-7 are removed. Conditional tasks, ternary operators and variables are simplified where possible OS specific variables files are generalised where possible Change-Id: I31c5e6cde00cdb7addcc0cb4b1c7a13529ce1e60 --- meta/main.yml | 9 ++-- tasks/horizon_apache.yml | 36 +------------- tasks/horizon_install_source.yml | 12 ++--- vars/redhat-7.yml | 63 ------------------------- vars/{redhat-8.yml => redhat.yml} | 0 vars/suse.yml | 78 ------------------------------- 6 files changed, 8 insertions(+), 190 deletions(-) delete mode 100644 vars/redhat-7.yml rename vars/{redhat-8.yml => redhat.yml} (100%) delete mode 100644 vars/suse.yml diff --git a/meta/main.yml b/meta/main.yml index 38714fc5..2e18c89c 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -22,17 +22,14 @@ galaxy_info: platforms: - name: Debian versions: - - stretch + - buster - name: Ubuntu versions: - - xenial - bionic + - focal - name: EL versions: - - 7 - - name: opensuse - versions: - - all + - 8 categories: - cloud - python diff --git a/tasks/horizon_apache.yml b/tasks/horizon_apache.yml index 83e07943..5277f002 100644 --- a/tasks/horizon_apache.yml +++ b/tasks/horizon_apache.yml @@ -14,7 +14,6 @@ # limitations under the License. # NOTE(hwoarang): Module enable/disable process is only functional on Debian -# and SUSE based systems. - name: Enable apache2 modules apache2_module: name: "{{ item.name }}" @@ -23,7 +22,7 @@ with_items: - "{{ horizon_apache_modules }}" when: - - ansible_facts['pkg_mgr'] in ['apt', 'zypper'] + - ansible_facts['pkg_mgr'] == 'apt' notify: Restart apache2 - name: Drop apache2 configs @@ -42,37 +41,6 @@ with_items: "{{ horizon_apache_default_sites }}" notify: Restart apache2 -# NOTE(hwoarang) Default openSUSE apache configuration ships -# with a configuration in /etc/apache2/httpd.conf -# so we need to get rid of it to allow all the symlinks in the -# root filesystem that horizon requires -# TODO: Can this be improved somehow? -- block: - - name: Tag beginning of main apache2 directory configuration (SUSE) - lineinfile: - dest: "{{ horizon_apache_conf }}" - insertbefore: '^' - line: "# BEGIN ANSIBLE MANAGED BLOCK" - state: present - notify: Restart apache2 - - - name: Tag end of main apache2 directory configuration (SUSE) - lineinfile: - dest: "{{ horizon_apache_conf }}" - insertafter: '^' - line: "# END ANSIBLE MANAGED BLOCK" - state: present - notify: Restart apache2 - - - name: Remove default apache2 configuration for root directory (SUSE) - blockinfile: - dest: "{{ horizon_apache_conf }}" - marker: "# {mark} ANSIBLE MANAGED BLOCK" - content: "" - notify: Restart apache2 - - when: ansible_facts['pkg_mgr'] == 'zypper' - - name: Enable Horizon Site file: src: "{{ horizon_apache_site_available }}" @@ -108,7 +76,7 @@ - name: Remove Listen from Apache config lineinfile: dest: "{{ horizon_apache_security_conf }}" - regexp: "{{ (ansible_facts['pkg_mgr'] == 'zypper') | ternary('^(Include.*listen\\.conf)', '^(Listen.*)') }}" + regexp: '^(Listen.*)' backrefs: yes line: '#\1' notify: Restart apache2 diff --git a/tasks/horizon_install_source.yml b/tasks/horizon_install_source.yml index a7292f45..76998a79 100644 --- a/tasks/horizon_install_source.yml +++ b/tasks/horizon_install_source.yml @@ -23,7 +23,7 @@ with_items: - { path: "/etc/pki/tls/certs", owner: "root", group: "root" } - { path: "/etc/pki/tls/private", owner: "root", group: "root" } - when: ansible_facts['pkg_mgr'] in ['yum', 'dnf'] + when: ansible_facts['pkg_mgr'] == 'dnf' - name: Create system links file: @@ -33,7 +33,7 @@ with_items: - { src: "/etc/pki/tls/certs", dest: "/etc/ssl/certs" } - { src: "/etc/pki/tls/private", dest: "/etc/ssl/private" } - when: ansible_facts['pkg_mgr'] in ['yum', 'dnf'] + when: ansible_facts['pkg_mgr'] == 'dnf' # NOTE(jrosser) # horizon appears in u-c as is it used as a library for the horizon plugins @@ -175,10 +175,4 @@ with_items: "{{ found_panels.files }}" notify: - Compile messages - - Restart apache2 - -- name: Register wsgi module - shell: "{{ horizon_bin }}/mod_wsgi-express install-module > /etc/httpd/conf.modules.d/02-wsgi.conf" - when: ansible_facts['os_family'] | lower == 'redhat' and ansible_facts['distribution_major_version'] is version('7', '=') - notify: - - Restart apache2 + - Restart apache2 \ No newline at end of file diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml deleted file mode 100644 index 22e97270..00000000 --- a/vars/redhat-7.yml +++ /dev/null @@ -1,63 +0,0 @@ ---- -# Copyright 2014, Rackspace US, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -horizon_system_service_name: httpd - -horizon_devel_distro_packages: - - git - - libxslt-devel - - openssl - - openssl-libs - - httpd-devel - - pcre-devel - -horizon_distro_packages: - - cronie - - cronie-anacron - - gettext - - httpd - - httpd-tools - - mod_ssl - - which - -horizon_service_pip_packages: - - mod-wsgi - -horizon_service_distro_packages: - - openstack-designate-ui - - openstack-heat-ui - - openstack-ironic-ui - - openstack-magnum-ui - - openstack-manila-ui - - openstack-sahara-ui - - openstack-trove-ui - - openstack-octavia-ui - - python-django-horizon - - python-memcached - -horizon_apache_conf: "/etc/httpd/conf/httpd.conf" -horizon_apache_security_conf: "{{ horizon_apache_conf }}" - -horizon_apache_configs: - - { src: "horizon_apache_ports.conf.j2", dest: "/etc/httpd/conf.d/ports.conf", owner: "root", group: "root" } - - { src: "openstack_dashboard.conf.j2", dest: "/etc/httpd/conf.d/openstack-dashboard.conf", owner: "root", group: "root" } - -horizon_apache_default_sites: - - "/etc/httpd/conf.d/userdir.conf" - - "/etc/httpd/conf.d/welcome.conf" - - "/etc/httpd/conf.d/ssl.conf" - -_horizon_lib_dir: "/usr/share/openstack-dashboard" -horizon_dashboard_panel_dir: "{{ _horizon_lib_dir }}/openstack_dashboard/local/enabled" diff --git a/vars/redhat-8.yml b/vars/redhat.yml similarity index 100% rename from vars/redhat-8.yml rename to vars/redhat.yml diff --git a/vars/suse.yml b/vars/suse.yml deleted file mode 100644 index ed12d9e2..00000000 --- a/vars/suse.yml +++ /dev/null @@ -1,78 +0,0 @@ ---- -# Copyright 2014, Rackspace US, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -horizon_system_service_name: apache2 - -horizon_devel_distro_packages: - - git-core - - libxslt-devel - - openssl - - libopenssl-devel - - pcre-devel - -horizon_distro_packages: - - apache2 - - apache2-utils - - apache2-mod_wsgi - - cronie - - cronie-anacron - - gettext - - which - -horizon_service_distro_packages: - - openstack-horizon-plugin-designate-ui - - openstack-horizon-plugin-gbp-ui - - openstack-horizon-plugin-ironic-ui - - openstack-horizon-plugin-magnum-ui - - openstack-horizon-plugin-manila-ui - - openstack-horizon-plugin-monasca-ui - - openstack-horizon-plugin-neutron-vpnaas-ui - - openstack-horizon-plugin-sahara-ui - - openstack-horizon-plugin-trove-ui - - python-horizon - - python-memcached - -# SUSE does not currently have packages for the following dashboards -horizon_enable_heat_ui: False -horizon_enable_octavia_ui: False - -horizon_apache_conf: "/etc/apache2/httpd.conf" -horizon_apache_security_conf: "{{ horizon_apache_conf }}" - -horizon_apache_configs: - - { src: "horizon_apache_ports.conf.j2", dest: "/etc/apache2/conf.d/ports.conf", owner: "root", group: "root" } - - { src: "openstack_dashboard.conf.j2", dest: "/etc/apache2/conf.d/openstack-dashboard.conf", owner: "root", group: "root" } - -horizon_apache_default_sites: - - "/etc/apache2/conf.d/gitweb.conf" - -horizon_apache_modules: - - name: "authz_host" - state: "present" - - name: "access_compat" - state: "present" - - name: "version" - state: "present" - - name: "ssl" - state: "present" - - name: "wsgi" - state: "present" - - name: "rewrite" - state: "present" - - name: "headers" - state: "present" - -_horizon_lib_dir: "/srv/www/openstack-dashboard" -horizon_dashboard_panel_dir: "{{ _horizon_lib_dir }}/openstack_dashboard/enabled"