| --- |
| # ============LICENSE_START======================================================= |
| # Copyright (C) 2019 The Nordix Foundation. 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. |
| # |
| # SPDX-License-Identifier: Apache-2.0 |
| # ============LICENSE_END========================================================= |
| |
| - name: Set kolla-ansible path |
| set_fact: |
| kolla_ansible_path: "{{ engine_cache }}/repos/kolla-ansible" |
| |
| - name: Load execution mode variables |
| include_vars: "{{ execution_mode }}.yaml" |
| |
| # clone kolla-ansible repo from internet when running in online mode |
| - block: |
| - name: Remove existing files and directories |
| file: |
| path: "{{ kolla_ansible_path }}" |
| state: absent |
| |
| - name: Clone kolla-ansible repository and checkout '{{ kolla_ansible_version }}' |
| git: |
| repo: "{{ kolla_ansible_git_url }}" |
| dest: "{{ kolla_ansible_path }}" |
| version: "{{ kolla_ansible_version }}" |
| force: true |
| environment: "{{ idf.proxy_settings | default({}) }}" |
| |
| - name: Install kolla-ansible requirements |
| pip: |
| requirements: "{{ kolla_ansible_path }}/requirements.txt" |
| virtualenv: "{{ engine_venv }}" |
| become: true |
| when: execution_mode == 'online-deployment' |
| |
| - name: Copy globals.yml |
| copy: |
| src: "{{ kolla_ansible_path }}/etc/kolla/globals.yml" |
| dest: "{{ config_path }}/globals.yml" |
| |
| - name: Set openstack version in globals.yml |
| lineinfile: |
| path: "{{ config_path }}/globals.yml" |
| regexp: '^openstack_release:.*' |
| line: "openstack_release: {{ openstack_version }}" |
| |
| - name: Copy passwords.yml |
| copy: |
| src: "{{ kolla_ansible_path }}/etc/kolla/passwords.yml" |
| dest: "{{ config_path }}/passwords.yml" |
| |
| - name: Get node name from IDF for group controller |
| set_fact: |
| node_name: "{{ item.key }}" |
| with_dict: "{{ idf.kolla.nodes_roles }}" |
| when: "'controller' in item.value" |
| |
| - name: Get node "{{ node_name }}" from PDF |
| set_fact: |
| node: "{{ nodes | selectattr('name', 'equalto', node_name) | first }}" |
| |
| - name: Fetch mgmt interface address |
| set_fact: |
| os_kolla_internal_vip_address: "{{ node.interfaces[idf.net_config.mgmt.interface].address }}" |
| |
| - name: Assign distro specific variables |
| include_vars: |
| file: "{{ distro }}.yml" |
| |
| - name: Populate extra variables |
| template: |
| src: kolla-ansible-extra-vars.j2 |
| dest: "{{ config_path }}/kolla-ansible-extra-vars.yml" |
| |
| - name: Place custom keystone configuration |
| template: |
| src: keystone.conf.j2 |
| dest: "{{ config_path }}/keystone.conf" |
| |
| - name: Place custom ceph configuration |
| template: |
| src: ceph.conf.j2 |
| dest: "{{ config_path }}/ceph.conf" |
| |
| - name: Ensure neutron custom config directory exists |
| file: |
| path: "{{ config_path }}/neutron" |
| state: directory |
| |
| - name: Place custom neutron configuration |
| template: |
| src: ml2_conf.ini.j2 |
| dest: "{{ config_path }}/neutron/ml2_conf.ini" |
| |
| - name: Generate kolla passwords |
| command: "{{ kolla_ansible_path }}/tools/generate_passwords.py -p {{ config_path }}/passwords.yml" |
| changed_when: false |
| |
| # vim: set ts=2 sw=2 expandtab: |