2017-04-26 14:33:48 +00:00
|
|
|
---
|
2017-11-11 08:28:53 +00:00
|
|
|
- name: Ensure Dell baremetal compute nodes are present in the Ansible inventory
|
2017-11-30 18:26:55 +00:00
|
|
|
hosts: localhost
|
2017-04-26 14:33:48 +00:00
|
|
|
gather_facts: no
|
|
|
|
vars:
|
2017-11-11 08:28:53 +00:00
|
|
|
# Set this to a colon-separated list of baremeal compute node hostnames on
|
|
|
|
# which to trigger discovery. If unset, all compute nodes will be
|
|
|
|
# triggered.
|
2017-04-26 14:33:48 +00:00
|
|
|
compute_node_limit: ""
|
|
|
|
compute_node_limit_list: "{{ compute_node_limit.split(':') }}"
|
|
|
|
tasks:
|
2017-11-11 08:28:53 +00:00
|
|
|
- name: Add hosts for the Dell baremetal compute nodes
|
2017-04-26 14:33:48 +00:00
|
|
|
add_host:
|
|
|
|
name: "{{ item.key }}"
|
2017-11-11 08:28:53 +00:00
|
|
|
groups: baremetal-compute
|
2017-04-26 14:33:48 +00:00
|
|
|
# SSH configuration to access the BMC.
|
|
|
|
ansible_host: "{{ item.value }}"
|
|
|
|
ansible_user: "{{ ipmi_username }}"
|
|
|
|
ansible_ssh_pass: "{{ ipmi_password }}"
|
|
|
|
with_dict: "{{ idrac_network_ips }}"
|
|
|
|
# Don't add hosts that already exist.
|
|
|
|
when:
|
2017-10-19 10:36:35 +00:00
|
|
|
- item.key not in groups['all']
|
|
|
|
- item.key | replace('-idrac', '') not in groups['all']
|
|
|
|
- not compute_node_limit or item.key | replace('-idrac', '') in compute_node_limit_list
|
2017-04-26 14:33:48 +00:00
|
|
|
run_once: True
|
2017-06-28 16:23:28 +00:00
|
|
|
|
2017-11-11 08:28:53 +00:00
|
|
|
- name: Ensure Dell baremetal compute nodes are present in the Ansible inventory
|
|
|
|
hosts: baremetal-compute
|
2017-06-28 16:23:28 +00:00
|
|
|
gather_facts: no
|
2021-11-09 17:23:24 +00:00
|
|
|
max_fail_percentage: >-
|
|
|
|
{{ dell_compute_node_inventory_fail_percentage |
|
|
|
|
default(baremetal_compute_max_fail_percentage) |
|
|
|
|
default(kayobe_max_fail_percentage) |
|
|
|
|
default(100) }}
|
2017-06-28 16:23:28 +00:00
|
|
|
vars:
|
|
|
|
compute_node_limit: ""
|
|
|
|
compute_node_limit_list: "{{ compute_node_limit.split(':') }}"
|
|
|
|
tasks:
|
|
|
|
- name: Set facts for the compute nodes for IPMI addresses
|
|
|
|
set_fact:
|
2017-11-11 08:28:53 +00:00
|
|
|
bmc_type: idrac
|
2017-06-28 16:23:28 +00:00
|
|
|
ipmi_address: "{{ idrac_network_ips[inventory_hostname] }}"
|
2017-11-11 08:28:53 +00:00
|
|
|
when:
|
|
|
|
- not ipmi_address
|
|
|
|
- not compute_node_limit or inventory_hostname in compute_node_limit_list
|
2017-06-28 16:23:28 +00:00
|
|
|
run_once: True
|