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

View File

@ -1,14 +1,14 @@
--- ---
# This playbook will ensure that all compute nodes in the overcloud ironic # This playbook will ensure that all baremetal compute nodes in the overcloud
# inventory are available. Supported initial states include 'enroll' and # ironic inventory are available. Supported initial states include 'enroll' and
# 'manageable'. # 'manageable'.
- name: Ensure compute nodes are available in ironic - name: Ensure baremetal compute nodes are available in ironic
hosts: controllers[0] hosts: controllers[0]
vars: vars:
venv: "{{ virtualenv_path }}/shade" venv: "{{ virtualenv_path }}/shade"
# Set this to a colon-separated list of compute node hostnames to provide. # Set this to a colon-separated list of baremetal compute node hostnames to
# If unset, all compute nodes will be provided. # provide. If unset, all baremetal compute nodes will be provided.
compute_node_limit: "" compute_node_limit: ""
compute_node_limit_list: "{{ compute_node_limit.split(':') }}" compute_node_limit_list: "{{ compute_node_limit.split(':') }}"
roles: roles:
@ -74,7 +74,7 @@
- name: Fail if any ironic nodes are not available - name: Fail if any ironic nodes are not available
fail: fail:
msg: > 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'] }}. Provisioning state is {{ item['Provisioning State'] }}.
with_items: "{{ ironic_nodes }}" with_items: "{{ ironic_nodes }}"
when: item['Provisioning State'] != 'available' 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 - include: dell-compute-node-boot-mode.yml
- name: Ensure compute nodes boot mode is set - name: Ensure Dell baremetal compute nodes boot mode is set
hosts: compute hosts: baremetal-compute
gather_facts: no gather_facts: no
vars: vars:
# Set this to the required boot mode. One of 'bios' or 'uefi'. # 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 - include: dell-compute-node-inventory.yml
- name: Ensure compute nodes are PXE booted - name: Ensure Dell baremetal compute nodes are PXE booted
hosts: compute hosts: baremetal-compute
gather_facts: no gather_facts: no
vars: vars:
# Set this to the index of the inteface on which to enable PXE. # 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 hosts: config-mgmt
gather_facts: no gather_facts: no
vars: vars:
# Set this to a colon-separated list of compute node hostnames on which to # Set this to a colon-separated list of baremeal compute node hostnames on
# trigger discovery. If unset, all compute nodes will be triggered. # which to trigger discovery. If unset, all compute nodes will be
# triggered.
compute_node_limit: "" compute_node_limit: ""
compute_node_limit_list: "{{ compute_node_limit.split(':') }}" compute_node_limit_list: "{{ compute_node_limit.split(':') }}"
tasks: tasks:
- name: Add hosts for the compute nodes - name: Add hosts for the Dell baremetal compute nodes
add_host: add_host:
name: "{{ item.key }}" name: "{{ item.key }}"
groups: compute groups: baremetal-compute
# SSH configuration to access the BMC. # SSH configuration to access the BMC.
ansible_host: "{{ item.value }}" ansible_host: "{{ item.value }}"
ansible_user: "{{ ipmi_username }}" ansible_user: "{{ ipmi_username }}"
@ -24,8 +25,8 @@
- not compute_node_limit or item.key | replace('-idrac', '') in compute_node_limit_list - not compute_node_limit or item.key | replace('-idrac', '') in compute_node_limit_list
run_once: True run_once: True
- name: Ensure compute nodes are present in the Ansible inventory - name: Ensure Dell baremetal compute nodes are present in the Ansible inventory
hosts: compute hosts: baremetal-compute
gather_facts: no gather_facts: no
vars: vars:
compute_node_limit: "" compute_node_limit: ""
@ -33,7 +34,9 @@
tasks: tasks:
- name: Set facts for the compute nodes for IPMI addresses - name: Set facts for the compute nodes for IPMI addresses
set_fact: set_fact:
bmc_type: idrac
ipmi_address: "{{ idrac_network_ips[inventory_hostname] }}" ipmi_address: "{{ idrac_network_ips[inventory_hostname] }}"
# Don't add hosts that already exist. when:
when: not compute_node_limit or inventory_hostname in compute_node_limit_list - not ipmi_address
- not compute_node_limit or inventory_hostname in compute_node_limit_list
run_once: True run_once: True

View File

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

View File

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