Deprecate the Nginx data store

This feature is no longer needed since ironic-inspector supports
storing data in the database, which is a better supported approach.

This patch does not provide any migration and expects the operators
to do it using the ironic-inspector tooling.

Change-Id: I6f18b3a64d6df9354c3f04a588240f9ae3228d7c
This commit is contained in:
Dmitry Tantsur 2019-06-18 13:56:26 +02:00
parent a122f41185
commit 5b62504672
6 changed files with 38 additions and 33 deletions

View File

@ -224,13 +224,15 @@ inspector_processing_hooks: String value containing a comma-separated list,
non-default list of comma-separated processing non-default list of comma-separated processing
hooks for inspector. hooks for inspector.
inspector_store_data_in_nginx: Boolean value, default true. If true, this inspector_store_data_in_nginx: Boolean value, default false. If true, this
enables data gathered during introspection to be enables data gathered during introspection to be
stored in the local Nginx web server. In this stored in the local Nginx web server. In this
mode, Nginx masquerades as an unauthenticated mode, Nginx masquerades as an unauthenticated
'Swift' object storage service. Nginx is 'Swift' object storage service. Nginx is
configured to only allow the required operations configured to only allow the required operations
on the 'ironic-inspector' object container. on the 'ironic-inspector' object container.
DEPRECATED: introspection data is stored in the
database by default.
### Virtual Environment Install ### Virtual Environment Install

View File

@ -194,8 +194,8 @@ inspector_keep_ports: "present"
#inspector_processing_hooks: #inspector_processing_hooks:
# Whether to store introspection data using the local Nginx web server as an # Whether to store introspection data using the local Nginx web server as an
# object storage service. # object storage service. DEPRECATED, the data can be stored in the database.
inspector_store_data_in_nginx: true inspector_store_data_in_nginx: false
# When inspector_store_data_in_nginx is true, this is the URL of the Nginx # When inspector_store_data_in_nginx is true, this is the URL of the Nginx
# 'Swift' API endpoint. # 'Swift' API endpoint.

View File

@ -72,6 +72,8 @@ processing_hooks = {{ inspector_processing_hooks }}
{% endif %} {% endif %}
{% if inspector_store_data_in_nginx | bool %} {% if inspector_store_data_in_nginx | bool %}
store_data = swift store_data = swift
{% else %}
store_data = database
{% endif %} {% endif %}
{% if inspector.discovery.enabled == true %} {% if inspector.discovery.enabled == true %}
node_not_found_hook = enroll node_not_found_hook = enroll

View File

@ -1,12 +1,2 @@
--- ---
# defaults file for bifrost-test-inspection # defaults file for bifrost-test-inspection
file_url_port: "8080"
# Whether to store introspection data using the local Nginx web server as an
# object storage service.
inspector_store_data_in_nginx: true
# When inspector_store_data_in_nginx is true, this is the URL of the Nginx
# 'Swift' API endpoint.
inspector_store_data_url: "http://localhost:{{ file_url_port }}"

View File

@ -12,24 +12,22 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
--- ---
- block: - name: Check node hardware inspection data
- name: Check node hardware inspection data command: "openstack baremetal introspection data save {{ uuid }}"
command: "openstack baremetal introspection data save {{ uuid }}" register: inspection_data
register: inspection_data environment:
environment: OS_CLOUD: "{% if enable_keystone | default(false) | bool %}bifrost{% else %}bifrost-inspector{% endif %}"
OS_CLOUD: "{% if enable_keystone | default(false) | bool %}bifrost{% else %}bifrost-inspector{% endif %}"
# TODO(mgoddard): More validation of data format and contents. # TODO(mgoddard): More validation of data format and contents.
- name: Validate the inspection data format - name: Validate the inspection data format
assert: assert:
that: that:
- "'inventory' in data" - "'inventory' in data"
- "'memory' in inventory" - "'memory' in inventory"
- "'cpu' in inventory" - "'cpu' in inventory"
- "'bmc_address' in inventory" - "'bmc_address' in inventory"
- "'interfaces' in inventory" - "'interfaces' in inventory"
- "'disks' in inventory" - "'disks' in inventory"
vars: vars:
data: "{{ inspection_data.stdout | from_json }}" data: "{{ inspection_data.stdout | from_json }}"
inventory: "{{ data.inventory }}" inventory: "{{ data.inventory }}"
when: inspector_store_data_in_nginx | bool

View File

@ -0,0 +1,13 @@
---
features:
- |
When inspection support is enabled, introspection data is now stored in
the database by default. You can use the ``ironic-inspector-migrate-data``
command to move the data from nginx to the database, for example::
ironic-inspector-migrate-data --from swift --to database --config-file /etc/ironic-inspector/inspector.conf
deprecations:
- |
The ``inspector_store_data_in_nginx`` configuration option is deprecated
and will be removed in a future release. Introspection data can now be
stored in the database.