Skip to content

Commit a940bab

Browse files
mnasiadkaAlex-Welsh
authored andcommitted
CI: Rework reconfigure.sh to Ansible role
Change-Id: Ibe21c342ae4c4d79c16d4058f90f5763e94d231c Signed-off-by: Michal Nasiadka <[email protected]>
1 parent 2034cfb commit a940bab

File tree

3 files changed

+65
-35
lines changed

3 files changed

+65
-35
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
- name: Run kolla-ansible prechecks
3+
ansible.builtin.shell:
4+
cmd: >
5+
. {{ kolla_ansible_venv_path }}/bin/activate &&
6+
kolla-ansible prechecks
7+
-i /etc/kolla/inventory
8+
-vvv
9+
>/tmp/logs/ansible/reconfigure-prechecks 2>&1
10+
11+
- name: Remove OVN DB containers and volumes on primary to test recreation (docker)
12+
become: true
13+
when:
14+
- scenario == 'ovn'
15+
- container_engine == 'docker'
16+
vars:
17+
ovn_db_services:
18+
- "ovn_nb_db"
19+
- "ovn_sb_db"
20+
block:
21+
- name: Remove OVN DB containers
22+
community.docker.docker_container:
23+
name: "{{ item }}"
24+
state: absent
25+
loop: "{{ ovn_db_services }}"
26+
27+
- name: Remove OVN DB volumes
28+
community.docker.docker_volume:
29+
name: "{{ item }}"
30+
state: absent
31+
loop: "{{ ovn_db_services }}"
32+
33+
- name: Remove OVN DB containers and volumes on primary to test recreation (podman)
34+
become: true
35+
when:
36+
- scenario == 'ovn'
37+
- container_engine == 'podman'
38+
vars:
39+
ovn_db_services:
40+
- "ovn_nb_db"
41+
- "ovn_sb_db"
42+
block:
43+
- name: Remove OVN DB containers
44+
containers.podman.podman_container:
45+
name: "{{ item }}"
46+
state: absent
47+
loop: "{{ ovn_db_services }}"
48+
49+
- name: Remove OVN DB volumes
50+
containers.podman.podman_volume:
51+
name: "{{ item }}"
52+
state: absent
53+
loop: "{{ ovn_db_services }}"
54+
55+
- name: Run kolla-ansible reconfigure
56+
ansible.builtin.shell:
57+
cmd: >
58+
. {{ kolla_ansible_venv_path }}/bin/activate &&
59+
kolla-ansible reconfigure
60+
-i /etc/kolla/inventory
61+
-vvv
62+
>/tmp/logs/ansible/reconfigure 2>&1
63+

tests/reconfigure.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

tests/run.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -807,15 +807,8 @@
807807
- hosts: primary
808808
any_errors_fatal: true
809809
tasks:
810-
- name: Run reconfigure.sh script
811-
script:
812-
cmd: reconfigure.sh
813-
executable: /bin/bash
814-
chdir: "{{ kolla_ansible_src_dir }}"
815-
environment:
816-
KOLLA_ANSIBLE_VENV_PATH: "{{ kolla_ansible_venv_path }}"
817-
SCENARIO: "{{ scenario }}"
818-
CONTAINER_ENGINE: "{{ container_engine }}"
810+
- import_role:
811+
name: kolla-ansible-reconfigure
819812
when:
820813
- not is_upgrade
821814
- scenario != "bifrost"

0 commit comments

Comments
 (0)