diff --git a/ansible/roles/kolla-openstack/templates/kolla/config/ironic-inspector.conf b/ansible/roles/kolla-openstack/templates/kolla/config/ironic-inspector.conf
index b3852bb9fb9f4143175d575250390642b26e1267..d085c2bec75292893af27c27fedd49c7dae98f4a 100644
--- a/ansible/roles/kolla-openstack/templates/kolla/config/ironic-inspector.conf
+++ b/ansible/roles/kolla-openstack/templates/kolla/config/ironic-inspector.conf
@@ -13,8 +13,7 @@ add_ports = {{ kolla_inspector_add_ports }}
 {% endif %}
 
 {% if kolla_inspector_keep_ports %}
-# Keep only those ports that were found during inspection.
-keep_ports = present
+keep_ports = {{ kolla_inspector_keep_ports }}
 {% endif %}
 
 # Store logs returned by the inspection ramdisk.
diff --git a/releasenotes/notes/respect-comment-for-keep-ports-e0b1ab73395055a6.yaml b/releasenotes/notes/respect-comment-for-keep-ports-e0b1ab73395055a6.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..0d6bbdbc84f03b30f86508a6a01d31c3ebab0e12
--- /dev/null
+++ b/releasenotes/notes/respect-comment-for-keep-ports-e0b1ab73395055a6.yaml
@@ -0,0 +1,11 @@
+---
+upgrade:
+  - |
+    If you have customized ``inspector_keep_ports``, ensure it is set to one of:
+    ``all``, ``present``, ``added``.
+fixes:
+  - |
+    ``inspector_keep_ports`` can be set to one of: ``all``, ``present``,
+    ``added``. The previous behavior was to set this to ``present`` if the
+    variable was changed to any non-None value. This respects the behavior
+    indicated in the comments.