diff --git a/tasks/aodh_apache.yml b/tasks/aodh_apache.yml index 33451ad..8b6ffbb 100644 --- a/tasks/aodh_apache.yml +++ b/tasks/aodh_apache.yml @@ -14,6 +14,20 @@ # See the License for the specific language governing permissions and # limitations under the License. +# NOTE(hwoarang) default openSUSE apache2 installation is missing +# some required modules so enable them here. This can possibly be +# extended to other distributions if necessary. +- name: Enable required apache2 modules (SUSE) + apache2_module: + name: "{{ item.name }}" + state: "{{ item.state }}" + with_items: "{{ aodh_apache_modules }}" + when: + - ansible_pkg_mgr == 'zypper' + - aodh_apache_modules is defined + notify: + - Restart web server + - name: Drop apache2 virtual host and ports file template: src: "{{ item.src }}" diff --git a/tasks/aodh_install.yml b/tasks/aodh_install.yml index 710834b..d204bb3 100644 --- a/tasks/aodh_install.yml +++ b/tasks/aodh_install.yml @@ -17,7 +17,7 @@ package: name: "{{ item }}" state: "{{ aodh_package_state }}" - update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}" + update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}" cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}" register: install_packages until: install_packages|success @@ -29,7 +29,7 @@ package: name: "{{ item }}" state: "{{ aodh_package_state }}" - update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}" + update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}" cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}" register: install_packages until: install_packages|success diff --git a/vars/suse-42.yml b/vars/suse-42.yml new file mode 100644 index 0000000..1463554 --- /dev/null +++ b/vars/suse-42.yml @@ -0,0 +1,50 @@ +--- +# Copyright 2016, Rackspace US, Inc. +# Copyright 2017, SUSE LINUX GmbH. +# +# 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. + +# Common packages +aodh_distro_packages: + - rpcbind + - apache2 + - apache2-utils + - apache2-mod_wsgi + - libffi-devel + - libopenssl-devel + - libxml2-devel + - libxslt-devel + - which + +aodh_test_distro_packages: + - git-core + +aodh_system_service_name: apache2 + +aodh_apache_config: + - { src: "aodh-ports.conf.j2", dest: "/etc/apache2/conf.d/ports.conf" } + - { src: "aodh-httpd.conf.j2", dest: "/etc/apache2/conf.d/aodh-httpd.conf" } + +aodh_apache_default_sites: + - "/etc/apache2/conf.d/gitweb.conf" + +aodh_apache_conf: "/etc/apache2/httpd.conf" +aodh_apache_security_conf: "{{ aodh_apache_conf }}" + +aodh_apache_modules: + - name: "authz_host" + state: "present" + - name: "access_compat" + state: "present" + - name: "version" + state: "present"