kayobe/ansible/roles/ironic-inspector-rules
Jakub Darmach dbcc3f4ae3 Use new collections in Kayobe
Refactored the code to switch the distribution source of the roles
to new collections for the roles that have already been migrated into
collections.

Updated:

 - requirements
 - role invocations
 - documentation
 - release notes
 - minor whitespace fixes

Change-Id: I8dbb88aa2061b3afcab07caeb30f45b3a5c939af
2024-03-27 15:07:08 +00:00
..
defaults Support authentication in Bifrost 2022-08-25 11:56:03 +02:00
library Bump up Ansible supported versions to 7.x/8.x 2023-11-07 18:33:06 +01:00
meta Use new collections in Kayobe 2024-03-27 15:07:08 +00:00
tasks Support authentication in Bifrost 2022-08-25 11:56:03 +02:00
README.md Support authentication in Bifrost 2022-08-25 11:56:03 +02:00

Ironic Inspector Rules

This role provides a module, os_ironic_inspector_rule, which may be used to configure an introspection rule in OpenStack ironic inspector. The role installs required python dependencies in a virtualenv, and uses the os_ironic_inspector_rule module to configure a set of rules.

Requirements

The OpenStack ironic inspector API should be accessible from the target host.

Role Variables

ironic_inspector_venv is a path to a directory in which to create a virtualenv.

ironic_inspector_auth_type is an authentication type compatible with the auth_type argument of os_* Ansible modules.

ironic_inspector_auth is a dict containing authentication information compatible with the auth argument of os_* Ansible modules.

ironic_inspector_cacert is an optional path to a CA certificate.

ironic_inspector_cloud is the name of a cloud in clouds.yaml.

ironic_inspector_rules is a list of introspection rules which should exist. See the Inspector rules API for details of parameters available for rules.

Dependencies

This role depends on the Kayobe openstacksdk role.

Example Playbook

The following playbook configures an introspection rule to set the IPMI username and password fields in a node's driver info if they are currently empty.

---
- name: Ensure ironic inspector introspection rules are configured
  hosts: ironic-inspector
  roles:
    - role: ironic-inspector-rules
      ironic_inspector_venv: "~/ironic-inspector-rules-venv"
      ironic_inspector_auth_type: "password"
      ironic_inspector_auth:
        project_name: <keystone project>
        username: <keystone user>
        password: <keystone password>
        auth_url: <keystone auth URL>
      ironic_inspector_rules:
        - description: "Set IPMI driver_info if no credentials"
          conditions:
            - field: "node://driver_info.ipmi_username"
              op: "is-empty"
            - field: "node://driver_info.ipmi_password"
              op: "is-empty"
          actions:
            - action: "set-attribute"
              path: "driver_info/ipmi_username"
              value: "<IPMI username>"
            - action: "set-attribute"
              path: "driver_info/ipmi_password"
              value: "<IPMI password>"

Author Information