diff --git a/playbooks/roles/bifrost-ironic-install/README.md b/playbooks/roles/bifrost-ironic-install/README.md index a907f2fb7..ff9bb2559 100644 --- a/playbooks/roles/bifrost-ironic-install/README.md +++ b/playbooks/roles/bifrost-ironic-install/README.md @@ -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 diff --git a/playbooks/roles/bifrost-ironic-install/defaults/main.yml b/playbooks/roles/bifrost-ironic-install/defaults/main.yml index 42f507e55..3905900ab 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/main.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/main.yml @@ -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. diff --git a/playbooks/roles/bifrost-ironic-install/templates/ironic-inspector.conf.j2 b/playbooks/roles/bifrost-ironic-install/templates/ironic-inspector.conf.j2 index 8db070ffd..0cde31c4f 100644 --- a/playbooks/roles/bifrost-ironic-install/templates/ironic-inspector.conf.j2 +++ b/playbooks/roles/bifrost-ironic-install/templates/ironic-inspector.conf.j2 @@ -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 diff --git a/playbooks/roles/bifrost-test-inspection/defaults/main.yml b/playbooks/roles/bifrost-test-inspection/defaults/main.yml index d2ab55ace..091a04945 100644 --- a/playbooks/roles/bifrost-test-inspection/defaults/main.yml +++ b/playbooks/roles/bifrost-test-inspection/defaults/main.yml @@ -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 }}" diff --git a/playbooks/roles/bifrost-test-inspection/tasks/main.yml b/playbooks/roles/bifrost-test-inspection/tasks/main.yml index 603fec9d9..c58f38641 100644 --- a/playbooks/roles/bifrost-test-inspection/tasks/main.yml +++ b/playbooks/roles/bifrost-test-inspection/tasks/main.yml @@ -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 }}" diff --git a/releasenotes/notes/store-data-a14351976eda9842.yaml b/releasenotes/notes/store-data-a14351976eda9842.yaml new file mode 100644 index 000000000..03bbefdc3 --- /dev/null +++ b/releasenotes/notes/store-data-a14351976eda9842.yaml @@ -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.