From c8e719cca2e6d15c06a023f34b92229a2b0303ad Mon Sep 17 00:00:00 2001 From: Jeremy Grant Date: Wed, 18 Jan 2017 08:41:47 -0600 Subject: [PATCH] Retrieve ilo drivers via webserver This enables the ability to bypass the ilo driver dependency on swift through implementation of support for the 'use_http_web_server_for_images' variable and corresponding logic to bypass swift tasks when enabled As per: https://specs.openstack.org/openstack/ironic-specs/specs/4.2/remove-swift-dependency-for-ilo-drivers.html Change-Id: I343c542dbb9b3a9fe17c364e827374b3512993f1 --- defaults/main.yml | 14 ++++++++++++++ tasks/ironic_post_install.yml | 5 +++++ templates/ironic.conf.j2 | 9 ++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index bb2a9c5d..90fe9527 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -112,6 +112,20 @@ ironic_service_role_name: "admin" ironic_service_in_ldap: False # Ironic image store information +# +### Hosted Web Server +# +# Set this to True to use http web server to host floppy +# images and generated boot ISO. This requires http_root and +# http_url to be configured in the [deploy] section of the +# config file. If this is set to False, then Ironic will use +# Swift to host the floppy images and generated boot_iso. +ironic_enable_web_server_for_images: False +ironic_http_url: null +ironic_http_root: null +# +### Swift Config +# ironic_swift_image_container: glance_images ironic_swift_api_version: v1 ironic_swift_url_endpoint_type: swift diff --git a/tasks/ironic_post_install.yml b/tasks/ironic_post_install.yml index bce2cff3..d63e4392 100644 --- a/tasks/ironic_post_install.yml +++ b/tasks/ironic_post_install.yml @@ -24,6 +24,7 @@ environment: OS_ENDPOINT_TYPE: internalURL when: + - not ironic_enable_web_server_for_images | bool - inventory_hostname == groups['ironic_all'][0] - not ironic_standalone | bool tags: @@ -41,6 +42,7 @@ OS_ENDPOINT_TYPE: internalURL register: swift_storage_url when: + - not ironic_enable_web_server_for_images | bool - (ironic_swift_auth_account is undefined) or (ironic_swift_endpoint is undefined) - not ironic_standalone | bool tags: @@ -54,6 +56,7 @@ variables are undefined. Ensure swift is functional and/or define those variables. when: + - not ironic_enable_web_server_for_images | bool - (ironic_swift_auth_account is undefined) and (ironic_swift_endpoint is undefined) - not ironic_standalone | bool - not swift_storage_url.stdout @@ -64,6 +67,7 @@ set_fact: ironic_swift_auth_account: "{{ swift_storage_url.stdout.split('/v1/')[-1] }}" when: + - not ironic_enable_web_server_for_images | bool - ironic_swift_auth_account is undefined - not ironic_standalone | bool tags: @@ -73,6 +77,7 @@ set_fact: ironic_swift_endpoint: "{{ swift_storage_url.stdout.split('/v1/')[0] }}" when: + - not ironic_enable_web_server_for_images | bool - ironic_swift_endpoint is undefined - not ironic_standalone | bool tags: diff --git a/templates/ironic.conf.j2 b/templates/ironic.conf.j2 index e9f7356b..3fdf9e0d 100644 --- a/templates/ironic.conf.j2 +++ b/templates/ironic.conf.j2 @@ -58,6 +58,10 @@ erase_devices_priority = {{ ironic_erase_devices_priority }} {% if not ironic_standalone | bool %} object_store_endpoint_type = {{ ironic_swift_url_endpoint_type }} {% endif %} +{% if ironic_enable_web_server_for_images | bool %} +http_root ={{ ironic_http_root }} +http_url = {{ ironic_http_url }} +{% endif %} [dhcp] dhcp_provider = {{ ironic_dhcp_provider }} @@ -77,7 +81,7 @@ username = {{ ironic_glance_service_user_name }} user_domain_id = {{ ironic_glance_service_user_domain_id }} password = {{ glance_service_password }} glance_api_servers = {{ ironic_glance_api_servers }} -{% if not ironic_standalone | bool %} +{% if not ironic_standalone | bool and not ironic_enable_web_server_for_images | bool %} swift_temp_url_key = {{ ironic_swift_temp_url_secret_key }} swift_container = {{ ironic_swift_image_container }} swift_endpoint_url = {{ ironic_swift_endpoint }} @@ -88,6 +92,9 @@ swift_api_version = {{ ironic_swift_api_version }} [iboot] [ilo] +{% if ironic_enable_web_server_for_images | bool %} +use_web_server_for_images = True +{% endif %} [inspector]