From 235e95885b9d59d61dc716d303520a609d4e596b Mon Sep 17 00:00:00 2001 From: Allen Gao Date: Tue, 16 Feb 2016 20:31:39 +0800 Subject: [PATCH] Move ironic-discoverd to ironic-inspector Closes-Bug: #1551052 Change-Id: Ic226287bbf1f1e8d5cc2e1d80ce2975448b1f95c --- ansible/inventory/all-in-one | 2 +- ansible/inventory/multinode | 2 +- ansible/roles/ironic/defaults/main.yml | 6 +++--- ansible/roles/ironic/tasks/config.yml | 6 +++--- ansible/roles/ironic/tasks/deploy.yml | 4 ++-- ansible/roles/ironic/tasks/pull.yml | 6 +++--- ansible/roles/ironic/tasks/start.yml | 10 +++++----- ansible/roles/ironic/templates/discoverd.conf.j2 | 11 ----------- ...ic-discoverd.json.j2 => ironic-inspector.json.j2} | 2 +- ansible/roles/ironic/templates/ironic.conf.j2 | 12 ++++++++++++ ansible/roles/nova/templates/nova.conf.j2 | 1 - ansible/site.yml | 2 +- doc/ironic-guide.rst | 5 ++--- docker/ironic/ironic-base/Dockerfile.j2 | 3 ++- .../Dockerfile.j2 | 8 +++----- tests/test_build.py | 4 ++-- tools/cleanup-containers | 2 +- 17 files changed, 42 insertions(+), 44 deletions(-) delete mode 100644 ansible/roles/ironic/templates/discoverd.conf.j2 rename ansible/roles/ironic/templates/{ironic-discoverd.json.j2 => ironic-inspector.json.j2} (78%) rename docker/ironic/{ironic-discoverd => ironic-inspector}/Dockerfile.j2 (58%) diff --git a/ansible/inventory/all-in-one b/ansible/inventory/all-in-one index a44eb1d661..0c72fde5f8 100644 --- a/ansible/inventory/all-in-one +++ b/ansible/inventory/all-in-one @@ -180,7 +180,7 @@ ironic [ironic-conductor:children] ironic -[ironic-discoverd:children] +[ironic-inspector:children] ironic [ironic-pxe:children] diff --git a/ansible/inventory/multinode b/ansible/inventory/multinode index f1a154062e..c6c1d2d125 100644 --- a/ansible/inventory/multinode +++ b/ansible/inventory/multinode @@ -205,7 +205,7 @@ ironic [ironic-conductor:children] ironic -[ironic-discoverd:children] +[ironic-inspector:children] ironic [ironic-pxe:children] diff --git a/ansible/roles/ironic/defaults/main.yml b/ansible/roles/ironic/defaults/main.yml index 69da77ffcc..6fb97c340b 100644 --- a/ansible/roles/ironic/defaults/main.yml +++ b/ansible/roles/ironic/defaults/main.yml @@ -20,9 +20,9 @@ ironic_conductor_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{ ironic_conductor_tag: "{{ openstack_release }}" ironic_conductor_image_full: "{{ ironic_conductor_image }}:{{ ironic_conductor_tag }}" -ironic_discoverd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-ironic-discoverd" -ironic_discoverd_tag: "{{ openstack_release }}" -ironic_discoverd_image_full: "{{ ironic_discoverd_image }}:{{ ironic_discoverd_tag }}" +ironic_inspector_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-ironic-inspector" +ironic_inspector_tag: "{{ openstack_release }}" +ironic_inspector_image_full: "{{ ironic_inspector_image }}:{{ ironic_inspector_tag }}" ironic_pxe_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-ironic-pxe" ironic_pxe_tag: "{{ openstack_release }}" diff --git a/ansible/roles/ironic/tasks/config.yml b/ansible/roles/ironic/tasks/config.yml index 416157762d..d4d3e6bd8a 100644 --- a/ansible/roles/ironic/tasks/config.yml +++ b/ansible/roles/ironic/tasks/config.yml @@ -7,7 +7,7 @@ with_items: - "ironic-api" - "ironic-conductor" - - "ironic-discoverd" + - "ironic-inspector" - "ironic-pxe" - name: Copying over config.json files for services @@ -17,7 +17,7 @@ with_items: - "ironic-api" - "ironic-conductor" - - "ironic-discoverd" + - "ironic-inspector" - "ironic-pxe" - name: Copying over ironic.conf @@ -35,4 +35,4 @@ with_items: - "ironic-api" - "ironic-conductor" - - "ironic-discoverd" + - "ironic-inspector" diff --git a/ansible/roles/ironic/tasks/deploy.yml b/ansible/roles/ironic/tasks/deploy.yml index e32778aee8..09fa82b225 100644 --- a/ansible/roles/ironic/tasks/deploy.yml +++ b/ansible/roles/ironic/tasks/deploy.yml @@ -5,7 +5,7 @@ - include: config.yml when: inventory_hostname in groups['ironic-api'] or inventory_hostname in groups['ironic-conductor'] or - inventory_hostname in groups['ironic-discoverd'] or + inventory_hostname in groups['ironic-inspector'] or inventory_hostname in groups['ironic-pxe'] - include: bootstrap.yml @@ -14,5 +14,5 @@ - include: start.yml when: inventory_hostname in groups['ironic-api'] or inventory_hostname in groups['ironic-conductor'] or - inventory_hostname in groups['ironic-discoverd'] or + inventory_hostname in groups['ironic-inspector'] or inventory_hostname in groups['ironic-pxe'] diff --git a/ansible/roles/ironic/tasks/pull.yml b/ansible/roles/ironic/tasks/pull.yml index 9ee19f9774..630f34eb17 100644 --- a/ansible/roles/ironic/tasks/pull.yml +++ b/ansible/roles/ironic/tasks/pull.yml @@ -13,12 +13,12 @@ image: "{{ ironic_conductor_image_full }}" when: inventory_hostname in groups['ironic-conductor'] -- name: Pulling ironic-discoverd image +- name: Pulling ironic-inspector image kolla_docker: action: "pull_image" common_options: "{{ docker_common_options }}" - image: "{{ ironic_discoverd_image_full }}" - when: inventory_hostname in groups['ironic-discoverd'] + image: "{{ ironic_inspector_image_full }}" + when: inventory_hostname in groups['ironic-inspector'] - name: Pulling ironic-pxe image kolla_docker: diff --git a/ansible/roles/ironic/tasks/start.yml b/ansible/roles/ironic/tasks/start.yml index d728ec8f52..2c2dba6bb0 100644 --- a/ansible/roles/ironic/tasks/start.yml +++ b/ansible/roles/ironic/tasks/start.yml @@ -30,12 +30,12 @@ - "ironic_pxe:/tftpboot/" when: inventory_hostname in groups['ironic-conductor'] -- name: Starting ironic-discoverd container +- name: Starting ironic-inspector container kolla_docker: action: "start_container" common_options: "{{ docker_common_options }}" - image: "{{ ironic_discoverd_image_full }}" - name: "ironic_discoverd" + image: "{{ ironic_inspector_image_full }}" + name: "ironic_inspector" privileged: True - volumes: "{{ node_config_directory }}/ironic-discoverd/:{{ container_config_directory }}/:ro" - when: inventory_hostname in groups['ironic-discoverd'] + volumes: "{{ node_config_directory }}/ironic-inspector/:{{ container_config_directory }}/:ro" + when: inventory_hostname in groups['ironic-inspector'] diff --git a/ansible/roles/ironic/templates/discoverd.conf.j2 b/ansible/roles/ironic/templates/discoverd.conf.j2 deleted file mode 100644 index b7dae00832..0000000000 --- a/ansible/roles/ironic/templates/discoverd.conf.j2 +++ /dev/null @@ -1,11 +0,0 @@ -[discoverd] -database = inspector.sqlite3 -os_auth_url = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_public_port }}/v2.0 -os_username = {{ openstack_auth.username }} -os_password = {{ openstack_auth.password }} -os_tenant_name = {{ openstack_auth.project_name }} -identity_uri = {{ openstack_auth.auth_url }} - -# Note: this will be in the firewall section once upgraded to inspector -# unsure of the correct interface here -dnsmasq_interface = {{ api_interface }} diff --git a/ansible/roles/ironic/templates/ironic-discoverd.json.j2 b/ansible/roles/ironic/templates/ironic-inspector.json.j2 similarity index 78% rename from ansible/roles/ironic/templates/ironic-discoverd.json.j2 rename to ansible/roles/ironic/templates/ironic-inspector.json.j2 index 29e0b9a655..a15f2939e1 100644 --- a/ansible/roles/ironic/templates/ironic-discoverd.json.j2 +++ b/ansible/roles/ironic/templates/ironic-inspector.json.j2 @@ -1,5 +1,5 @@ { - "command": "ironic-discoverd --config-file /etc/ironic/ironic.conf", + "command": "ironic-inspector --config-file /etc/ironic/ironic.conf", "config_files": [ { "source": "{{ container_config_directory }}/ironic.conf", diff --git a/ansible/roles/ironic/templates/ironic.conf.j2 b/ansible/roles/ironic/templates/ironic.conf.j2 index 53c00e2c08..e2f700a009 100644 --- a/ansible/roles/ironic/templates/ironic.conf.j2 +++ b/ansible/roles/ironic/templates/ironic.conf.j2 @@ -14,6 +14,18 @@ api_url = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ ironic_api_port clean_nodes = false {% endif %} +{% if service_name == 'ironic-inspector' %} +[ironic] +os_auth_url = {{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_public_port }}/v2.0 +os_username = {{ openstack_auth.username }} +os_password = {{ openstack_auth.password }} +os_tenant_name = {{ openstack_auth.project_name }} +identity_uri = {{ openstack_auth.auth_url }} + +[firewall] +dnsmasq_interface = {{ api_interface }} +{% endif %} + [database] connection = mysql+pymysql://{{ ironic_database_user }}:{{ ironic_database_password }}@{{ ironic_database_address }}/{{ ironic_database_name }} diff --git a/ansible/roles/nova/templates/nova.conf.j2 b/ansible/roles/nova/templates/nova.conf.j2 index b208a833dc..f47b941837 100644 --- a/ansible/roles/nova/templates/nova.conf.j2 +++ b/ansible/roles/nova/templates/nova.conf.j2 @@ -78,7 +78,6 @@ html5proxy_port = {{ nova_spicehtml5proxy_port }} {% if service_name == "nova-compute-ironic" %} [ironic] -#(TODO) remember to update this once discoverd is replaced by inspector admin_username = {{ ironic_keystone_user }} admin_password = {{ ironic_keystone_password }} admin_url = {{ openstack_auth_v2.auth_url }} diff --git a/ansible/site.yml b/ansible/site.yml index 840e607e1d..ded4f6ef8b 100644 --- a/ansible/site.yml +++ b/ansible/site.yml @@ -151,7 +151,7 @@ - hosts: - ironic-api - ironic-conductor - - ironic-discoverd + - ironic-inspector - ironic-pxe - rabbitmq roles: diff --git a/doc/ironic-guide.rst b/doc/ironic-guide.rst index da8795d63a..e0ed9baff5 100644 --- a/doc/ironic-guide.rst +++ b/doc/ironic-guide.rst @@ -7,7 +7,7 @@ Currently Kolla can deploy the Ironic services: - ironic-api - ironic-conductor -- ironic-discoverd +- ironic-inspector As well as a required PXE service, deployed as ironic-pxe. @@ -15,8 +15,7 @@ Current status -------------- The Ironic implementation is "tech preview", so currently instances can only be deployed on baremetal. Further work will be done to allow scheduling for both -virtualized and baremetal deployments. Most probably at that time discoverd -will be replaced by ironic-inspector. +virtualized and baremetal deployments. Post-deployment configuration ----------------------------- diff --git a/docker/ironic/ironic-base/Dockerfile.j2 b/docker/ironic/ironic-base/Dockerfile.j2 index 4dc6e7fc33..8447f92fff 100644 --- a/docker/ironic/ironic-base/Dockerfile.j2 +++ b/docker/ironic/ironic-base/Dockerfile.j2 @@ -28,4 +28,5 @@ RUN ln -s ironic-base-source/* ironic \ {% endif %} -RUN usermod -a -G kolla ironic +RUN usermod -a -G kolla ironic \ + && chown -R ironic: /etc/ironic diff --git a/docker/ironic/ironic-discoverd/Dockerfile.j2 b/docker/ironic/ironic-inspector/Dockerfile.j2 similarity index 58% rename from docker/ironic/ironic-discoverd/Dockerfile.j2 rename to docker/ironic/ironic-inspector/Dockerfile.j2 index 536d2b878b..217a73e06c 100644 --- a/docker/ironic/ironic-discoverd/Dockerfile.j2 +++ b/docker/ironic/ironic-inspector/Dockerfile.j2 @@ -4,11 +4,9 @@ MAINTAINER {{ maintainer }} {% if install_type == 'binary' %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} -RUN pip install ironic-discoverd -# discoverd no longer in delorean 9/28/2015, switch to inspector on TODO -#RUN yum -y install \ -# openstack-ironic-discoverd \ -# && yum clean all +RUN yum -y install \ + openstack-ironic-inspector \ + && yum clean all {% endif %} {% endif %} diff --git a/tests/test_build.py b/tests/test_build.py index eda87a4e72..7f68c2e118 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -70,7 +70,7 @@ class BuildTestCentosBinary(BuildTest, base.BaseTestCase): excluded_images = ["gnocchi-base", "murano-base", "ironic-pxe", - "ironic-discoverd", + "ironic-inspector", "mistral-base", "murano-base"] @@ -84,7 +84,7 @@ class BuildTestCentosSource(BuildTest, base.BaseTestCase): excluded_images = ["gnocchi-base", "murano-base", "ironic-pxe", - "ironic-discoverd", + "ironic-inspector", "mistral-base"] def setUp(self): diff --git a/tools/cleanup-containers b/tools/cleanup-containers index adf24f4500..a69adfe532 100755 --- a/tools/cleanup-containers +++ b/tools/cleanup-containers @@ -17,7 +17,7 @@ else haproxy \ heat_{api{,_cfn},engine} \ horizon \ - ironic_{discoverd,conductor,api,pxe} \ + ironic_{inspector,conductor,api,pxe} \ keepalived \ keystone \ kolla_toolbox \