From 4e034b41fe04cd640657d9eed105e5d2083ab933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Ole=C5=9B?= Date: Fri, 23 Oct 2015 14:16:30 +0200 Subject: [PATCH] Add update action for nova_compute --- .../nova_compute_puppet/actions/update.pp | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 resources/nova_compute_puppet/actions/update.pp diff --git a/resources/nova_compute_puppet/actions/update.pp b/resources/nova_compute_puppet/actions/update.pp new file mode 100644 index 0000000..7837909 --- /dev/null +++ b/resources/nova_compute_puppet/actions/update.pp @@ -0,0 +1,68 @@ +$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, +} + +exec { 'networking-refresh': + command => '/sbin/ifdown -a ; /sbin/ifup -a', +} + +exec { 'post-nova_config': + command => '/bin/echo "Nova config has changed"', +} + +include nova::params + +package { 'nova-common': + name => $nova::params::common_package_name, + ensure => $ensure_package, +} + +notify { "restart nova compute": + notify => Service["nova-compute"], +}