From 0d1f4580c0295cc4b2ad718968d62f4a1d798575 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Fri, 31 Jul 2015 18:40:23 -0400 Subject: [PATCH] Add JSON and YAML examples Addition of example JSON and YAML based inventory files to allow for easy adaptation by users. Change-Id: I227c031f75c4f5bb3b2030c23164c2d76caf4077 --- README.rst | 5 +- playbooks/inventory/baremetal.json.example | 93 ++++++++++++++++++++++ playbooks/inventory/baremetal.yml.example | 71 +++++++++++++++++ 3 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 playbooks/inventory/baremetal.json.example create mode 100644 playbooks/inventory/baremetal.yml.example diff --git a/README.rst b/README.rst index aacc980ca..cb499ef54 100644 --- a/README.rst +++ b/README.rst @@ -241,6 +241,9 @@ which could potentially allow a user to provision different operating system images onto different hardware chassis by defining the appropriate settings in an "instance_info" variable. +Examples utilizing JSON and YAML formatting, along host specific variable +injection can be found in the playbooks/inventory/ folder. + Legacy CSV File Format ---------------------- @@ -273,7 +276,7 @@ although the enrollment and deployment playbooks utilize the model of a host per line model in order to process through the entire list, as well as reference the specific field items. -An example file can be found at inventory/baremetal.csv.example. +An example file can be found at: playbooks/inventory/baremetal.csv.example How this works? --------------- diff --git a/playbooks/inventory/baremetal.json.example b/playbooks/inventory/baremetal.json.example new file mode 100644 index 000000000..cffd1a9c7 --- /dev/null +++ b/playbooks/inventory/baremetal.json.example @@ -0,0 +1,93 @@ +{ + "sshexample0": { + "uuid": "00000000-0000-0000-0000-000000000001", + "driver_info": { + "power": { + "ssh_port": 22, + "ssh_username": "ironic", + "ssh_virt_type": "virsh", + "ssh_address": "192.168.122.1", + "ssh_key_filename": "/home/ironic/.ssh/id_rsa" + } + }, + "nics": [ + { + "mac": "00:00:00:f9:32:f6" + } + ], + "driver": "agent_ssh", + "ipv4_address": "192.168.122.2", + "properties": { + "cpu_arch": "x86_64", + "ram": "3072", + "disk_size": "10", + "cpus": "1" + }, + "name": "sshexample0" + }, + "basicipmiexample0": { + "uuid": "00000000-0000-0000-0000-000000000002", + "driver_info": { + "power": { + "ipmi_username": "ADMIN", + "ipmi_address": "192.168.2.20", + "ipmi_password": "ADMIN_PASSWORD" + } + }, + "nics": [ + { + "mac": "00:00:00:23:34:56" + }, + { + "mac": "00:00:00:12:34:57" + } + ], + "driver": "agent_ipmitool", + "ipv4_address": "192.168.1.2", + "properties": { + "cpu_arch": "x86_64", + "ram": "32760", + "disk_size": "235", + "cpus": "16" + }, + "name": "basicipmiexample0" + }, + "advancedipmiexample0": { + "ipa_kernel_url": "http://192.168.1.1:8080/custom_ipa.vmlinuz", + "ipa_ramdisk_url": "http://192.168.1.1:8080/custom_ipa_image.cpio.gz", + "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" + } + }, + "nics": [ + { + "mac": "00:00:00:23:34:58" + }, + { + "mac": "00:00:00:12:34:59" + } + ], + "instance_info": { + "image_source": "http://192.168.1.1:8080/custom_deployment_image.qcow2", + "image_checksum": "493972895dc465a09702ce6e85a836c5" + }, + "driver": "agent_ipmitool", + "ipv4_address": "192.168.1.3", + "properties": { + "cpu_arch": "x86_64", + "ram": "32760", + "disk_size": "235", + "cpus": "16" + }, + "name": "advancedipmiexample0" + } +} diff --git a/playbooks/inventory/baremetal.yml.example b/playbooks/inventory/baremetal.yml.example new file mode 100644 index 000000000..0cece5a66 --- /dev/null +++ b/playbooks/inventory/baremetal.yml.example @@ -0,0 +1,71 @@ +--- + sshexample0: + uuid: "00000000-0000-0000-0000-000000000001" + driver_info: + power: + ssh_port: 22 + ssh_username: "ironic" + ssh_virt_type: "virsh" + ssh_address: "192.168.122.1" + ssh_key_filename: "/home/ironic/.ssh/id_rsa" + nics: + - + mac: "00:00:00:f9:32:f6" + driver: "agent_ssh" + ipv4_address: "192.168.122.2" + properties: + cpu_arch: "x86_64" + ram: "3072" + disk_size: "10" + cpus: "1" + name: "sshexample0" + basicipmiexample0: + uuid: "00000000-0000-0000-0000-000000000002" + driver_info: + power: + ipmi_username: "ADMIN" + ipmi_address: "192.168.2.20" + ipmi_password: "ADMIN_PASSWORD" + nics: + - + mac: "00:00:00:23:34:56" + - + mac: "00:00:00:12:34:57" + driver: "agent_ipmitool" + ipv4_address: "192.168.1.2" + properties: + cpu_arch: "x86_64" + ram: "32760" + disk_size: "235" + cpus: "16" + name: "basicipmiexample0" + advancedipmiexample0: + ipa_kernel_url: "http://192.168.1.1:8080/custom_ipa.vmlinuz" + ipa_ramdisk_url: "http://192.168.1.1:8080/custom_ipa_image.cpio.gz" + 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" + nics: + - + mac: "00:00:00:23:34:58" + - + mac: "00:00:00:12:34:59" + instance_info: + image_source: "http://192.168.1.1:8080/custom_deployment_image.qcow2" + image_checksum: "493972895dc465a09702ce6e85a836c5" + driver: "agent_ipmitool" + ipv4_address: "192.168.1.3" + properties: + cpu_arch: "x86_64" + ram: "32760" + disk_size: "235" + cpus: "16" + name: "advancedipmiexample0"