Skip to content
Snippets Groups Projects
run.yml 31.39 KiB
---
- hosts: all
  any_errors_fatal: true
  tasks:
    # NOTE(yoctozepto): ensure we pick up fact changes from pre
    - name: Refresh facts
      setup:

    # NOTE(yoctozepto): setting vars as facts for all to have them around in all the plays
    - name: set facts for commonly used variables
      vars:
        # NOTE(yoctozepto): needed here to use in other facts too
        openstack_core_enabled: "{{ scenario not in ['bifrost', 'mariadb', 'prometheus-opensearch', 'venus'] }}"
      set_fact:
        kolla_inventory_path: "/etc/kolla/inventory"
        logs_dir: "/tmp/logs"
        ansible_collection_kolla_src_dir: "{{ ansible_env.PWD }}/src/{{ zuul.project.canonical_hostname }}/openstack/ansible-collection-kolla"
        kolla_ansible_src_dir: "{{ ansible_env.PWD }}/src/{{ zuul.project.canonical_hostname }}/openstack/kolla-ansible"
        kolla_ansible_local_src_dir: "{{ zuul.executor.work_root }}/src/{{ zuul.project.canonical_hostname }}/openstack/kolla-ansible"
        infra_dockerhub_mirror: "http://{{ zuul_site_mirror_fqdn }}:8082/"
        need_build_image: "{{ kolla_build_images | default(false) }}"
        build_image_tag: "change_{{ zuul.change | default('none') }}"
        openstack_core_enabled: "{{ openstack_core_enabled }}"
        openstack_core_tested: "{{ scenario in ['core', 'cephadm', 'zun', 'cells', 'swift', 'ovn', 'lets-encrypt'] }}"
        dashboard_enabled: "{{ openstack_core_enabled }}"
        upper_constraints_file: "{{ ansible_env.HOME }}/src/opendev.org/openstack/requirements/upper-constraints.txt"
        docker_image_tag_suffix: "{{ '-aarch64' if ansible_architecture == 'aarch64' else '' }}"
        kolla_ansible_venv_path: "{{ ansible_env.HOME }}/kolla-ansible-venv"
        kolla_internal_fqdn: "kolla.example.com"

    - name: Install dig for Designate testing
      become: true
      package:
        name: "{{ 'bind-utils' if ansible_os_family == 'RedHat' else 'dnsutils' }}"
      when: scenario == 'magnum'

    - name: Install xfsprogs package for Swift filesystems
      become: true
      package:
        name: xfsprogs
      when: scenario == 'swift'

    - name: Prepare disks for a storage service
      script: "setup_disks.sh {{ disk_type }}"
      when: scenario in ['cephadm', 'zun', 'swift']
      become: true
      vars:
        disk_type: "{{ 'ceph-lvm' if scenario in ['cephadm'] else scenario }}"

    - name: Update /etc/hosts with internal API FQDN
      blockinfile:
        dest: /etc/hosts
        marker: "# {mark} ANSIBLE GENERATED INTERNAL API FQDN"
        block: |
          {{ kolla_internal_vip_address }} {{ kolla_internal_fqdn }}
          192.0.2.1 pebble
      become: True
      when:
        - scenario == "lets-encrypt"


- hosts: primary
  any_errors_fatal: true
  vars:
    kolla_build_config:
      DEFAULT:
        profile: gate
        logs_dir: /tmp/logs/build
        quiet: true
        # NOTE(yoctozepto): we cannot build and push at the same time on debian