---
- name: Ensure introspection rules are registered in Bifrost
  hosts: seed
  tags:
    - introspection-rules
  roles:
    - role: ironic-inspector-rules
      os_openstacksdk_install_epel: "{{ dnf_install_epel }}"
      os_openstacksdk_state: "latest"
      ironic_inspector_venv: "{{ virtualenv_path }}/openstacksdk"
      ironic_inspector_upper_constraints_file: "{{ openstacksdk_upper_constraints_file }}"
      ironic_inspector_cloud: bifrost
      ironic_inspector_rules: "{{ kolla_bifrost_inspector_rules }}"
      # These variables may be referenced in the introspection rules.
      inspector_rule_var_ipmi_username: "{{ kolla_bifrost_inspector_ipmi_username }}"
      inspector_rule_var_ipmi_password: "{{ kolla_bifrost_inspector_ipmi_password }}"
      inspector_rule_var_redfish_username: "{{ kolla_bifrost_inspector_ipmi_username }}"
      inspector_rule_var_redfish_password: "{{ kolla_bifrost_inspector_ipmi_password }}"
      inspector_rule_var_lldp_switch_port_interface: "{{ kolla_bifrost_inspector_lldp_switch_port_interface }}"
      inspector_rule_var_deploy_kernel: "{{ kolla_bifrost_inspector_deploy_kernel }}"
      inspector_rule_var_deploy_ramdisk: "{{ kolla_bifrost_inspector_deploy_ramdisk }}"
      when: kolla_enable_bifrost | bool
