diff --git a/tasks/install-apt.yml b/tasks/install-apt.yml index 4853905..6bc3eee 100644 --- a/tasks/install-apt.yml +++ b/tasks/install-apt.yml @@ -39,6 +39,8 @@ retries: 5 delay: 2 with_items: "{{ zaqar_apt_packages }}" + when: + - item != '' tags: - zaqar-apt-packages diff --git a/tasks/zaqar_apache.yml b/tasks/zaqar_apache.yml index c51108c..078d45e 100644 --- a/tasks/zaqar_apache.yml +++ b/tasks/zaqar_apache.yml @@ -25,12 +25,15 @@ tags: - zaqar-httpd -- name: Add zaqar apache configuration file +- name: Add zaqar apache configuration files template: - src: "zaqar-httpd.conf.j2" - dest: "/etc/apache2/sites-available/zaqar-httpd.conf" + src: "{{ item.src }}" + dest: "{{ item.dest }}" owner: "root" group: "root" + with_items: + - { src: "zaqar_apache_ports.conf.j2", dest: "/etc/apache2/ports.conf" } + - { src: "zaqar-httpd.conf.j2", dest: "/etc/apache2/sites-available/zaqar-httpd.conf" } notify: - Restart Apache tags: diff --git a/templates/zaqar-httpd.conf.j2 b/templates/zaqar-httpd.conf.j2 index 9ffc185..b630bba 100644 --- a/templates/zaqar-httpd.conf.j2 +++ b/templates/zaqar-httpd.conf.j2 @@ -1,7 +1,5 @@ # {{ ansible_managed }} -Listen {{ zaqar_api_bind_port }} - WSGIDaemonProcess zaqar-api user={{ zaqar_system_user_name }} group={{ zaqar_system_group_name }} processes={{ zaqar_wsgi_processes }} threads={{ zaqar_wsgi_threads }} display-name=%{GROUP} WSGIProcessGroup zaqar-api diff --git a/templates/zaqar_apache_ports.conf.j2 b/templates/zaqar_apache_ports.conf.j2 new file mode 100644 index 0000000..88c0549 --- /dev/null +++ b/templates/zaqar_apache_ports.conf.j2 @@ -0,0 +1,3 @@ +# {{ ansible_managed }} + +Listen {{ zaqar_api_bind_port }} diff --git a/tests/test-install-zaqar.yml b/tests/test-install-zaqar.yml index 0dbeab2..efb624d 100644 --- a/tests/test-install-zaqar.yml +++ b/tests/test-install-zaqar.yml @@ -19,7 +19,7 @@ roles: - role: "{{ rolename | basename }}" zaqar_developer_mode: true - zaqar_install_nginx: true + zaqar_install_apache: true zaqar_mgmt_db_connection_string: 'sqlite:////tmp/zaqar.db' external_lb_vip_address: 10.100.100.2 internal_lb_vip_address: 10.100.100.2 diff --git a/tests/test-zaqar-functional.yml b/tests/test-zaqar-functional.yml new file mode 100644 index 0000000..d17f8aa --- /dev/null +++ b/tests/test-zaqar-functional.yml @@ -0,0 +1,27 @@ +--- +# Copyright 2015, 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. + +- name: Playbook for functional testing of zaqar + hosts: zaqar_all + user: root + gather_facts: false + tasks: + - name: Install testing pip packages + pip: + name: "httplib2" + - name: Check the zaqar-api + uri: + url: "http://localhost:8888" + status_code: 401 diff --git a/tests/test.yml b/tests/test.yml index a9b8841..333c3ca 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -29,4 +29,7 @@ - include: test-install-keystone.yml # Install Zaqar -- include: test-install-zaqar.yml \ No newline at end of file +- include: test-install-zaqar.yml + +# Test Zaqar +- include: test-zaqar-functional.yml \ No newline at end of file diff --git a/vars/debian.yml b/vars/debian.yml index 13c54e1..7811b4e 100644 --- a/vars/debian.yml +++ b/vars/debian.yml @@ -23,6 +23,6 @@ zaqar_apt_packages: - python2.7-dev - python-dev - zlib1g-dev - - apache2 - - nginx - - libapache2-mod-wsgi + - "{% if zaqar_install_apache %}apache2{% endif %}" + - "{% if zaqar_install_apache %}libapache2-mod-wsgi{% endif %}" + - "{% if zaqar_install_nginx %}nginx{% endif %}"