Create a baremetal-compute group for baremetal compute nodes

The compute group was used in a few places, but this now overlaps with
the group used for virtualised compute nodes.
This commit is contained in:
Mark Goddard 2017-11-11 08:28:53 +00:00
parent aee86e5136
commit 697b2eecc2
7 changed files with 40 additions and 28 deletions

View File

@ -1,8 +1,8 @@
---
- include: dell-compute-node-inventory.yml
- name: Ensure compute nodes are PXE booted
hosts: compute
- name: Ensure baremetal compute nodes are PXE booted
hosts: baremetal-compute
gather_facts: no
vars:
controller_host: "{{ groups['controllers'][0] }}"
@ -19,7 +19,7 @@
# be respected when using delegate_to.
ansible_host: "{{ hostvars[controller_host].ansible_host | default(controller_host) }}"
- name: Ensure compute nodes are powered off
- name: Ensure baremetal compute nodes are powered off
command: ipmitool -U {{ ipmi_username }} -P {{ ipmi_password }} -H {{ ipmi_address }} -I lanplus chassis power off
delegate_to: "{{ controller_host }}"
vars:
@ -31,7 +31,7 @@
pause:
seconds: 5
- name: Ensure compute nodes are set to boot via PXE
- name: Ensure baremetal compute nodes are set to boot via PXE
command: ipmitool -U {{ ipmi_username }} -P {{ ipmi_password }} -H {{ ipmi_address }} -I lanplus chassis bootdev pxe
delegate_to: "{{ controller_host }}"
vars:
@ -43,7 +43,7 @@
pause:
seconds: 5
- name: Ensure compute nodes are powered on
- name: Ensure baremetal compute nodes are powered on
command: ipmitool -U {{ ipmi_username }} -P {{ ipmi_password }} -H {{ ipmi_address }} -I lanplus chassis power on
delegate_to: "{{ controller_host }}"
vars:

View File

@ -1,14 +1,14 @@
---
# This playbook will ensure that all compute nodes in the overcloud ironic
# inventory are available. Supported initial states include 'enroll' and
# This playbook will ensure that all baremetal compute nodes in the overcloud
# ironic inventory are available. Supported initial states include 'enroll' and
# 'manageable'.
- name: Ensure compute nodes are available in ironic
- name: Ensure baremetal compute nodes are available in ironic
hosts: controllers[0]
vars:
venv: "{{ virtualenv_path }}/shade"
# Set this to a colon-separated list of compute node hostnames to provide.
# If unset, all compute nodes will be provided.
# Set this to a colon-separated list of baremetal compute node hostnames to
# provide. If unset, all baremetal compute nodes will be provided.
compute_node_limit: ""
compute_node_limit_list: "{{ compute_node_limit.split(':') }}"
roles:
@ -74,7 +74,7 @@
- name: Fail if any ironic nodes are not available
fail:
msg: >
Failed to make compute node {{ item['Name'] }} available in ironic.
Failed to make baremetal compute node {{ item['Name'] }} available in ironic.
Provisioning state is {{ item['Provisioning State'] }}.
with_items: "{{ ironic_nodes }}"
when: item['Provisioning State'] != 'available'

View File

@ -1,11 +1,11 @@
---
# Set the boot mode (BIOS, UEFI) of Dell compute nodes.
# Set the boot mode (BIOS, UEFI) of Dell baremetal compute nodes.
# Add compute nodes to the Ansible inventory.
# Add Dell baremetal compute nodes to the Ansible inventory.
- include: dell-compute-node-boot-mode.yml
- name: Ensure compute nodes boot mode is set
hosts: compute
- name: Ensure Dell baremetal compute nodes boot mode is set
hosts: baremetal-compute
gather_facts: no
vars:
# Set this to the required boot mode. One of 'bios' or 'uefi'.

View File

@ -1,11 +1,11 @@
---
# Configure the compute nodes to PXE boot.
# Configure the Dell baremetal compute nodes to PXE boot.
# Add compute nodes to the Ansible inventory.
# Add Dell baremetal compute nodes to the Ansible inventory.
- include: dell-compute-node-inventory.yml
- name: Ensure compute nodes are PXE booted
hosts: compute
- name: Ensure Dell baremetal compute nodes are PXE booted
hosts: baremetal-compute
gather_facts: no
vars:
# Set this to the index of the inteface on which to enable PXE.

View File

@ -1,17 +1,18 @@
---
- name: Ensure compute nodes are present in the Ansible inventory
- name: Ensure Dell baremetal compute nodes are present in the Ansible inventory
hosts: config-mgmt
gather_facts: no
vars:
# Set this to a colon-separated list of compute node hostnames on which to
# trigger discovery. If unset, all compute nodes will be triggered.
# 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.
compute_node_limit: ""
compute_node_limit_list: "{{ compute_node_limit.split(':') }}"
tasks:
- name: Add hosts for the compute nodes
- name: Add hosts for the Dell baremetal compute nodes
add_host:
name: "{{ item.key }}"
groups: compute
groups: baremetal-compute
# SSH configuration to access the BMC.
ansible_host: "{{ item.value }}"
ansible_user: "{{ ipmi_username }}"
@ -24,8 +25,8 @@
- not compute_node_limit or item.key | replace('-idrac', '') in compute_node_limit_list
run_once: True
- name: Ensure compute nodes are present in the Ansible inventory
hosts: compute
- name: Ensure Dell baremetal compute nodes are present in the Ansible inventory
hosts: baremetal-compute
gather_facts: no
vars:
compute_node_limit: ""
@ -33,7 +34,9 @@
tasks:
- name: Set facts for the compute nodes for IPMI addresses
set_fact:
bmc_type: idrac
ipmi_address: "{{ idrac_network_ips[inventory_hostname] }}"
# Don't add hosts that already exist.
when: not compute_node_limit or inventory_hostname in compute_node_limit_list
when:
- not ipmi_address
- not compute_node_limit or inventory_hostname in compute_node_limit_list
run_once: True

View File

@ -32,6 +32,12 @@ network
monitoring
compute
###############################################################################
# Baremetal compute node groups.
[baremetal-compute]
# Empty group to provide declaration of baremetal-compute group.
###############################################################################
# Networking groups.

View File

@ -18,6 +18,9 @@ localhost ansible_connection=local
# Add controller nodes here if required. These hosts will provide the
# OpenStack overcloud.
[baremetal-compute]
# Add baremetal compute nodes here if required.
[mgmt-switches]
# Add management network switches here if required.