aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2023-02-21 17:39:17 +0000
committerGerrit Code Review <review@openstack.org>2023-02-21 17:39:17 +0000
commit7bbf36cca0f77ebaa48b123f7f226a64065b74ff (patch)
treeae1c867da07d8ea594f9256da1422df95fc0268f /tests
parentc91513d3eb3bac1091a5ac625a7808d8a531c06c (diff)
parent5fe335d143edecff6b9708cd53c1bf5f2c95061f (diff)
downloadkolla-7bbf36cca0f77ebaa48b123f7f226a64065b74ff.tar.gz
kolla-7bbf36cca0f77ebaa48b123f7f226a64065b74ff.zip
Merge "CI: Additional disk followup"
Diffstat (limited to 'tests')
-rw-r--r--tests/playbooks/pre.yml148
-rw-r--r--tests/playbooks/run.yml3
2 files changed, 71 insertions, 80 deletions
diff --git a/tests/playbooks/pre.yml b/tests/playbooks/pre.yml
index 09b60ae34..5e4b525f2 100644
--- a/tests/playbooks/pre.yml
+++ b/tests/playbooks/pre.yml
@@ -18,6 +18,76 @@
path: "{{ kolla_build_logs_dir }}"
state: directory
+ # On RAX hosts, we have a small root partition and a large,
+ # unallocated ephemeral device attached at /dev/xvde
+ - name: Set ephemeral device if /dev/xvde exists
+ when: ansible_devices["xvde"] is defined
+ set_fact:
+ ephemeral_device: "/dev/xvde"
+
+ # On other providers, we have a device called "ephemeral0".
+ - name: Set ephemeral device by label
+ when: ephemeral_device is undefined
+ block:
+ - name: Get ephemeral0 device node
+ command: /sbin/blkid -L ephemeral0
+ register: ephemeral0
+ # rc !=0 is expected
+ failed_when: False
+ changed_when: False
+
+ - name: Set ephemeral device if LABEL exists
+ when: "ephemeral0.rc == 0"
+ set_fact:
+ ephemeral_device: "{{ ephemeral0.stdout }}"
+
+ - name: Configure additional disk (if available)
+ become: true
+ when: ephemeral_device is defined
+ block:
+ - name: Ensure ephemeral device is unmounted
+ ansible.posix.mount:
+ name: "{{ ephemeral_device }}"
+ state: "{{ item }}"
+ loop:
+ - unmounted
+ - absent
+
+ - name: Get existing partitions
+ community.general.parted:
+ device: "{{ ephemeral_device }}"
+ unit: MiB
+ state: info
+ register: ephemeral_partitions
+
+ - name: Remove any existing partitions
+ community.general.parted:
+ device: "{{ ephemeral_device }}"
+ number: "{{ item.num }}"
+ state: absent
+ loop: "{{ ephemeral_partitions.partitions }}"
+
+ - name: Create filesystem on additional partition
+ community.general.filesystem:
+ fstype: ext4
+ dev: "{{ ephemeral_device }}"
+ opts: "-L kolla"
+
+ - name: Ensure /var/lib/docker mountpoint is created
+ ansible.builtin.file:
+ path: "/var/lib/docker"
+ owner: root
+ group: root
+ state: directory
+ mode: 0755
+
+ - name: Mount additional filesystem
+ ansible.posix.mount:
+ path: "/var/lib/docker"
+ src: "LABEL=kolla"
+ fstype: ext4
+ state: mounted
+
- name: Install Python3 pip and setuptools
package:
name:
@@ -115,81 +185,3 @@
path: /run/docker.sock
mode: 0666
become: true
-
- # On RAX hosts, we have a small root partition and a large,
- # unallocated ephemeral device attached at /dev/xvde
- - name: Set ephemeral device if /dev/xvde exists
- when: ansible_devices["xvde"] is defined
- set_fact:
- ephemeral_device: "/dev/xvde"
-
- # On other providers, we have a device called "ephemeral0".
- - name: Set ephemeral device by label
- when: ephemeral_device is undefined
- block:
- - name: Get ephemeral0 device node
- command: /sbin/blkid -L ephemeral0
- register: ephemeral0
- # rc !=0 is expected
- failed_when: False
- changed_when: False
-
- - name: Set ephemeral device if LABEL exists
- when: "ephemeral0.rc == 0"
- set_fact:
- ephemeral_device: "{{ ephemeral0.stdout }}"
-
- - name: Configure additional disk (if available)
- become: true
- when: ephemeral_device is defined
- block:
- - name: Ensure ephemeral device is unmounted
- ansible.posix.mount:
- name: "{{ ephemeral_device }}"
- state: "{{ item }}"
- loop:
- - unmounted
- - absent
-
- - name: Get existing partitions
- community.general.parted:
- device: "{{ ephemeral_device }}"
- unit: MiB
- state: info
- register: ephemeral_partitions
-
- - name: Remove any existing partitions
- community.general.parted:
- device: "{{ ephemeral_device }}"
- number: "{{ item.num }}"
- state: absent
- loop: "{{ ephemeral_partitions.partitions }}"
-
- - name: Create filesystem on additional partition
- community.general.filesystem:
- fstype: ext4
- dev: "{{ ephemeral_device }}"
- opts: "-L kolla"
-
- - name: Ensure /mnt/kolla mountpoint is created
- ansible.builtin.file:
- path: "/mnt/kolla"
- owner: root
- group: root
- state: directory
- mode: 0755
-
- - name: Mount additional filesystem
- ansible.posix.mount:
- path: "/mnt/kolla"
- src: "LABEL=kolla"
- fstype: ext4
- state: present
-
- - name: Ensure /mnt/kolla/work_dir directory is created
- ansible.builtin.file:
- path: "/mnt/kolla/work_dir"
- owner: root
- group: root
- state: directory
- mode: 0777
diff --git a/tests/playbooks/run.yml b/tests/playbooks/run.yml
index 7299b768a..7e0b48695 100644
--- a/tests/playbooks/run.yml
+++ b/tests/playbooks/run.yml
@@ -4,7 +4,6 @@
- ../vars/zuul.yml
vars:
tag_suffix: "{{ '-aarch64' if ansible_architecture == 'aarch64' else '' }}"
- kolla_disk: "{{ true if ephemeral_device is defined else false }}"
kolla_build_config:
DEFAULT:
debug: true
@@ -46,4 +45,4 @@
command: "{{ virtualenv_path }}/bin/kolla-build --template-only --work-dir {{ kolla_build_logs_dir }}/work_dir"
- name: Run kolla-build
- command: "{{ virtualenv_path }}/bin/kolla-build {% if kolla_disk %}--work-dir /mnt/kolla/work_dir{% endif %}"
+ command: "{{ virtualenv_path }}/bin/kolla-build"