Files
openstack-ansible-os_skyline/tasks/skyline_apache.yml
Dmitriy Rabotyagov 71f2556682 Use standalone httpd role
In order to unify approach for managing Apache Web server, we migrate
to usage of standalone `httpd` role instead of managing apache
separately inside service roles.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/939307
Change-Id: Iea11943229aa432704868ed008ae2470b08d6588
2025-01-15 08:10:47 +00:00

49 lines
1.9 KiB
YAML

---
# Copyright 2024, Cleura AB
#
# 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: Including HTTPD role
ansible.builtin.import_role:
name: httpd
vars:
httpd_extra_modules:
- name: "proxy_http"
state: "present"
httpd_vhosts:
- name: skyline
address: "{{ skyline_bind_address }}"
port: "{{ skyline_service_port }}"
document_root: "{{ skyline_lib_static_files }}"
server_name: "{{ skyline_server_name }}"
directories:
- path: "{{ skyline_lib_static_files }}"
options:
- '<FilesMatch "\.(html|css|js|jpg|jpeg|png|gif|ico|svg|eot|otf|woff|woff2|ttf)$">'
- ' Header set Cache-Control "max-age=86400, public"'
- '</FilesMatch>'
- RewriteEngine On
- RewriteCond %{REQUEST_URI} !^/index.html$
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_URI} !\.(html|css|js|jpg|jpeg|png|gif|ico|svg|eot|otf|woff|woff2|ttf)$ [NC]
- RewriteRule . /index.html [L]
- Require all granted
locations: "{{ _skyline_default_locations + _skyline_service_locations }}"
options: >-
{{
('https' in _endpoint_list.stdout | from_yaml | map(attribute='URL') | map('urlsplit') | map(attribute='scheme')) | ternary(
_skyline_proxy_ssl_options | select(), []
)
}}