[ubuntu images] make ubuntu interface name configurable

ubuntu images are normally created with its primary interface named
ens3 - however, in some cases that name can be different and its value
should be configurable

Change-Id: Ie9284ecda743a3154f36cd84ec492a3d15c6fbd5
This commit is contained in:
Eduardo Olivares 2022-06-23 16:02:33 +02:00 committed by Federico Ressi
parent b3b6404385
commit bd7d0353cf
4 changed files with 11 additions and 1 deletions

View File

@ -152,6 +152,10 @@ subparsers:
type: Value
help: user name to be used to connect to TripleO Overcloud hosts
ansible_variable: overcloud_ssh_username
ubuntu-interface-name:
type: Value
help: primary interface name obtained from the ubuntu instances
ansible_variable: ubuntu_interface_name
- title: Run stage
options:

View File

@ -13,6 +13,8 @@ test_default_conf:
tripleo:
undercloud_ssh_hostname: "{{ undercloud_ssh_hostname }}"
overcloud_ssh_username: "{{ overcloud_ssh_username }}"
ubuntu:
interface_name: "{{ ubuntu_interface_name }}"
test_log_debug: ''
@ -26,3 +28,5 @@ undercloud_hostname: '{{ groups.get("undercloud", []) | first | default("undercl
undercloud_ssh_hostname: ''
overcloud_ssh_username: ''
ubuntu_interface_name: ''

View File

@ -62,6 +62,8 @@ def get_images_options():
help="Default " + name + " username"),
cfg.StrOpt('password',
help="Default " + name + " password"),
cfg.StrOpt('interface_name',
help="Default " + name + " interface name"),
cfg.FloatOpt('connection_timeout',
default=None,
help=("Default " + name +

View File

@ -118,7 +118,7 @@ class UbuntuImageFixture(UbuntuMinimalImageFixture,
@property
def ethernet_device(self) -> str:
return 'ens3'
return CONF.tobiko.ubuntu.interface_name or 'ens3'
@property
def vlan_id(self) -> int: