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

View File

@ -36,3 +36,13 @@ veth_node_source_suffix: '-tap'
# Directory in which to store Tenks logs. # Directory in which to store Tenks logs.
log_directory: /var/log/tenks/ 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 # By default, allow QEMU without hardware virtualisation since this is a
# development tool. # development tool.
libvirt_require_vt: false 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_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 - `vbmc_virtualenv_path`: The path to the virtualenv in which Virtual BMC is
installed. installed.
- `vbmc_ipmi_listen_address`: The address on which Virtual BMC will listen for - `vbmc_ipmi_address`: The address on which Virtual BMC will listen for IPMI
IPMI traffic. Default is 0.0.0.0. traffic.
- `vbmc_ipmi_port`: The port 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.
- `vbmc_ipmi_username`: The IPMI username that Virtual BMC will use. Default is - `vbmc_ipmi_password`: The IPMI password that Virtual BMC will use.
'username'.
- `vbmc_ipmi_password`: The IPMI password that Virtual BMC will use. Default is
'password'.
- `vbmc_log_directory`: The directory in which to store Virtual BMC logs. If - `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. # 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. # 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. # The IPMI username that VBMC will use.
vbmc_ipmi_username: username vbmc_ipmi_username:
# The IPMI password that VBMC will use. # 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. # The name of the Libvirt domain to be added to Virtual BMC.
vbmc_domain: vbmc_domain:
# The directory in which to store VBMC logs. # The directory in which to store VBMC logs.

View File

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