Merge "Deprecate the Nginx data store"

This commit is contained in:
Zuul 2019-06-24 03:20:28 +00:00 committed by Gerrit Code Review
commit b8f8c88bf4
6 changed files with 38 additions and 33 deletions

View File

@ -215,13 +215,15 @@ inspector_processing_hooks: String value containing a comma-separated list,
non-default list of comma-separated processing
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
stored in the local Nginx web server. In this
mode, Nginx masquerades as an unauthenticated
'Swift' object storage service. Nginx is
configured to only allow the required operations
on the 'ironic-inspector' object container.
DEPRECATED: introspection data is stored in the
database by default.
### Virtual Environment Install

View File

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

View File

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

View File

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

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.