|
| 1 | +--- |
| 2 | +# Copyright Red Hat, Inc. |
| 3 | +# All Rights Reserved. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 6 | +# not use this file except in compliance with the License. You may obtain |
| 7 | +# a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | +# License for the specific language governing permissions and limitations |
| 15 | +# under the License. |
| 16 | + |
| 17 | +- name: Install required RPM packages |
| 18 | + tags: |
| 19 | + - packages |
| 20 | + become: true |
| 21 | + ansible.builtin.package: |
| 22 | + name: |
| 23 | + - python3-pip |
| 24 | + - qemu-img |
| 25 | + - dosfstools |
| 26 | + - xfsprogs |
| 27 | + state: present |
| 28 | + |
| 29 | +- name: Install diskimage-builder in virtualenv |
| 30 | + tags: |
| 31 | + - packages |
| 32 | + ansible.builtin.pip: |
| 33 | + virtualenv_command: "python3 -m venv" |
| 34 | + virtualenv: "{{ cifmw_nat64_appliance_venv_dir }}" |
| 35 | + name: |
| 36 | + - diskimage-builder |
| 37 | + - setuptools |
| 38 | + |
| 39 | +- name: Copy files to cifmw_nat64_appliance_dir |
| 40 | + ansible.builtin.copy: |
| 41 | + src: "{{ item }}" |
| 42 | + dest: "{{ cifmw_nat64_appliance_workdir }}/{{ item }}" |
| 43 | + mode: preserve |
| 44 | + loop: |
| 45 | + - "elements/" |
| 46 | + - nat64-appliance.yaml |
| 47 | + |
| 48 | +- name: Clone edpm-image-builder (reset-bls-entries dib element) |
| 49 | + ansible.builtin.git: |
| 50 | + repo: https://github.com/openstack-k8s-operators/edpm-image-builder.git |
| 51 | + dest: "{{ cifmw_nat64_appliance_workdir }}/edpm-image-builder" |
| 52 | + version: main |
| 53 | + |
| 54 | +- name: Build the nat64-appliance image using DIB (with ci_script) |
| 55 | + when: cifmw_nat64_appliance_use_ci_script | bool |
| 56 | + ansible.builtin.include_tasks: build_with_ci_script.yml |
| 57 | + |
| 58 | +- name: Build the nat64-appliance image using DIB (with shell) |
| 59 | + when: not (cifmw_nat64_appliance_use_ci_script | bool) |
| 60 | + ansible.builtin.include_tasks: build_with_shell.yml |
0 commit comments