Cleanup test-bifrost.yaml

Remove variables that can be calculated, move global variables like
testing to the top level. Remove collecting information that should
rather be collected by CI jobs themselves.

Change-Id: Ib73a09529c8ad1640db4542d68ea3f76d6c7ea24
This commit is contained in:
Dmitry Tantsur 2020-09-17 12:41:39 +02:00
parent 27521c77c4
commit 20863aa734
4 changed files with 12 additions and 29 deletions

View File

@ -12,10 +12,12 @@ ssh_public_key_path: "{{ lookup('env', 'HOME') }}/.ssh/id_rsa.pub"
# TODO(TheJulia): Remove this default.
node_default_network_interface: eth0
testing: false
# Basic networking defaults
# TODO(TheJulia): Require these to be supplied some other way.
ipv4_subnet_mask: 255.255.255.0
ipv4_gateway: 192.168.1.1
ipv4_gateway: "{{ '192.168.122.1' if testing | bool else '192.168.1.1' }}"
ipv4_nameserver: 8.8.8.8
network_mtu: 1500

View File

@ -1,7 +1,9 @@
---
node_ssh_pause: 10
wait_timeout: 900
multinode_testing: false
inventory_dhcp: false
multinode_testing: "{{ inventory_dhcp | bool }}"
# Ensure that Ansible is using python interpreter and dependencies inside the bifrost virtual environment
bifrost_venv_dir: "{{ lookup('env', 'VENV') or '/opt/stack/bifrost' }}"

View File

@ -10,17 +10,10 @@
set_fact:
baremetal_json_file: "/tmp/baremetal.json"
when: baremetal_json_file is not defined
- name: "Set ci_testing flag if running in the CI"
- name: "Set variables if running in the CI"
set_fact:
ci_testing: true
copy_from_local_path: true
git_url_root: "{{ lookup('env', 'WORKSPACE') }}"
when: lookup('env', 'ZUUL_BRANCH') | length > 0
- name: "Collect process list if running in OpenStack CI"
command: ps aux
when: ci_testing | default(false)| bool
- name: "Collect list of listening network sockets if running in OpenStack CI"
shell: netstat -apn|grep LISTEN # noqa 306
when: ci_testing | default(false)| bool
roles:
- role: bifrost-create-vm-nodes

View File

@ -12,15 +12,15 @@
become: no
gather_facts: yes
pre_tasks:
- name: "Set ci_testing and other variables if it appears we are running in upstream OpenStack CI"
- name: "Set testing to true"
set_fact:
ci_testing: true
testing: true
- name: "Set variables if running in the CI"
set_fact:
cirros_deploy_image_upstream_url: file:///opt/cache/files/cirros-0.5.1-x86_64-disk.img
copy_from_local_path: true
git_url_root: "{{ lookup('env', 'WORKSPACE') }}"
when: lookup('env', 'ZUUL_BRANCH') | length > 0
- name: "Override the ipv4_gateway setting"
set_fact:
ipv4_gateway: "192.168.122.1"
roles:
- role: bifrost-prep-for-install
when: not (skip_install | default(false) | bool)
@ -33,21 +33,9 @@
name: "Executes install, enrollment, and testing in one playbook"
become: yes
gather_facts: yes
pre_tasks:
- name: "Collect process list if running in a CI System"
command: ps aux
when: ci_testing | default(false)| bool
- name: "Collect list of listening network sockets if running in a CI system"
shell: netstat -apn|grep LISTEN # noqa 306
when: ci_testing | default(false)| bool
- name: "Use a cached cirros image"
set_fact:
cirros_deploy_image_upstream_url: file:///opt/cache/files/cirros-0.5.1-x86_64-disk.img
when: ci_testing | default(false)| bool
roles:
- role: bifrost-keystone-install
- role: bifrost-ironic-install
testing: true
# NOTE(TheJulia): While the next step creates a ramdisk, some elements
# do not support ramdisk-image-create as they invoke steps to cleanup
# the ramdisk which causes ramdisk-image-create to believe it failed.
@ -109,8 +97,6 @@
- hosts: baremetal
name: "Create configuration drive files and deploy machines"
vars:
multinode_testing: "{{ inventory_dhcp | bool }}"
become: no
connection: local
roles: