--- # Copyright 2022, BBC R&D # # 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: Define skyline_lib_dir when it's not set when: skyline_lib_dir is not defined block: - name: Find the venv's python version ansible.builtin.command: >- {{ skyline_bin }}/{{ skyline_venv_python_executable }} -c 'import skyline_apiserver; print(skyline_apiserver.__file__)' changed_when: false register: _skyline_python_venv_details - name: Set python lib dir fact ansible.builtin.set_fact: skyline_lib_dir: "{{ _skyline_python_venv_details.stdout | dirname | dirname }}" - name: Create gunicorn config ansible.builtin.template: src: "gunicorn.py.j2" dest: "/etc/skyline/gunicorn.py" owner: "root" group: "{{ item.group | default(skyline_system_group_name) }}" mode: "0640" notify: - Restart skyline services - name: Create skyline configs openstack.config_template.config_template: src: "{{ item.src }}" dest: "{{ item.dest }}" owner: "root" group: "{{ item.group | default(skyline_system_group_name) }}" mode: "0640" config_overrides: "{{ item.config_overrides }}" config_type: "{{ item.config_type }}" loop: - src: "skyline.yaml.j2" dest: "/etc/skyline/skyline.yaml" config_overrides: "{{ skyline_skyline_yaml_overrides }}" config_type: "yaml" notify: - Restart skyline services - name: Get OpenStack endpoints ansible.builtin.command: >- openstack --os-cloud default endpoint list --format yaml --interface {{ skyline_interface }} delegate_to: "{{ skyline_service_setup_host }}" register: _endpoint_list run_once: true changed_when: false - name: Set endpoint fact ansible.builtin.set_fact: openstack_service_endpoints: "{{ _endpoint_list.stdout | from_yaml }}" - name: Importing web server configuration tasks ansible.builtin.import_tasks: skyline_apache.yml