Stop using sub-sections of driver_info

They are deprecated in the ansible collection and do not match ironic.

Change-Id: I42b4e6f1c76b966d870297aa568a3e81d1967bc1
This commit is contained in:
Dmitry Tantsur 2022-01-25 16:11:20 +01:00
parent a4657cc600
commit 73df7ea137
10 changed files with 70 additions and 76 deletions

View File

@ -1,4 +1,4 @@
collections:
- name: openstack.cloud
version: '>=1.0.0,<2.0.0'
version: '>=1.3.0,<2.0.0'
source: https://galaxy.ansible.com

View File

@ -95,14 +95,12 @@ Example JSON Element:
"neutron"
],
"driver_info": {
"power": {
"ipmi_target_channel": "0",
"ipmi_username": "ADMIN",
"ipmi_address": "192.168.122.1",
"ipmi_target_address": "0",
"ipmi_password": "undefined",
"ipmi_bridging": "single"
}
"ipmi_target_channel": "0",
"ipmi_username": "ADMIN",
"ipmi_address": "192.168.122.1",
"ipmi_target_address": "0",
"ipmi_password": "undefined",
"ipmi_bridging": "single"
},
"nics": [
{

View File

@ -37,17 +37,17 @@ class TestBifrostInventoryFunctional(base.TestCase):
{"uuid": "00000000-0000-0000-0000-000000000002", "driver": "ipmi",
"name": "hostname1", "ipv4_address": "192.168.1.3", "ansible_ssh_host":
"192.168.1.3", "provisioning_ipv4_address": "192.168.1.3",
"driver_info": {"power": {"ipmi_address": "192.0.2.3",
"driver_info": {"ipmi_address": "192.0.2.3",
"ipmi_password": "undefined", "ipmi_username": "root",
"ipmi_target_address": null, "ipmi_target_channel": null,
"ipmi_transit_address": null, "ipmi_transit_channel": null}}, "nics":
"ipmi_transit_address": null, "ipmi_transit_channel": null}, "nics":
[{"mac": "00:01:02:03:04:06"}], "properties": {"ram": "8192", "cpu_arch":
"x86_64", "disk_size": "1024", "cpus": "2"}, "host_groups":
["baremetal", "nova"]}, "hostname0":
{"uuid": "00000000-0000-0000-0000-000000000001", "driver": "ipmi",
"name": "hostname0", "ipv4_address": "192.168.1.2", "ansible_ssh_host":
"192.168.1.2", "provisioning_ipv4_address": "192.168.1.2",
"driver_info": {"power": {}}, "nics":
"driver_info": {}, "nics":
[{"mac": "00:01:02:03:04:05"}], "properties": {"ram": "8192",
"cpu_arch": "x86_64", "disk_size": "512", "cpus": "1"},
"host_groups": ["baremetal", "nova"]}}""".replace('\n', '')
@ -59,12 +59,12 @@ class TestBifrostInventoryFunctional(base.TestCase):
def test_minimal_json(self):
input_json = """{"h0000-01":{"uuid":
"00000000-0000-0000-0001-bad00000010","name":"h0000-01","driver_info"
:{"power":{"ipmi_address":"10.0.0.78","ipmi_username":"ADMIN","
ipmi_password":"ADMIN"}},"driver":"ipmi"}}""".replace('\n', '')
:{"ipmi_address":"10.0.0.78","ipmi_username":"ADMIN","
ipmi_password":"ADMIN"},"driver":"ipmi"}}""".replace('\n', '')
expected_json = """{"h0000-01":{"uuid":
"00000000-0000-0000-0001-bad00000010","name":"h0000-01","driver_info"
:{"power":{"ipmi_address":"10.0.0.78","ipmi_username":"ADMIN","
ipmi_password":"ADMIN"}},"driver":"ipmi","addressing_mode":
:{"ipmi_address":"10.0.0.78","ipmi_username":"ADMIN","
ipmi_password":"ADMIN"},"driver":"ipmi","addressing_mode":
"dhcp","host_groups": ["baremetal"]}}""".replace('\n', '')
(groups, hostvars) = utils.bifrost_data_conversion(input_json)
del hostvars['127.0.0.1']

View File

@ -89,7 +89,7 @@ The JSON format resembles the data structure that ironic utilizes internally.
``deploy``, ``management`` and ``console``.
.. note::
With newer versions of the collection you can just put all fields under
With newer versions of the collection you should just put all fields under
``driver_info`` directly).
* The ``nics`` field is a list of ports to create. The required field is
@ -106,11 +106,9 @@ Example:
"testvm1": {
"uuid": "00000000-0000-0000-0000-000000000001",
"driver_info": {
"power": {
"ipmi_address": "192.168.122.1",
"ipmi_username": "admin",
"ipmi_password": "pa$$w0rd"
}
"ipmi_address": "192.168.122.1",
"ipmi_username": "admin",
"ipmi_password": "pa$$w0rd"
},
"nics": [
{
@ -142,11 +140,9 @@ in an ``instance_info`` variable, for example:
"testvm1": {
"uuid": "00000000-0000-0000-0000-000000000001",
"driver_info": {
"power": {
"ipmi_address": "192.168.122.1",
"ipmi_username": "admin",
"ipmi_password": "pa$$w0rd"
}
"ipmi_address": "192.168.122.1",
"ipmi_username": "admin",
"ipmi_password": "pa$$w0rd"
},
"nics": [
{

View File

@ -2,11 +2,9 @@
"basicipmiexample0": {
"uuid": "00000000-0000-0000-0000-000000000002",
"driver_info": {
"power": {
"ipmi_username": "ADMIN",
"ipmi_address": "192.168.2.20",
"ipmi_password": "ADMIN_PASSWORD"
}
"ipmi_username": "ADMIN",
"ipmi_address": "192.168.2.20",
"ipmi_password": "ADMIN_PASSWORD"
},
"nics": [
{
@ -31,16 +29,14 @@
"ipa_ramdisk_url": "http://192.168.1.1:8080/custom_ipa.initramfs",
"uuid": "00000000-0000-0000-0000-000000000003",
"driver_info": {
"power": {
"ipmi_username": "ADMIN",
"ipmi_address": "192.168.2.21",
"ipmi_password": "ADMIN_PASSWORD",
"ipmi_bridging": "dual",
"ipmi_target_channel": "0",
"ipmi_target_address": "1",
"ipmi_transit_channel": "2",
"ipmi_transit_address": "3"
}
"ipmi_username": "ADMIN",
"ipmi_address": "192.168.2.21",
"ipmi_password": "ADMIN_PASSWORD",
"ipmi_bridging": "dual",
"ipmi_target_channel": "0",
"ipmi_target_address": "1",
"ipmi_transit_channel": "2",
"ipmi_transit_address": "3"
},
"nics": [
{

View File

@ -2,10 +2,9 @@
basicipmiexample0:
uuid: "00000000-0000-0000-0000-000000000002"
driver_info:
power:
ipmi_username: "ADMIN"
ipmi_address: "192.168.2.20"
ipmi_password: "ADMIN_PASSWORD"
ipmi_username: "ADMIN"
ipmi_address: "192.168.2.20"
ipmi_password: "ADMIN_PASSWORD"
nics:
-
mac: "00:00:00:23:34:56"
@ -24,15 +23,14 @@
ipa_ramdisk_url: "http://192.168.1.1:8080/custom_ipa.initramfs"
uuid: "00000000-0000-0000-0000-000000000003"
driver_info:
power:
ipmi_username: "ADMIN"
ipmi_address: "192.168.2.21"
ipmi_password: "ADMIN_PASSWORD"
ipmi_bridging: "dual"
ipmi_target_channel: "0"
ipmi_target_address: "1"
ipmi_transit_channel: "2"
ipmi_transit_address: "3"
ipmi_username: "ADMIN"
ipmi_address: "192.168.2.21"
ipmi_password: "ADMIN_PASSWORD"
ipmi_bridging: "dual"
ipmi_target_channel: "0"
ipmi_target_address: "1"
ipmi_transit_channel: "2"
ipmi_transit_address: "3"
nics:
-
mac: "00:00:00:23:34:58"

View File

@ -138,15 +138,14 @@
host_groups: "{{ vm_host_group }}"
driver: "{{ test_vm_node_driver }}"
driver_info:
power:
ipmi_address: "192.168.122.1"
ipmi_port: "{{ virtual_ipmi_port }}"
ipmi_username: "admin"
ipmi_password: "password"
redfish_address: "http://{{ redfish_emulator_host }}:{{ redfish_emulator_port }}"
redfish_system_id: "/redfish/v1/Systems/{{ vm_name }}"
redfish_username: "admin"
redfish_password: "password"
ipmi_address: "192.168.122.1"
ipmi_port: "{{ virtual_ipmi_port }}"
ipmi_username: "admin"
ipmi_password: "password"
redfish_address: "http://{{ redfish_emulator_host }}:{{ redfish_emulator_port }}"
redfish_system_id: "/redfish/v1/Systems/{{ vm_name }}"
redfish_username: "admin"
redfish_password: "password"
nics:
- mac: "{{ vm_mac }}"
ansible_ssh_host: "192.168.122.{{ testvm_json_data | length + 2 }}"

View File

@ -42,21 +42,19 @@ cloud_name: Optional: String value defining a clouds.yaml entry for
the ansible module to leverage.
This role expects a data structure similar to the one below, however it should
be understood that the individual entries under power can vary based on power
driver required.
be understood that the individual entries under `driver_info` can vary based
on the driver.
{
"node1": {
"uuid": "00000000-0000-0000-0000-000000000000",
"driver_info": {
"power": {
"ipmi_target_channel": "0",
"ipmi_username": "ADMIN",
"ipmi_address": "192.168.122.1",
"ipmi_target_address": "0",
"ipmi_password": "undefined",
"ipmi_bridging": "single"
}
"ipmi_target_channel": "0",
"ipmi_username": "ADMIN",
"ipmi_address": "192.168.122.1",
"ipmi_target_address": "0",
"ipmi_password": "undefined",
"ipmi_bridging": "single"
},
"nics": [
{

View File

@ -32,5 +32,4 @@
state: present
nics: "{{ nics }}"
properties: "{{ properties | default({}) }}"
driver_info:
power: "{{ driver_info.power }}"
driver_info: "{{ driver_info | default(omit) }}"

View File

@ -0,0 +1,10 @@
---
upgrade:
- |
In your inventory files, please remove sub-sections ``power``, ``console``
and ``management`` from ``driver_info``. Instead, just place all fields
under ``driver_info`` directly.
fixes:
- |
Bifrost no longer defaults to using sub-sections ``power``, ``console``
and ``management`` under ``driver_info`` in inventory.