Add nova compute resource
Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
This commit is contained in:
parent
041161cf17
commit
88d11981a3
105
resources/nova_compute_puppet/README.md
Normal file
105
resources/nova_compute_puppet/README.md
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
# Nova compute resource for puppet handler
|
||||||
|
|
||||||
|
Setup and configure the Nova compute service.
|
||||||
|
|
||||||
|
# Parameters
|
||||||
|
|
||||||
|
source https://github.com/openstack/puppet-nova_compute/blob/5.1.0/manifests/compute.pp
|
||||||
|
|
||||||
|
``enabled``
|
||||||
|
(optional) Whether to enable the nova-compute service
|
||||||
|
Defaults to false
|
||||||
|
|
||||||
|
``manage_service``
|
||||||
|
(optional) Whether to start/stop the service
|
||||||
|
Defaults to true
|
||||||
|
|
||||||
|
``ensure_package``
|
||||||
|
(optional) The state for the nova-compute package
|
||||||
|
Defaults to 'present'
|
||||||
|
|
||||||
|
``vnc_enabled``
|
||||||
|
(optional) Whether to use a VNC proxy
|
||||||
|
Defaults to true
|
||||||
|
|
||||||
|
``vncserver_proxyclient_address``
|
||||||
|
(optional) The IP address of the server running the VNC proxy client
|
||||||
|
Defaults to '127.0.0.1'
|
||||||
|
|
||||||
|
``vncproxy_host``
|
||||||
|
(optional) The host of the VNC proxy server
|
||||||
|
Defaults to false
|
||||||
|
|
||||||
|
``vncproxy_protocol``
|
||||||
|
(optional) The protocol to communicate with the VNC proxy server
|
||||||
|
Defaults to 'http'
|
||||||
|
|
||||||
|
``vncproxy_port``
|
||||||
|
(optional) The port to communicate with the VNC proxy server
|
||||||
|
Defaults to '6080'
|
||||||
|
|
||||||
|
``vncproxy_path``
|
||||||
|
(optional) The path at the end of the uri for communication with the VNC proxy server
|
||||||
|
Defaults to '/vnc_auto.html'
|
||||||
|
|
||||||
|
``vnc_keymap``
|
||||||
|
(optional) The keymap to use with VNC (ls -alh /usr/share/qemu/keymaps to list available keymaps)
|
||||||
|
Defaults to 'en-us'
|
||||||
|
|
||||||
|
``force_config_drive``
|
||||||
|
(optional) Whether to force the config drive to be attached to all VMs
|
||||||
|
Defaults to false
|
||||||
|
|
||||||
|
``virtio_nic``
|
||||||
|
(optional) Whether to use virtio for the nic driver of VMs
|
||||||
|
Defaults to false
|
||||||
|
|
||||||
|
``neutron_enabled``
|
||||||
|
(optional) Whether to use Neutron for networking of VMs
|
||||||
|
Defaults to true
|
||||||
|
|
||||||
|
``network_device_mtu``
|
||||||
|
(optional) The MTU size for the interfaces managed by nova
|
||||||
|
Defaults to undef
|
||||||
|
|
||||||
|
``instance_usage_audit``
|
||||||
|
(optional) Generate periodic compute.instance.exists notifications.
|
||||||
|
Defaults to false
|
||||||
|
|
||||||
|
``instance_usage_audit_period``
|
||||||
|
(optional) Time period to generate instance usages for.
|
||||||
|
Time period must be hour, day, month or year
|
||||||
|
Defaults to 'month'
|
||||||
|
|
||||||
|
``force_raw_images``
|
||||||
|
(optional) Force backing images to raw format.
|
||||||
|
Defaults to true
|
||||||
|
|
||||||
|
``reserved_host_memory``
|
||||||
|
Reserved host memory
|
||||||
|
The amount of memory in MB reserved for the host.
|
||||||
|
Defaults to '512'
|
||||||
|
|
||||||
|
``compute_manager``
|
||||||
|
Compute manager
|
||||||
|
The driver that will manage the running instances.
|
||||||
|
Defaults to nova.compute.manager.ComputeManager
|
||||||
|
|
||||||
|
``pci_passthrough_whitelist``
|
||||||
|
(optional) Pci passthrough hash in format of:
|
||||||
|
Defaults to undef
|
||||||
|
Example
|
||||||
|
"[ { 'vendor_id':'1234','product_id':'5678' },
|
||||||
|
{ 'vendor_id':'4321','product_id':'8765','physical_network':'default' } ] "
|
||||||
|
|
||||||
|
``default_availability_zone``
|
||||||
|
(optional) Default compute node availability zone.
|
||||||
|
Defaults to nova
|
||||||
|
|
||||||
|
``default_schedule_zone``
|
||||||
|
(optional) Availability zone to use when user doesn't specify one.
|
||||||
|
Defaults to undef
|
||||||
|
|
||||||
|
``internal_service_availability_zone``
|
||||||
|
(optional) The availability zone to show internal services under.
|
||||||
|
Defaults to internal
|
4
resources/nova_compute_puppet/actions/remove.pp
Normal file
4
resources/nova_compute_puppet/actions/remove.pp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
class { 'nova::compute':
|
||||||
|
ensure_package => 'absent',
|
||||||
|
enabled => false,
|
||||||
|
}
|
49
resources/nova_compute_puppet/actions/run.pp
Normal file
49
resources/nova_compute_puppet/actions/run.pp
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
$resource = hiera($::resource_name)
|
||||||
|
|
||||||
|
$ensure_package = $resource['input']['ensure_package']['value']
|
||||||
|
$vnc_enabled = $resource['input']['vnc_enabled']['value']
|
||||||
|
$vncserver_proxyclient_address = $resource['input']['vncserver_proxyclient_address']['value']
|
||||||
|
$vncproxy_host = $resource['input']['vncproxy_host']['value']
|
||||||
|
$vncproxy_protocol = $resource['input']['vncproxy_protocol']['value']
|
||||||
|
$vncproxy_port = $resource['input']['vncproxy_port']['value']
|
||||||
|
$vncproxy_path = $resource['input']['vncproxy_path']['value']
|
||||||
|
$vnc_keymap = $resource['input']['vnc_keymap']['value']
|
||||||
|
$force_config_drive = $resource['input']['force_config_drive']['value']
|
||||||
|
$virtio_nic = $resource['input']['virtio_nic']['value']
|
||||||
|
$neutron_enabled = $resource['input']['neutron_enabled']['value']
|
||||||
|
$network_device_mtu = $resource['input']['network_device_mtu']['value']
|
||||||
|
$instance_usage_audit = $resource['input']['instance_usage_audit']['value']
|
||||||
|
$instance_usage_audit_period = $resource['input']['instance_usage_audit_period']['value']
|
||||||
|
$force_raw_images = $resource['input']['force_raw_images']['value']
|
||||||
|
$reserved_host_memory = $resource['input']['reserved_host_memory']['value']
|
||||||
|
$compute_manager = $resource['input']['compute_manager']['value']
|
||||||
|
$pci_passthrough = $resource['input']['pci_passthrough']['value']
|
||||||
|
$default_availability_zone = $resource['input']['default_availability_zone']['value']
|
||||||
|
$default_schedule_zone = $resource['input']['default_schedule_zone']['value']
|
||||||
|
$internal_service_availability_zone = $resource['input']['internal_service_availability_zone']['value']
|
||||||
|
|
||||||
|
class { 'nova::compute':
|
||||||
|
enabled => true,
|
||||||
|
manage_service => true,
|
||||||
|
ensure_package => $ensure_package,
|
||||||
|
vnc_enabled => $vnc_enabled,
|
||||||
|
vncserver_proxyclient_address => $vncserver_proxyclient_address,
|
||||||
|
vncproxy_host => $vncproxy_host,
|
||||||
|
vncproxy_protocol => $vncproxy_protocol,
|
||||||
|
vncproxy_port => $vncproxy_port,
|
||||||
|
vncproxy_path => $vncproxy_path,
|
||||||
|
vnc_keymap => $vnc_keymap,
|
||||||
|
force_config_drive => $force_config_drive,
|
||||||
|
virtio_nic => $virtio_nic,
|
||||||
|
neutron_enabled => $neutron_enabled,
|
||||||
|
network_device_mtu => $network_device_mtu,
|
||||||
|
instance_usage_audit => $instance_usage_audit,
|
||||||
|
instance_usage_audit_period => $instance_usage_audit_period,
|
||||||
|
force_raw_images => $force_raw_images,
|
||||||
|
reserved_host_memory => $reserved_host_memory,
|
||||||
|
compute_manager => $compute_manager,
|
||||||
|
pci_passthrough => $pci_passthrough,
|
||||||
|
default_availability_zone => $default_availability_zone,
|
||||||
|
default_schedule_zone => $default_schedule_zone,
|
||||||
|
internal_service_availability_zone => $internal_service_availability_zone,
|
||||||
|
}
|
84
resources/nova_compute_puppet/meta.yaml
Normal file
84
resources/nova_compute_puppet/meta.yaml
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
id: nova_compute
|
||||||
|
handler: puppet
|
||||||
|
puppet_module: nova
|
||||||
|
version: 1.0.0
|
||||||
|
input:
|
||||||
|
ensure_package:
|
||||||
|
schema: str
|
||||||
|
value: 'present'
|
||||||
|
vnc_enabled:
|
||||||
|
schema: bool
|
||||||
|
value: true
|
||||||
|
vncserver_proxyclient_address:
|
||||||
|
schema: str
|
||||||
|
value: '127.0.0.1'
|
||||||
|
vncproxy_host:
|
||||||
|
schema: str
|
||||||
|
value: ''
|
||||||
|
vncproxy_protocol:
|
||||||
|
schema: str
|
||||||
|
value: 'http'
|
||||||
|
vncproxy_port:
|
||||||
|
schema: int
|
||||||
|
value: 6080
|
||||||
|
vncproxy_path:
|
||||||
|
schema: str
|
||||||
|
value: '/vnc_auto.html'
|
||||||
|
vnc_keymap:
|
||||||
|
schema: str
|
||||||
|
value: 'en-us'
|
||||||
|
force_config_drive:
|
||||||
|
schema: bool
|
||||||
|
value: false
|
||||||
|
virtio_nic:
|
||||||
|
schema: bool
|
||||||
|
value: false
|
||||||
|
neutron_enabled:
|
||||||
|
schema: bool
|
||||||
|
value: true
|
||||||
|
network_device_mtu:
|
||||||
|
schema: str
|
||||||
|
value: ''
|
||||||
|
instance_usage_audit:
|
||||||
|
schema: bool
|
||||||
|
value: false
|
||||||
|
instance_usage_audit_period:
|
||||||
|
schema: str
|
||||||
|
value: 'month'
|
||||||
|
force_raw_images:
|
||||||
|
schema: bool
|
||||||
|
value: true
|
||||||
|
reserved_host_memory:
|
||||||
|
schema: int
|
||||||
|
value: 512
|
||||||
|
compute_manager:
|
||||||
|
schema: str
|
||||||
|
value: 'nova.compute.manager.ComputeManager'
|
||||||
|
pci_passthrough:
|
||||||
|
schema: str
|
||||||
|
value: ''
|
||||||
|
default_availability_zone:
|
||||||
|
schema: str
|
||||||
|
value: 'nova'
|
||||||
|
default_schedule_zone:
|
||||||
|
schema: str
|
||||||
|
value: ''
|
||||||
|
internal_service_availability_zone:
|
||||||
|
schema: str
|
||||||
|
value: 'internal'
|
||||||
|
|
||||||
|
git:
|
||||||
|
schema: {repository: str!, branch: str!}
|
||||||
|
value: {repository: 'https://github.com/openstack/puppet-nova', branch: '5.1.0'}
|
||||||
|
|
||||||
|
ip:
|
||||||
|
schema: str!
|
||||||
|
value:
|
||||||
|
ssh_key:
|
||||||
|
schema: str!
|
||||||
|
value:
|
||||||
|
ssh_user:
|
||||||
|
schema: str!
|
||||||
|
value:
|
||||||
|
|
||||||
|
tags: [resource/nova_compute_service, resources/nova_compute, resources/nova]
|
Loading…
Reference in New Issue
Block a user