tripleo-ansible/tripleo_ansible/roles/tripleo-image-serve/tasks/main.yml

55 lines
1.4 KiB
YAML

---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# 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: ensure apache is installed
package:
name: httpd
state: present
- name: create image data directory
file:
state: directory
path: "{{ tripleo_image_data_dir }}/v2"
mode: 0755
owner: root
group: root
setype: httpd_sys_content_t
- name: create /v2/ response file
copy:
content: "{}"
dest: "{{ tripleo_image_data_dir }}/v2/index.json"
mode: 0644
owner: root
group: root
setype: httpd_sys_content_t
- name: Add listen line
lineinfile:
path: /etc/httpd/conf/httpd.conf
regexp: '^\s*Listen(.*)$'
line: '# Listen \1'
- name: manage /etc/httpd/conf.d/image-serve.conf
template:
src: image-serve.conf.j2
dest: /etc/httpd/conf.d/image-serve.conf
notify: Image-Serve | reload httpd
- name: force systemd to reread configs
meta: flush_handlers