From 32f10b5a031fa215c32f4b1259e02f7ccb1fc562 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Tue, 3 Mar 2015 12:07:16 -0500 Subject: [PATCH] Support for deploying nodes Updated the ironic conductor driver configuration, along with the enrollment templates to set the driver to "agent_ipmitool". Engaged setup_nodes.yaml to make use of a new in development ansible module. Updated configdrives so they are loaded to HTTP, and as such minor property updates have occured. --- deploy/configdrive.yaml | 2 +- deploy/deploy.yaml | 4 ++-- deploy/setup_nodes.yaml | 14 ++++++-------- enroll/ipmi_bridging_dual_enroll.yaml | 5 ++++- enroll/ipmi_bridging_single_enroll.yaml | 5 ++++- enroll/standard_enroll.yaml | 7 +++++-- inventory/group_vars/all.yaml | 2 ++ setup/templates/ironic.conf.j2 | 4 ++-- 8 files changed, 26 insertions(+), 17 deletions(-) diff --git a/deploy/configdrive.yaml b/deploy/configdrive.yaml index 1072039b2..3efc2ecd2 100644 --- a/deploy/configdrive.yaml +++ b/deploy/configdrive.yaml @@ -27,7 +27,7 @@ with_lines: - cat {{ baremetal_csv_file }} - name: "Make config drive files" - local_action: command mkisofs -R -V config-2 -o /tmp/configdrive-{{item.split(',')[9]}}.iso {{ variable_configdrive_location.stdout }}/{{item.split(',')[9]}} + local_action: command mkisofs -R -V config-2 -o {{http_boot_folder}}/configdrive-{{item.split(',')[9]}}.iso {{ variable_configdrive_location.stdout }}/{{item.split(',')[9]}} with_lines: - cat {{ baremetal_csv_file }} - name: "Cleanup configdrive" diff --git a/deploy/deploy.yaml b/deploy/deploy.yaml index ac34f4eab..e86c55cdb 100644 --- a/deploy/deploy.yaml +++ b/deploy/deploy.yaml @@ -44,5 +44,5 @@ local_action: set_fact ssh_public_key="{{ lookup('file', ssh_public_key_path ) }}" - name: "Create configdrives" include: configdrive.yaml - #- name: "Enroll nodes in Ironic" - # include: setup_nodes.yaml + - name: "Enroll nodes in Ironic" + include: setup_nodes.yaml diff --git a/deploy/setup_nodes.yaml b/deploy/setup_nodes.yaml index 04d1f8e4a..7f029abb7 100644 --- a/deploy/setup_nodes.yaml +++ b/deploy/setup_nodes.yaml @@ -1,21 +1,19 @@ --- - name: "Enroll Hardware" # TODO: Conceptual idea of structure, needs image_source corrected and - #disk format clarified + # disk format clarified os_ironic_node: auth_plugin: None auth: None ironic_url: "{{ ironic_url }}" uuid: "{{item.split(',')[9]}}" - state: active - config_drive: "/tmp/{{item.split(',')[9]}}-configdrive.iso" - deploy_kernel: "{{ deploy_kernel }}" - deploy_ramdisk: "{{ deploy_ramdisk }}" + state: present + config_drive: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:8080/{{item.split(',')[9]}}-configdrive.iso" instance_info: image_source: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:8080/{{deploy_image_filename}}" - image_checksum: "{{ test_deploy_image.md5 }}" - image_disk_format: - uuid: "{{item.split(',')[9]}}" + image_checksum: "{{ test_deploy_image.stat.md5 }}" + image_disk_format: "qcow" + root_gb: 10 delegate_to: localhost with_lines: - cat {{ baremetal_csv_file }} diff --git a/enroll/ipmi_bridging_dual_enroll.yaml b/enroll/ipmi_bridging_dual_enroll.yaml index 61996a29c..51de57777 100644 --- a/enroll/ipmi_bridging_dual_enroll.yaml +++ b/enroll/ipmi_bridging_dual_enroll.yaml @@ -22,7 +22,7 @@ auth_plugin: None auth: None ironic_url: "{{ ironic_url }}" - driver: "pxe_ipmitool" + driver: "agent_ipmitool" # UUID determination TBD for mass enrollment. uuid: "{{item.split(',')[9]}}" state: present @@ -43,6 +43,9 @@ ipmi_target_address: "{{item.split(',')[13]}}" ipmi_transit_channel: "{{item.split(',')[14]}}" ipmi_transit_address: "{{item.split(',')[15]}}" + deploy: + deploy_kernel: "{{ deploy_kernel_url }}" + deploy_ramdisk: "{{ deploy_ramdisk_url }}" delegate_to: localhost with_lines: - cat {{ baremetal_csv_file }} diff --git a/enroll/ipmi_bridging_single_enroll.yaml b/enroll/ipmi_bridging_single_enroll.yaml index 0779046c3..9d624d34d 100644 --- a/enroll/ipmi_bridging_single_enroll.yaml +++ b/enroll/ipmi_bridging_single_enroll.yaml @@ -19,7 +19,7 @@ auth_plugin: None auth: None ironic_url: "{{ ironic_url }}" - driver: "pxe_ipmitool" + driver: "agent_ipmitool" # UUID determination TBD for mass enrollment. uuid: "{{item.split(',')[9]}}" state: present @@ -38,6 +38,9 @@ ipmi_bridging: "single" ipmi_target_channel: "{{item.split(',')[12]}}" ipmi_target_address: "{{item.split(',')[13]}}" + deploy: + deploy_kernel: "{{ deploy_kernel_url }}" + deploy_ramdisk: "{{ deploy_ramdisk_url }}" delegate_to: localhost with_lines: - cat {{ baremetal_csv_file }} diff --git a/enroll/standard_enroll.yaml b/enroll/standard_enroll.yaml index 57027a09c..c54b2343b 100644 --- a/enroll/standard_enroll.yaml +++ b/enroll/standard_enroll.yaml @@ -17,10 +17,10 @@ auth_plugin: None auth: None ironic_url: "{{ ironic_url }}" - driver: "pxe_ipmitool" + driver: "agent_ipmitool" # UUID determination TBD for mass enrollment. uuid: "{{item.split(',')[9]}}" - state: present + state: absent nics: - mac: "{{item.split(',')[0]}}" properties: @@ -33,6 +33,9 @@ ipmi_address: "{{item.split(',')[3]}}" ipmi_username: "{{item.split(',')[1]}}" ipmi_password: "{{item.split(',')[2]}}" + deploy: + deploy_kernel: "{{ deploy_kernel_url }}" + deploy_ramdisk: "{{ deploy_ramdisk_url }}" delegate_to: localhost with_lines: - cat {{ baremetal_csv_file }} diff --git a/inventory/group_vars/all.yaml b/inventory/group_vars/all.yaml index 349f255bd..b20772497 100644 --- a/inventory/group_vars/all.yaml +++ b/inventory/group_vars/all.yaml @@ -9,6 +9,8 @@ ssh_public_key_path: ~/.ssh/id_rsa.pub latest_os_ironic_url: https://raw.githubusercontent.com/juliakreger/ansible-modules-extras/features/new-openstack/cloud/os_ironic.py deploy_kernel: "{{http_boot_folder}}/coreos_production_pxe.vmlinuz" deploy_ramdisk: "{{http_boot_folder}}/coreos_production_pxe_image-oem.cpio.gz" +deploy_kernel_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:8080/coreos_production_pxe.vmlinuz" +deploy_ramdisk_url: "http://{{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}:8080/coreos_production_pxe_image-oem.cpio.gz" deploy_image_filename: "ubuntu-14.04-server-cloudimg-amd64.tar.gz" deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}" node_default_network_interface: eth0 diff --git a/setup/templates/ironic.conf.j2 b/setup/templates/ironic.conf.j2 index 6339fcd10..0e3fcd699 100644 --- a/setup/templates/ironic.conf.j2 +++ b/setup/templates/ironic.conf.j2 @@ -216,9 +216,9 @@ auth_strategy=noauth # "ironic.drivers" entrypoint. An example may be found in the # developer documentation online. (list value) {% if testing %} -enabled_drivers=pxe_ssh,pxe_ipmitool +enabled_drivers=agent_ipmitool {% else %} -enabled_drivers=pxe_ilo +enabled_drivers=agent_ipmitool {% endif %} #