diff --git a/ansible-collections-requirements.yml b/ansible-collections-requirements.yml index cf9554950..9cd55a61b 100644 --- a/ansible-collections-requirements.yml +++ b/ansible-collections-requirements.yml @@ -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 diff --git a/bifrost/inventory.py b/bifrost/inventory.py index fede26bf2..5629030d2 100755 --- a/bifrost/inventory.py +++ b/bifrost/inventory.py @@ -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": [ { diff --git a/bifrost/tests/functional/test_inventory_functional.py b/bifrost/tests/functional/test_inventory_functional.py index 7548a9905..5eea332ed 100644 --- a/bifrost/tests/functional/test_inventory_functional.py +++ b/bifrost/tests/functional/test_inventory_functional.py @@ -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'] diff --git a/doc/source/user/howto.rst b/doc/source/user/howto.rst index 924503e92..67b3207b3 100644 --- a/doc/source/user/howto.rst +++ b/doc/source/user/howto.rst @@ -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": [ { diff --git a/playbooks/inventory/baremetal.json.example b/playbooks/inventory/baremetal.json.example index 2366e1a7f..aace651d2 100644 --- a/playbooks/inventory/baremetal.json.example +++ b/playbooks/inventory/baremetal.json.example @@ -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": [ { diff --git a/playbooks/inventory/baremetal.yml.example b/playbooks/inventory/baremetal.yml.example index 63edcad79..22df50729 100644 --- a/playbooks/inventory/baremetal.yml.example +++ b/playbooks/inventory/baremetal.yml.example @@ -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" diff --git a/playbooks/roles/bifrost-create-vm-nodes/tasks/create_vm.yml b/playbooks/roles/bifrost-create-vm-nodes/tasks/create_vm.yml index b8d4b3f41..16e27c993 100644 --- a/playbooks/roles/bifrost-create-vm-nodes/tasks/create_vm.yml +++ b/playbooks/roles/bifrost-create-vm-nodes/tasks/create_vm.yml @@ -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 }}" diff --git a/playbooks/roles/ironic-enroll-dynamic/README.md b/playbooks/roles/ironic-enroll-dynamic/README.md index 8b1e93438..162ed7aa6 100644 --- a/playbooks/roles/ironic-enroll-dynamic/README.md +++ b/playbooks/roles/ironic-enroll-dynamic/README.md @@ -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": [ { diff --git a/playbooks/roles/ironic-enroll-dynamic/tasks/main.yml b/playbooks/roles/ironic-enroll-dynamic/tasks/main.yml index 3ac3d3adb..40d618f16 100644 --- a/playbooks/roles/ironic-enroll-dynamic/tasks/main.yml +++ b/playbooks/roles/ironic-enroll-dynamic/tasks/main.yml @@ -32,5 +32,4 @@ state: present nics: "{{ nics }}" properties: "{{ properties | default({}) }}" - driver_info: - power: "{{ driver_info.power }}" + driver_info: "{{ driver_info | default(omit) }}" diff --git a/releasenotes/notes/driver-info-5281b1ec920bd44d.yaml b/releasenotes/notes/driver-info-5281b1ec920bd44d.yaml new file mode 100644 index 000000000..9ac86e339 --- /dev/null +++ b/releasenotes/notes/driver-info-5281b1ec920bd44d.yaml @@ -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.