Skip to content
Snippets Groups Projects
  • Michal Arbet's avatar
    c5f3f23e
    [podman] Fix cross dependency image build · c5f3f23e
    Michal Arbet authored
    When the kolla-ansible project has a cross dependency on
    the kolla project, CI have to build an image from that change
    locally. However, Podman refuses to push to localhost, so it is
    necessary to set the local repo as insecure for the test.
    
    Change-Id: I786b22ff0cd581f90ba4bec08842651a6509a745
    c5f3f23e
    History
    [podman] Fix cross dependency image build
    Michal Arbet authored
    When the kolla-ansible project has a cross dependency on
    the kolla project, CI have to build an image from that change
    locally. However, Podman refuses to push to localhost, so it is
    necessary to set the local repo as insecure for the test.
    
    Change-Id: I786b22ff0cd581f90ba4bec08842651a6509a745
run.yml 31.31 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'] }}"
        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"

    - 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 }}"

- 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
        # buster see https://github.com/docker/for-linux/issues/711.
        push: "{{ base_distro != 'debian' }}"
        base: "{{ base_distro }}"
        registry: "primary:4000"
        namespace: lokolla
        tag: "{{ build_image_tag }}"
        template_override: /etc/kolla/template_overrides.j2
        # NOTE(yoctozepto): to avoid issues with IPv6 not enabled in the docker daemon
        # and since we don't need isolated networks here, use host networking
        network_mode: host
  tasks:
    - name: detect whether need build images
      set_fact: