2017-03-15 14:39:52 +00:00
|
|
|
---
|
2017-11-13 19:15:48 +00:00
|
|
|
- name: Check whether Ironic is enabled
|
|
|
|
hosts: controllers
|
2017-12-19 14:42:18 +00:00
|
|
|
tags:
|
|
|
|
- introspection-rules
|
2017-11-13 19:15:48 +00:00
|
|
|
tasks:
|
|
|
|
- name: Create controllers group with ironic enabled
|
|
|
|
group_by:
|
2018-03-05 17:05:54 +00:00
|
|
|
key: "controllers_for_introspection_rules_{{ kolla_enable_ironic | bool }}"
|
2017-11-13 19:15:48 +00:00
|
|
|
|
2017-07-28 12:23:17 +00:00
|
|
|
- name: Ensure introspection rules are registered in Ironic Inspector
|
2017-03-15 14:39:52 +00:00
|
|
|
# Only required to run on a single host.
|
2018-03-05 17:05:54 +00:00
|
|
|
hosts: controllers_for_introspection_rules_True[0]
|
2017-11-13 19:15:48 +00:00
|
|
|
gather_facts: False
|
2017-12-19 14:42:18 +00:00
|
|
|
tags:
|
|
|
|
- introspection-rules
|
2017-03-15 14:39:52 +00:00
|
|
|
vars:
|
2017-07-28 12:23:17 +00:00
|
|
|
venv: "{{ virtualenv_path }}/shade"
|
2017-04-05 10:05:45 +00:00
|
|
|
pre_tasks:
|
|
|
|
- name: Validate OpenStack password authentication parameters
|
|
|
|
fail:
|
|
|
|
msg: >
|
|
|
|
Required OpenStack authentication parameter {{ item }} is
|
|
|
|
{% if item in openstack_auth %}empty{% else %}not present{% endif %}
|
|
|
|
in openstack_auth. Have you sourced the environment file?
|
|
|
|
when:
|
2017-10-19 10:36:35 +00:00
|
|
|
- openstack_auth_type == 'password'
|
|
|
|
- item not in openstack_auth or not openstack_auth[item]
|
2017-04-05 10:05:45 +00:00
|
|
|
with_items: "{{ openstack_auth_password_required_params }}"
|
|
|
|
tags:
|
|
|
|
- config-validation
|
|
|
|
|
2017-08-14 17:47:04 +00:00
|
|
|
- name: Ensure the openstack client is installed
|
|
|
|
include_role:
|
|
|
|
name: stackhpc.os-openstackclient
|
2017-09-12 15:55:54 +00:00
|
|
|
vars:
|
2017-08-14 17:47:04 +00:00
|
|
|
os_openstackclient_venv: "{{ venv }}"
|
2018-08-01 17:49:50 +00:00
|
|
|
os_openstackclient_install_epel: "{{ yum_install_epel }}"
|
2017-03-15 14:39:52 +00:00
|
|
|
|
|
|
|
- name: Retrieve the IPA kernel Glance image UUID
|
|
|
|
shell: >
|
|
|
|
source {{ venv }}/bin/activate &&
|
|
|
|
openstack image show '{{ ipa_images_kernel_name }}' -f value -c id
|
|
|
|
changed_when: False
|
|
|
|
register: ipa_kernel_id
|
|
|
|
environment: "{{ openstack_auth_env }}"
|
|
|
|
|
|
|
|
- name: Retrieve the IPA ramdisk Glance image UUID
|
|
|
|
shell: >
|
|
|
|
source {{ venv }}/bin/activate &&
|
|
|
|
openstack image show '{{ ipa_images_ramdisk_name }}' -f value -c id
|
|
|
|
changed_when: False
|
|
|
|
register: ipa_ramdisk_id
|
|
|
|
environment: "{{ openstack_auth_env }}"
|
|
|
|
|
|
|
|
roles:
|
|
|
|
- role: ironic-inspector-rules
|
2018-08-01 17:49:50 +00:00
|
|
|
os_shade_install_epel: "{{ yum_install_epel }}"
|
2017-03-15 14:39:52 +00:00
|
|
|
ironic_inspector_venv: "{{ venv }}"
|
|
|
|
ironic_inspector_auth_type: "{{ openstack_auth_type }}"
|
|
|
|
ironic_inspector_auth: "{{ openstack_auth }}"
|
2019-01-22 16:59:24 +00:00
|
|
|
ironic_inspector_cacert: "{{ openstack_cacert }}"
|
2017-03-15 14:39:52 +00:00
|
|
|
ironic_inspector_rules: "{{ inspector_rules }}"
|
|
|
|
# These variables may be referenced in the introspection rules.
|
|
|
|
inspector_rule_var_ipmi_username: "{{ inspector_ipmi_username }}"
|
|
|
|
inspector_rule_var_ipmi_password: "{{ inspector_ipmi_password }}"
|
2017-10-20 11:14:17 +00:00
|
|
|
inspector_rule_var_lldp_switch_port_interface: "{{ inspector_lldp_switch_port_interface_default }}"
|
2017-03-15 14:39:52 +00:00
|
|
|
inspector_rule_var_deploy_kernel: "{{ ipa_kernel_id.stdout }}"
|
|
|
|
inspector_rule_var_deploy_ramdisk: "{{ ipa_ramdisk_id.stdout }}"
|