Extract IPMI configuration out of role

This is required for Ironic enrolment as well as Virtual BMC
configuration.
This commit is contained in:
Will Miller 2018-08-30 11:29:49 +00:00
parent 317bcf964c
commit 2d214adef3
6 changed files with 26 additions and 22 deletions

View File

@ -40,14 +40,13 @@
# Loop over each physical network for each node allocated to this host.
# Allocations are stored in localhost's vars.
loop: >-
{{ hostvars['localhost'].allocations.result[inventory_hostname]
{{ hostvars.localhost.allocations.result[inventory_hostname]
| default([]) | subelements('physical_networks') }}
- hosts: libvirt
vars:
# Allocations are stored in the localhost's vars.
nodes: >-
{{ hostvars['localhost'].allocations.result[inventory_hostname]
{{ hostvars.localhost.allocations.result[inventory_hostname]
| default([]) }}
tasks:
- name: Create Libvirt VMs
@ -77,6 +76,9 @@
name: virtualbmc-domain
vars:
vbmc_domain: "{{ domain }}"
vbmc_ipmi_address: "{{ ipmi_address }}"
vbmc_ipmi_username: "{{ ipmi_username }}"
vbmc_ipmi_password: "{{ ipmi_password }}"
vbmc_ipmi_port: "{{ ipmi_port_range_start + port_offset }}"
vbmc_virtualenv_path: "{{ virtualenv_path }}"
vbmc_log_directory: "{{ log_directory }}"

View File

@ -36,3 +36,13 @@ veth_node_source_suffix: '-tap'
# Directory in which to store Tenks logs.
log_directory: /var/log/tenks/
# The address on which VBMC will listen for node IPMI communication.
ipmi_address: 0.0.0.0
# The range of ports available for use for node IPMI communication.
ipmi_port_range_start: 6230
ipmi_port_range_end: 6240
# The username to use for node IPMI communication.
ipmi_username: username
# The password to use for node IPMI communication.
ipmi_password: password

View File

@ -11,7 +11,3 @@ libvirt_pool_group: "{{ ansible_user_id }}"
# By default, allow QEMU without hardware virtualisation since this is a
# development tool.
libvirt_require_vt: false
# The range of ports available for use for node IPMI traffic.
ipmi_port_range_start: 6230
ipmi_port_range_end: 6240

View File

@ -15,13 +15,10 @@ Role Variables
- `vbmc_domain`: The name of the Libvirt domain to be added to Virtual BMC.
- `vbmc_virtualenv_path`: The path to the virtualenv in which Virtual BMC is
installed.
- `vbmc_ipmi_listen_address`: The address on which Virtual BMC will listen for
IPMI traffic. Default is 0.0.0.0.
- `vbmc_ipmi_address`: The address on which Virtual BMC will listen for IPMI
traffic.
- `vbmc_ipmi_port`: The port on which Virtual BMC will listen for IPMI traffic.
Default is 6230.
- `vbmc_ipmi_username`: The IPMI username that Virtual BMC will use. Default is
'username'.
- `vbmc_ipmi_password`: The IPMI password that Virtual BMC will use. Default is
'password'.
- `vbmc_ipmi_username`: The IPMI username that Virtual BMC will use.
- `vbmc_ipmi_password`: The IPMI password that Virtual BMC will use.
- `vbmc_log_directory`: The directory in which to store Virtual BMC logs. If
`None`, output will not be logged to a file. Default is `None`.
not overridden from `None`, output will not be logged to a file.

View File

@ -1,13 +1,12 @@
---
# The address on which VBMC will listen for IPMI traffic for this domain.
vbmc_ipmi_listen_address: 0.0.0.0
vbmc_listen_address:
# The port on which VBMC will listen for IPMI traffic for this domain.
vbmc_ipmi_port: 6230
vbmc_ipmi_port:
# The IPMI username that VBMC will use.
vbmc_ipmi_username: username
vbmc_ipmi_username:
# The IPMI password that VBMC will use.
vbmc_ipmi_password: password
vbmc_ipmi_password:
# The name of the Libvirt domain to be added to Virtual BMC.
vbmc_domain:
# The directory in which to store VBMC logs.

View File

@ -30,7 +30,7 @@
# Check here to be safe.
- name: Wait to ensure socket is closed
wait_for:
host: "{{ vbmc_ipmi_listen_address }}"
host: "{{ vbmc_ipmi_address }}"
port: "{{ vbmc_ipmi_port }}"
state: stopped
timeout: 15
@ -41,7 +41,7 @@
--port {{ vbmc_ipmi_port }}
--username '{{ vbmc_ipmi_username }}'
--password '{{ vbmc_ipmi_password }}'
--address {{ vbmc_ipmi_listen_address }}
--address {{ vbmc_ipmi_address }}
become: true
- name: Ensure domain is started in VBMC