Change-Id: Ibff5911f5a9777683cf86f7c654a58020796c00a
3.3 KiB
Metalsmith Deployment
This role deploys instances using metalsmith CLI.
Variables
The only required variable is:
metalsmith_instances
-
list of instances to provision, see Instance for instance description.
The following optional variables provide the defaults for Instance attributes:
metalsmith_extra_args
-
the default for
extra_args
. metalsmith_image
-
the default for
image
. metalsmith_capabilities
-
the default for
capabilities
. metalsmith_netboot
-
the default for
netboot
metalsmith_nics
-
the default for
nics
. metalsmith_resource_class
-
the default for
resource_class
. metalsmith_root_size
-
the default for
root_size
. metalsmith_ssh_public_keys
-
the default for
ssh_public_keys
.
Instance
Each instances has the following attributes:
extra_args
(defaults tometalsmith_extra_args
)-
additional arguments to pass to the
metalsmith
CLI on all calls. image
(defaults tometalsmith_image
)-
UUID or name of the image to use for deployment. Mandatory.
capabilities
(defaults tometalsmith_capabilities
)-
node capabilities to request when scheduling.
netboot
-
whether to boot the deployed instance from network (PXE, iPXE, etc). The default is to use local boot (requires a bootloader on the image).
nics
(defaults tometalsmith_nics
)-
list of virtual NICs to attach to node's physical NICs. Each is an object with exactly one attribute:
network
-
creates a port on the given network, for example:
nics: - network: private - network: ctlplane
port
-
uses the provided pre-created port:
nics: - port: b2254316-7867-4615-9fb7-911b3f38ca2a
resource_class
(defaults tometalsmith_resource_class
)-
requested node's resource class. Mandatory.
root_size
(defaults tometalsmith_root_size
)-
size of the root partition, if partition images are used.
Note
Also required for whole-disk images due to how the Bare Metal service currently works.
ssh_public_keys
(defaults tometalsmith_ssh_public_keys
)-
list of file names with SSH public keys to put to the node.
Example
---
- hosts: all
tasks:
- include_role:
name: metalsmith_deployment
vars:
metalsmith_image: centos7
metalsmith_nics:
- network: ctlplane
metalsmith_ssh_public_keys:
- /home/user/.ssh/id_rsa.pub
metalsmith_instances:
- hostname: compute-0
resource_class: compute
root_size: 100
capabilities:
boot_mode: uefi
- hostname: compute-1
resource_class: compute
root_size: 100
capabilities:
boot_mode: uefi
- hostname: control-0
resource_class: control
capabilities:
boot_mode: uefi
nics:
- network: ctlplane
- port: 1899af15-149d-47dc-b0dc-a68614eeb5c4