diff --git a/resources/cinder_api_puppet/actions/update.pp b/resources/cinder_api_puppet/actions/update.pp new file mode 100644 index 00000000..f0eae3f4 --- /dev/null +++ b/resources/cinder_api_puppet/actions/update.pp @@ -0,0 +1,56 @@ +$resource = hiera($::resource_name) + +$keystone_password = $resource['input']['keystone_password']['value'] +$keystone_enabled = $resource['input']['keystone_enabled']['value'] +$keystone_tenant = $resource['input']['keystone_tenant']['value'] +$keystone_user = $resource['input']['keystone_user']['value'] +$keystone_auth_host = $resource['input']['keystone_auth_host']['value'] +$keystone_auth_port = $resource['input']['keystone_auth_port']['value'] +$keystone_auth_protocol = $resource['input']['keystone_auth_protocol']['value'] +$keystone_auth_admin_prefix = $resource['input']['keystone_auth_admin_prefix']['value'] +$keystone_auth_uri = $resource['input']['keystone_auth_uri']['value'] +$os_region_name = $resource['input']['os_region_name']['value'] +$service_port = $resource['input']['service_port']['value'] +$service_workers = $resource['input']['service_workers']['value'] +$package_ensure = $resource['input']['package_ensure']['value'] +$bind_host = $resource['input']['bind_host']['value'] +$ratelimits = $resource['input']['ratelimits']['value'] +$default_volume_type = $resource['input']['default_volume_type']['value'] +$ratelimits_factory = $resource['input']['ratelimits_factory']['value'] +$validate = $resource['input']['validate']['value'] +$validation_options = $resource['input']['validation_options']['value'] + +include cinder::params + +package { 'cinder': + ensure => $package_ensure, + name => $::cinder::params::package_name, +} -> + +class {'cinder::api': + keystone_password => $keystone_password, + keystone_enabled => $keystone_enabled, + keystone_tenant => $keystone_tenant, + keystone_user => $keystone_user, + keystone_auth_host => $keystone_auth_host, + keystone_auth_port => $keystone_auth_port, + keystone_auth_protocol => $keystone_auth_protocol, + keystone_auth_admin_prefix => $keystone_auth_admin_prefix, + keystone_auth_uri => $keystone_auth_uri, + os_region_name => $os_region_name, + service_port => $service_port, + service_workers => $service_workers, + package_ensure => $package_ensure, + bind_host => $bind_host, + enabled => true, + manage_service => true, + ratelimits => $ratelimits, + default_volume_type => $default_volume_type, + ratelimits_factory => $ratelimits_factory, + validate => $validate, + validation_options => $validation_options, +} + +notify { "restart cinder api": + notify => Service["cinder-api"], +} diff --git a/resources/cinder_puppet/actions/update.pp b/resources/cinder_puppet/actions/update.pp new file mode 100644 index 00000000..d8daffd9 --- /dev/null +++ b/resources/cinder_puppet/actions/update.pp @@ -0,0 +1,116 @@ +$resource = hiera($::resource_name) + +$ip = $resource['input']['ip']['value'] + +$db_user = $resource['input']['db_user']['value'] +$db_password = $resource['input']['db_password']['value'] +$db_name = $resource['input']['db_name']['value'] +$db_host = $resource['input']['db_host']['value'] +$db_port = $resource['input']['db_port']['value'] + +$database_connection = $resource['input']['database_connection']['value'] +$database_idle_timeout = $resource['input']['database_idle_timeout']['value'] +$database_min_pool_size = $resource['input']['database_min_pool_size']['value'] +$database_max_pool_size = $resource['input']['database_max_pool_size']['value'] +$database_max_retries = $resource['input']['database_max_retries']['value'] +$database_retry_interval = $resource['input']['database_retry_interval']['value'] +$database_max_overflow = $resource['input']['database_max_overflow']['value'] +$rpc_backend = $resource['input']['rpc_backend']['value'] +$control_exchange = $resource['input']['control_exchange']['value'] +$rabbit_host = $resource['input']['rabbit_host']['value'] +$rabbit_port = $resource['input']['rabbit_port']['value'] +$rabbit_hosts = $resource['input']['rabbit_hosts']['value'] +$rabbit_virtual_host = $resource['input']['rabbit_virtual_host']['value'] +$rabbit_userid = $resource['input']['rabbit_userid']['value'] +$rabbit_password = $resource['input']['rabbit_password']['value'] +$rabbit_use_ssl = $resource['input']['rabbit_use_ssl']['value'] +$kombu_ssl_ca_certs = $resource['input']['kombu_ssl_ca_certs']['value'] +$kombu_ssl_certfile = $resource['input']['kombu_ssl_certfile']['value'] +$kombu_ssl_keyfile = $resource['input']['kombu_ssl_keyfile']['value'] +$kombu_ssl_version = $resource['input']['kombu_ssl_version']['value'] +$amqp_durable_queues = $resource['input']['amqp_durable_queues']['value'] +$qpid_hostname = $resource['input']['qpid_hostname']['value'] +$qpid_port = $resource['input']['qpid_port']['value'] +$qpid_username = $resource['input']['qpid_username']['value'] +$qpid_password = $resource['input']['qpid_password']['value'] +$qpid_sasl_mechanisms = $resource['input']['qpid_sasl_mechanisms']['value'] +$qpid_reconnect = $resource['input']['qpid_reconnect']['value'] +$qpid_reconnect_timeout = $resource['input']['qpid_reconnect_timeout']['value'] +$qpid_reconnect_limit = $resource['input']['qpid_reconnect_limit']['value'] +$qpid_reconnect_interval_min = $resource['input']['qpid_reconnect_interval_min']['value'] +$qpid_reconnect_interval_max = $resource['input']['qpid_reconnect_interval_max']['value'] +$qpid_reconnect_interval = $resource['input']['qpid_reconnect_interval']['value'] +$qpid_heartbeat = $resource['input']['qpid_heartbeat']['value'] +$qpid_protocol = $resource['input']['qpid_protocol']['value'] +$qpid_tcp_nodelay = $resource['input']['qpid_tcp_nodelay']['value'] +$package_ensure = $resource['input']['package_ensure']['value'] +$use_ssl = $resource['input']['use_ssl']['value'] +$ca_file = $resource['input']['ca_file']['value'] +$cert_file = $resource['input']['cert_file']['value'] +$key_file = $resource['input']['key_file']['value'] +$api_paste_config = $resource['input']['api_paste_config']['value'] +$use_syslog = $resource['input']['use_syslog']['value'] +$log_facility = $resource['input']['log_facility']['value'] +$log_dir = $resource['input']['log_dir']['value'] +$verbose = $resource['input']['verbose']['value'] +$debug = $resource['input']['debug']['value'] +$storage_availability_zone = $resource['input']['storage_availability_zone']['value'] +$default_availability_zone = $resource['input']['default_availability_zone']['value'] +$mysql_module = $resource['input']['mysql_module']['value'] +# Do not apply the legacy stuff +#$sql_connection = $resource['input']['sql_connection']['value'] +$sql_idle_timeout = $resource['input']['sql_idle_timeout']['value'] + +class {'cinder': + database_connection => "mysql://${db_user}:${db_password}@${db_host}:${db_port}/${db_name}", + database_idle_timeout => $database_idle_timeout, + database_min_pool_size => $database_min_pool_size, + database_max_pool_size => $database_max_pool_size, + database_max_retries => $database_max_retries, + database_retry_interval => $database_retry_interval, + database_max_overflow => $database_max_overflow, + rpc_backend => $rpc_backend, + control_exchange => $control_exchange, + rabbit_host => $rabbit_host, + rabbit_port => $rabbit_port, + rabbit_hosts => $rabbit_hosts, + rabbit_virtual_host => $rabbit_virtual_host, + rabbit_userid => $rabbit_userid, + rabbit_password => $rabbit_password, + rabbit_use_ssl => $rabbit_use_ssl, + kombu_ssl_ca_certs => $kombu_ssl_ca_certs, + kombu_ssl_certfile => $kombu_ssl_certfile, + kombu_ssl_keyfile => $kombu_ssl_keyfile, + kombu_ssl_version => $kombu_ssl_version, + amqp_durable_queues => $amqp_durable_queues, + qpid_hostname => $qpid_hostname, + qpid_port => $qpid_port, + qpid_username => $qpid_username, + qpid_password => $qpid_password, + qpid_sasl_mechanisms => $qpid_sasl_mechanisms, + qpid_reconnect => $qpid_reconnect, + qpid_reconnect_timeout => $qpid_reconnect_timeout, + qpid_reconnect_limit => $qpid_reconnect_limit, + qpid_reconnect_interval_min => $qpid_reconnect_interval_min, + qpid_reconnect_interval_max => $qpid_reconnect_interval_max, + qpid_reconnect_interval => $qpid_reconnect_interval, + qpid_heartbeat => $qpid_heartbeat, + qpid_protocol => $qpid_protocol, + qpid_tcp_nodelay => $qpid_tcp_nodelay, + package_ensure => $package_ensure, + use_ssl => $use_ssl, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + api_paste_config => $api_paste_config, + use_syslog => $use_syslog, + log_facility => $log_facility, + log_dir => $log_dir, + verbose => $verbose, + debug => $debug, + storage_availability_zone => $storage_availability_zone, + default_availability_zone => $default_availability_zone, + mysql_module => $mysql_module, + sql_connection => $sql_connection, + sql_idle_timeout => $sql_idle_timeout, +} diff --git a/resources/cinder_scheduler_puppet/actions/update.pp b/resources/cinder_scheduler_puppet/actions/update.pp new file mode 100644 index 00000000..de3c4109 --- /dev/null +++ b/resources/cinder_scheduler_puppet/actions/update.pp @@ -0,0 +1,22 @@ +$resource = hiera($::resource_name) + +$scheduler_driver = $resource['input']['scheduler_driver']['value'] +$package_ensure = $resource['input']['package_ensure']['value'] + +include cinder::params + +package { 'cinder': + ensure => $package_ensure, + name => $::cinder::params::package_name, +} -> + +class {'cinder::scheduler': + scheduler_driver => $scheduler_driver, + package_ensure => $package_ensure, + enabled => true, + manage_service => true, +} + +notify { "restart cinder volume": + notify => Service["cinder-scheduler"], +} diff --git a/resources/cinder_volume_puppet/actions/update.pp b/resources/cinder_volume_puppet/actions/update.pp new file mode 100644 index 00000000..22964e05 --- /dev/null +++ b/resources/cinder_volume_puppet/actions/update.pp @@ -0,0 +1,26 @@ +$resource = hiera($::resource_name) + +$package_ensure = $resource['input']['package_ensure']['value'] +$use_iscsi_backend = $resource['input']['use_iscsi_backend']['value'] + +$iscsi_ip_address = $resource['input']['iscsi_ip_address']['value'] +$volume_driver = $resource['input']['volume_driver']['value'] +$volume_group = $resource['input']['volume_group']['value'] +$iscsi_helper = $resource['input']['iscsi_helper']['value'] + +include cinder::params + +package { 'cinder': + ensure => $package_ensure, + name => $::cinder::params::package_name, +} -> + +class {'cinder::volume': + package_ensure => $package_ensure, + enabled => true, + manage_service => true, +} + +notify { "restart cinder volume": + notify => Service["cinder-volume"], +} diff --git a/resources/glance_puppet/actions/update.pp b/resources/glance_puppet/actions/update.pp index 200ee66c..10b10b19 100644 --- a/resources/glance_puppet/actions/update.pp +++ b/resources/glance_puppet/actions/update.pp @@ -1 +1,101 @@ -notify { "noop update": } +$resource = hiera($::resource_name) + +$ip = $resource['input']['ip']['value'] + +$db_user = $resource['input']['db_user']['value'] +$db_password = $resource['input']['db_password']['value'] +$db_name = $resource['input']['db_name']['value'] +$db_host = $resource['input']['db_host']['value'] +$db_port = $resource['input']['db_port']['value'] + +$filesystem_store_datadir = $resource['input']['filesystem_store_datadir']['value'] + +$keystone_password = $resource['input']['keystone_password']['value'] +$verbose = $resource['input']['verbose']['value'] +$debug = $resource['input']['debug']['value'] +$bind_host = $resource['input']['bind_host']['value'] +$bind_port = $resource['input']['bind_port']['value'] +$backlog = $resource['input']['backlog']['value'] +$workers = $resource['input']['workers']['value'] +$log_file = $resource['input']['log_file']['value'] +$log_dir = $resource['input']['log_dir']['value'] +$registry_host = $resource['input']['registry_host']['value'] +$registry_port = $resource['input']['registry_port']['value'] +$registry_client_protocol = $resource['input']['registry_client_protocol']['value'] +$auth_type = $resource['input']['auth_type']['value'] +$auth_host = $resource['input']['auth_host']['value'] +$auth_url = $resource['input']['auth_url']['value'] +$auth_port = $resource['input']['auth_port']['value'] +$auth_uri = $resource['input']['auth_uri']['value'] +$auth_admin_prefix = $resource['input']['auth_admin_prefix']['value'] +$auth_protocol = $resource['input']['auth_protocol']['value'] +$pipeline = $resource['input']['pipeline']['value'] +$keystone_tenant = $resource['input']['keystone_tenant']['value'] +$keystone_user = $resource['input']['keystone_user']['value'] +$use_syslog = $resource['input']['use_syslog']['value'] +$log_facility = $resource['input']['log_facility']['value'] +$show_image_direct_url = $resource['input']['show_image_direct_url']['value'] +$purge_config = $resource['input']['purge_config']['value'] +$cert_file = $resource['input']['cert_file']['value'] +$key_file = $resource['input']['key_file']['value'] +$ca_file = $resource['input']['ca_file']['value'] +$known_stores = $resource['input']['known_stores']['value'] +$database_connection = $resource['input']['database_connection']['value'] +$database_idle_timeout = $resource['input']['database_idle_timeout']['value'] +$image_cache_dir = $resource['input']['image_cache_dir']['value'] +$os_region_name = $resource['input']['os_region_name']['value'] +$validate = $resource['input']['validate']['value'] +$validation_options = $resource['input']['validation_options']['value'] +$mysql_module = $resource['input']['mysql_module']['value'] +$sql_idle_timeout = $resource['input']['sql_idle_timeout']['value'] + +class {'glance': + package_ensure => 'present', +} + +class {'glance::api': + keystone_password => $keystone_password, + enabled => true, + manage_service => true, + verbose => $verbose, + debug => $debug, + bind_host => $bind_host, + bind_port => $bind_port, + backlog => $backlog, + workers => $workers, + log_file => $log_file, + log_dir => $log_dir, + registry_host => $registry_host, + registry_port => $registry_port, + registry_client_protocol => $registry_client_protocol, + auth_type => $auth_type, + auth_host => $auth_host, + auth_url => $auth_url, + auth_port => $auth_port, + auth_uri => $auth_uri, + auth_admin_prefix => $auth_admin_prefix, + auth_protocol => $auth_protocol, + pipeline => $pipeline, + keystone_tenant => $keystone_tenant, + keystone_user => $keystone_user, + use_syslog => $use_syslog, + log_facility => $log_facility, + show_image_direct_url => $show_image_direct_url, + purge_config => $purge_config, + cert_file => $cert_file, + key_file => $key_file, + ca_file => $ca_file, + known_stores => $known_stores, + database_connection => "mysql://${db_user}:${db_password}@${db_host}:${db_port}/${db_name}", + database_idle_timeout => $database_idle_timeout, + image_cache_dir => $image_cache_dir, + os_region_name => $os_region_name, + validate => $validate, + validation_options => $validation_options, + mysql_module => $mysql_module, + sql_idle_timeout => $sql_idle_timeout, +} + +class { 'glance::backend::file': + filesystem_store_datadir => $filesystem_store_datadir, +} diff --git a/resources/glance_registry_puppet/actions/update.pp b/resources/glance_registry_puppet/actions/update.pp index 200ee66c..1e21403c 100644 --- a/resources/glance_registry_puppet/actions/update.pp +++ b/resources/glance_registry_puppet/actions/update.pp @@ -1 +1,78 @@ -notify { "noop update": } +$resource = hiera($::resource_name) + +$ip = $resource['input']['ip']['value'] + +$db_user = $resource['input']['db_user']['value'] +$db_password = $resource['input']['db_password']['value'] +$db_name = $resource['input']['db_name']['value'] +$db_host = $resource['input']['db_host']['value'] +$db_port = $resource['input']['db_port']['value'] + +$keystone_password = $resource['input']['keystone_password']['value'] +$package_ensure = $resource['input']['package_ensure']['value'] +$verbose = $resource['input']['verbose']['value'] +$debug = $resource['input']['debug']['value'] +$bind_host = $resource['input']['bind_host']['value'] +$bind_port = $resource['input']['bind_port']['value'] +$log_file = $resource['input']['log_file']['value'] +$log_dir = $resource['input']['log_dir']['value'] +$database_connection = $resource['input']['database_connection']['value'] +$database_idle_timeout = $resource['input']['database_idle_timeout']['value'] +$auth_type = $resource['input']['auth_type']['value'] +$auth_host = $resource['input']['auth_host']['value'] +$auth_port = $resource['input']['auth_port']['value'] +$auth_admin_prefix = $resource['input']['auth_admin_prefix']['value'] +$auth_uri = $resource['input']['auth_uri']['value'] +$auth_protocol = $resource['input']['auth_protocol']['value'] +$keystone_tenant = $resource['input']['keystone_tenant']['value'] +$keystone_user = $resource['input']['keystone_user']['value'] +$pipeline = $resource['input']['pipeline']['value'] +$use_syslog = $resource['input']['use_syslog']['value'] +$log_facility = $resource['input']['log_facility']['value'] +$purge_config = $resource['input']['purge_config']['value'] +$cert_file = $resource['input']['cert_file']['value'] +$key_file = $resource['input']['key_file']['value'] +$ca_file = $resource['input']['ca_file']['value'] +$sync_db = $resource['input']['sync_db']['value'] +$mysql_module = $resource['input']['mysql_module']['value'] +$sql_idle_timeout = $resource['input']['sql_idle_timeout']['value'] +$sql_connection = $resource['input']['sql_connection']['value'] + +include glance::params + +class {'glance::registry': + keystone_password => $keystone_password, + enabled => true, + manage_service => true, + package_ensure => $package_ensure, + verbose => $verbose, + debug => $debug, + bind_host => $bind_host, + bind_port => $bind_port, + log_file => $log_file, + log_dir => $log_dir, + database_connection => "mysql://${db_user}:${db_password}@${db_host}:${db_port}/${db_name}", + database_idle_timeout => $database_idle_timeout, + auth_type => $auth_type, + auth_host => $auth_host, + auth_port => $auth_port, + auth_admin_prefix => $auth_admin_prefix, + auth_uri => $auth_uri, + auth_protocol => $auth_protocol, + keystone_tenant => $keystone_tenant, + keystone_user => $keystone_user, + pipeline => $pipeline, + use_syslog => $use_syslog, + log_facility => $log_facility, + purge_config => $purge_config, + cert_file => $cert_file, + key_file => $key_file, + ca_file => $ca_file, + sync_db => $sync_db, + mysql_module => $mysql_module, + sql_idle_timeout => $sql_idle_timeout, +} + +notify { "restart glance registry": + notify => Service["glance-registry"], +} diff --git a/resources/keystone_puppet/actions/update.pp b/resources/keystone_puppet/actions/update.pp index a593d8a0..5b51a370 100644 --- a/resources/keystone_puppet/actions/update.pp +++ b/resources/keystone_puppet/actions/update.pp @@ -6,6 +6,7 @@ $db_user = $resource['input']['db_user']['value'] $db_host = $resource['input']['db_host']['value'] $db_password = $resource['input']['db_password']['value'] $db_name = $resource['input']['db_name']['value'] +$db_port = $resource['input']['db_port']['value'] $admin_port = $resource['input']['admin_port']['value'] $port = $resource['input']['port']['value'] @@ -14,7 +15,7 @@ class {'keystone': verbose => true, catalog_type => 'sql', admin_token => $admin_token, - database_connection => "mysql://$db_user:$db_password@$db_host/$db_name", + database_connection => "mysql://$db_user:$db_password@$db_host:$db_port/$db_name", public_port => "$port", admin_port => "$admin_port", } diff --git a/resources/mariadb_db/actions/update.yaml b/resources/mariadb_db/actions/update.yaml new file mode 100644 index 00000000..11adc5ba --- /dev/null +++ b/resources/mariadb_db/actions/update.yaml @@ -0,0 +1,13 @@ +- hosts: [{{host}}] + sudo: yes + tasks: + - name: mariadb db + mysql_db: + name: {{ db_name }} + state: present + login_user: root + login_password: {{ login_password }} + login_port: {{ login_port }} + login_host: {{db_host}} + collation: {{collation}} + encoding: {{encoding}} diff --git a/resources/mariadb_service/actions/update.yaml b/resources/mariadb_service/actions/update.yaml new file mode 100644 index 00000000..7a10334c --- /dev/null +++ b/resources/mariadb_service/actions/update.yaml @@ -0,0 +1,21 @@ +- hosts: [{{host}}] + sudo: yes + tasks: + - file: path=/var/lib/docker/data/{{resource_name}} state=directory + - name: mariadb container + docker: + name: {{ resource_name }} + image: {{ image }} + state: reloaded + ports: + - {{ port }}:3306 + env: + MYSQL_ROOT_PASSWORD: {{ root_password }} + volumes: + - /var/lib/docker/data/{{resource_name}}:/var/lib/mysql + + - shell: docker exec -t {{ resource_name }} mysql -p{{ root_password }} -uroot -e "SELECT 1" + register: result + until: result.rc == 0 + retries: 30 + delay: 0.5 diff --git a/resources/neutron_server_puppet/actions/update.pp b/resources/neutron_server_puppet/actions/update.pp new file mode 100644 index 00000000..1d7d8315 --- /dev/null +++ b/resources/neutron_server_puppet/actions/update.pp @@ -0,0 +1,93 @@ +$resource = hiera($::resource_name) + +$ip = $resource['input']['ip']['value'] + +$db_user = $resource['input']['db_user']['value'] +$db_host = $resource['input']['db_host']['value'] +$db_port = $resource['input']['db_port']['value'] +$db_password = $resource['input']['db_password']['value'] +$db_name = $resource['input']['db_name']['value'] + +$package_ensure = $resource['input']['package_ensure']['value'] +$auth_password = $resource['input']['auth_password']['value'] +$auth_type = $resource['input']['auth_type']['value'] +$auth_host = $resource['input']['auth_host']['value'] +$auth_port = $resource['input']['auth_port']['value'] +$auth_admin_prefix = $resource['input']['auth_admin_prefix']['value'] +$auth_tenant = $resource['input']['auth_tenant']['value'] +$auth_user = $resource['input']['auth_user']['value'] +$auth_protocol = $resource['input']['auth_protocol']['value'] +$auth_uri = $resource['input']['auth_uri']['value'] +$database_max_retries = $resource['input']['database_max_retries']['value'] +$database_idle_timeout = $resource['input']['database_idle_timeout']['value'] +$database_retry_interval = $resource['input']['database_retry_interval']['value'] +$database_min_pool_size = $resource['input']['database_min_pool_size']['value'] +$database_max_pool_size = $resource['input']['database_max_pool_size']['value'] +$database_max_overflow = $resource['input']['database_max_overflow']['value'] +$sync_db = $resource['input']['sync_db']['value'] +$api_workers = $resource['input']['api_workers']['value'] +$rpc_workers = $resource['input']['rpc_workers']['value'] +$agent_down_time = $resource['input']['agent_down_time']['value'] +$router_scheduler_driver = $resource['input']['router_scheduler_driver']['value'] +$router_distributed = $resource['input']['router_distributed']['value'] +$l3_ha = $resource['input']['l3_ha']['value'] +$max_l3_agents_per_router = $resource['input']['max_l3_agents_per_router']['value'] +$min_l3_agents_per_router = $resource['input']['min_l3_agents_per_router']['value'] +$l3_ha_net_cidr = $resource['input']['l3_ha_net_cidr']['value'] +$mysql_module = $resource['input']['mysql_module']['value'] +$sql_max_retries = $resource['input']['sql_max_retries']['value'] +$max_retries = $resource['input']['max_retries']['value'] +$sql_idle_timeout = $resource['input']['sql_idle_timeout']['value'] +$idle_timeout = $resource['input']['idle_timeout']['value'] +$sql_reconnect_interval = $resource['input']['sql_reconnect_interval']['value'] +$retry_interval = $resource['input']['retry_interval']['value'] +$log_dir = $resource['input']['log_dir']['value'] +$log_file = $resource['input']['log_file']['value'] +$report_interval = $resource['input']['report_interval']['value'] + +class { 'neutron::server': + enabled => true, + manage_service => true, + database_connection => "mysql://${db_user}:${db_password}@${db_host}:${db_port}/${db_name}", + package_ensure => $package_ensure, + auth_password => $auth_password, + auth_type => $auth_type, + auth_host => $auth_host, + auth_port => $auth_port, + auth_admin_prefix => $auth_admin_prefix, + auth_tenant => $auth_tenant, + auth_user => $auth_user, + auth_protocol => $auth_protocol, + auth_uri => $auth_uri, + database_max_retries => $database_max_retries, + database_idle_timeout => $database_idle_timeout, + database_retry_interval => $database_retry_interval, + database_min_pool_size => $database_min_pool_size, + database_max_pool_size => $database_max_pool_size, + database_max_overflow => $database_max_overflow, + sync_db => $sync_db, + api_workers => $api_workers, + rpc_workers => $rpc_workers, + agent_down_time => $agent_down_time, + router_scheduler_driver => $router_scheduler_driver, + router_distributed => $router_distributed, + l3_ha => $l3_ha, + max_l3_agents_per_router => $max_l3_agents_per_router, + min_l3_agents_per_router => $min_l3_agents_per_router, + l3_ha_net_cidr => $l3_ha_net_cidr, + mysql_module => $mysql_module, + sql_max_retries => $sql_max_retries, + max_retries => $max_retries, + sql_idle_timeout => $sql_idle_timeout, + idle_timeout => $idle_timeout, + sql_reconnect_interval => $sql_reconnect_interval, + retry_interval => $retry_interval, + log_dir => $log_dir, + log_file => $log_file, + report_interval => $report_interval, +} + +# Remove external class dependency +Service <| title == 'neutron-server' |> { + require => undef +} diff --git a/resources/nova_api_puppet/actions/update.pp b/resources/nova_api_puppet/actions/update.pp new file mode 100644 index 00000000..092deb01 --- /dev/null +++ b/resources/nova_api_puppet/actions/update.pp @@ -0,0 +1,82 @@ +$resource = hiera($::resource_name) + +$ensure_package = $resource['input']['ensure_package']['value'] +$auth_strategy = $resource['input']['auth_strategy']['value'] +$auth_host = $resource['input']['auth_host']['value'] +$auth_port = $resource['input']['auth_port']['value'] +$auth_protocol = $resource['input']['auth_protocol']['value'] +$auth_uri = $resource['input']['auth_uri']['value'] +$auth_admin_prefix = $resource['input']['auth_admin_prefix']['value'] +$auth_version = $resource['input']['auth_version']['value'] +$admin_tenant_name = $resource['input']['admin_tenant_name']['value'] +$admin_user = $resource['input']['admin_user']['value'] +$admin_password = $resource['input']['admin_password']['value'] +$api_bind_address = $resource['input']['api_bind_address']['value'] +$metadata_listen = $resource['input']['metadata_listen']['value'] +$enabled_apis = $resource['input']['enabled_apis']['value'] +$keystone_ec2_url = $resource['input']['keystone_ec2_url']['value'] +$volume_api_class = $resource['input']['volume_api_class']['value'] +$use_forwarded_for = $resource['input']['use_forwarded_for']['value'] +$osapi_compute_workers = $resource['input']['osapi_compute_workers']['value'] +$ec2_workers = $resource['input']['ec2_workers']['value'] +$metadata_workers = $resource['input']['metadata_workers']['value'] +$sync_db = $resource['input']['sync_db']['value'] +$neutron_metadata_proxy_shared_secret = $resource['input']['neutron_metadata_proxy_shared_secret']['value'] +$osapi_v3 = $resource['input']['osapi_v3']['value'] +$pci_alias = $resource['input']['pci_alias']['value'] +$ratelimits = $resource['input']['ratelimits']['value'] +$ratelimits_factory = $resource['input']['ratelimits_factory']['value'] +$validate = $resource['input']['validate']['value'] +$validation_options = $resource['input']['validation_options']['value'] +$workers = $resource['input']['workers']['value'] +$conductor_workers = $resource['input']['conductor_workers']['value'] + +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, +} + +class { 'nova::api': + enabled => true, + manage_service => true, + ensure_package => $ensure_package, + auth_strategy => $auth_strategy, + auth_host => $auth_host, + auth_port => $auth_port, + auth_protocol => $auth_protocol, + auth_uri => $auth_uri, + auth_admin_prefix => $auth_admin_prefix, + auth_version => $auth_version, + admin_tenant_name => $admin_tenant_name, + admin_user => $admin_user, + admin_password => $admin_password, + api_bind_address => $api_bind_address, + metadata_listen => $metadata_listen, + enabled_apis => $enabled_apis, + keystone_ec2_url => $keystone_ec2_url, + volume_api_class => $volume_api_class, + use_forwarded_for => $use_forwarded_for, + osapi_compute_workers => $osapi_compute_workers, + ec2_workers => $ec2_workers, + metadata_workers => $metadata_workers, + sync_db => $sync_db, + neutron_metadata_proxy_shared_secret => $neutron_metadata_proxy_shared_secret, + osapi_v3 => $osapi_v3, + pci_alias => $pci_alias, + ratelimits => $ratelimits, + ratelimits_factory => $ratelimits_factory, + validate => $validate, + validation_options => $validation_options, + workers => $workers, + conductor_workers => $conductor_workers, +} + +notify { "restart nova api": + notify => Service["nova-api"], +} diff --git a/resources/nova_conductor_puppet/actions/update.pp b/resources/nova_conductor_puppet/actions/update.pp new file mode 100644 index 00000000..9ab0f15b --- /dev/null +++ b/resources/nova_conductor_puppet/actions/update.pp @@ -0,0 +1,26 @@ +$resource = hiera($::resource_name) + +$ensure_package = $resource['input']['ensure_package']['value'] +$workers = $resource['input']['workers']['value'] + +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, +} + +class { 'nova::conductor': + enabled => true, + manage_service => true, + ensure_package => $ensure_package, + workers => $workers, +} + +notify { "restart nova conductor": + notify => Service["nova-conductor"], +} diff --git a/resources/nova_generic_service_puppet/actions/update.pp b/resources/nova_generic_service_puppet/actions/update.pp new file mode 100644 index 00000000..2aa7d142 --- /dev/null +++ b/resources/nova_generic_service_puppet/actions/update.pp @@ -0,0 +1,29 @@ +$resource = hiera($::resource_name) + +$service_title = $resource['input']['title']['value'] +$package_name = $resource['input']['package_name']['value'] +$service_name = $resource['input']['service_name']['value'] +$ensure_package = $resource['input']['ensure_package']['value'] + +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, +} + +nova::generic_service { $service_title: + enabled => true, + manage_service => true, + package_name => $package_name, + service_name => $service_name, + ensure_package => $ensure_package, +} + +notify { "restart generic service": + notify => Service["nova-${service_title}"], +} diff --git a/resources/nova_puppet/actions/update.pp b/resources/nova_puppet/actions/update.pp new file mode 100644 index 00000000..46bf2b42 --- /dev/null +++ b/resources/nova_puppet/actions/update.pp @@ -0,0 +1,138 @@ +$resource = hiera($::resource_name) + +$db_user = $resource['input']['db_user']['value'] +$db_password = $resource['input']['db_password']['value'] +$db_name = $resource['input']['db_name']['value'] +$db_host = $resource['input']['db_host']['value'] +$db_port = $resource['input']['db_port']['value'] +$glance_api_servers_host = $resource['input']['glance_api_servers_host']['value'] +$glance_api_servers_port = $resource['input']['glance_api_servers_port']['value'] + +$ensure_package = $resource['input']['ensure_package']['value'] +$database_connection = $resource['input']['database_connection']['value'] +$slave_connection = $resource['input']['slave_connection']['value'] +$database_idle_timeout = $resource['input']['database_idle_timeout']['value'] +$rpc_backend = $resource['input']['rpc_backend']['value'] +$image_service = $resource['input']['image_service']['value'] +$glance_api_servers = $resource['input']['glance_api_servers']['value'] +$memcached_servers = $resource['input']['memcached_servers']['value'] +$rabbit_host = $resource['input']['rabbit_host']['value'] +$rabbit_hosts = $resource['input']['rabbit_hosts']['value'] +$rabbit_password = $resource['input']['rabbit_password']['value'] +$rabbit_port = $resource['input']['rabbit_port']['value'] +$rabbit_userid = $resource['input']['rabbit_userid']['value'] +$rabbit_virtual_host = $resource['input']['rabbit_virtual_host']['value'] +$rabbit_use_ssl = $resource['input']['rabbit_use_ssl']['value'] +$rabbit_ha_queues = $resource['input']['rabbit_ha_queues']['value'] +$kombu_ssl_ca_certs = $resource['input']['kombu_ssl_ca_certs']['value'] +$kombu_ssl_certfile = $resource['input']['kombu_ssl_certfile']['value'] +$kombu_ssl_keyfile = $resource['input']['kombu_ssl_keyfile']['value'] +$kombu_ssl_version = $resource['input']['kombu_ssl_version']['value'] +$amqp_durable_queues = $resource['input']['amqp_durable_queues']['value'] +$qpid_hostname = $resource['input']['qpid_hostname']['value'] +$qpid_port = $resource['input']['qpid_port']['value'] +$qpid_username = $resource['input']['qpid_username']['value'] +$qpid_password = $resource['input']['qpid_password']['value'] +$qpid_sasl_mechanisms = $resource['input']['qpid_sasl_mechanisms']['value'] +$qpid_heartbeat = $resource['input']['qpid_heartbeat']['value'] +$qpid_protocol = $resource['input']['qpid_protocol']['value'] +$qpid_tcp_nodelay = $resource['input']['qpid_tcp_nodelay']['value'] +$auth_strategy = $resource['input']['auth_strategy']['value'] +$service_down_time = $resource['input']['service_down_time']['value'] +$log_dir = $resource['input']['log_dir']['value'] +$state_path = $resource['input']['state_path']['value'] +$lock_path = $resource['input']['lock_path']['value'] +$verbose = $resource['input']['verbose']['value'] +$debug = $resource['input']['debug']['value'] +$periodic_interval = $resource['input']['periodic_interval']['value'] +$report_interval = $resource['input']['report_interval']['value'] +$rootwrap_config = $resource['input']['rootwrap_config']['value'] +$use_ssl = $resource['input']['use_ssl']['value'] +$enabled_ssl_apis = $resource['input']['enabled_ssl_apis']['value'] +$ca_file = $resource['input']['ca_file']['value'] +$cert_file = $resource['input']['cert_file']['value'] +$key_file = $resource['input']['key_file']['value'] +$nova_user_id = $resource['input']['nova_user_id']['value'] +$nova_group_id = $resource['input']['nova_group_id']['value'] +$nova_public_key = $resource['input']['nova_public_key']['value'] +$nova_private_key = $resource['input']['nova_private_key']['value'] +$nova_shell = $resource['input']['nova_shell']['value'] +$monitoring_notifications = $resource['input']['monitoring_notifications']['value'] +$use_syslog = $resource['input']['use_syslog']['value'] +$log_facility = $resource['input']['log_facility']['value'] +$install_utilities = $resource['input']['install_utilities']['value'] +$notification_driver = $resource['input']['notification_driver']['value'] +$notification_topics = $resource['input']['notification_topics']['value'] +$notify_api_faults = $resource['input']['notify_api_faults']['value'] +$notify_on_state_change = $resource['input']['notify_on_state_change']['value'] +$mysql_module = $resource['input']['mysql_module']['value'] +$nova_cluster_id = $resource['input']['nova_cluster_id']['value'] +$sql_connection = $resource['input']['sql_connection']['value'] +$sql_idle_timeout = $resource['input']['sql_idle_timeout']['value'] +$logdir = $resource['input']['logdir']['value'] +$os_region_name = $resource['input']['os_region_name']['value'] + +class { 'nova': + database_connection => "mysql://${db_user}:${db_password}@${db_host}:${db_port}/${db_name}?charset=utf8", + ensure_package => $ensure_package, + slave_connection => $slave_connection, + database_idle_timeout => $database_idle_timeout, + rpc_backend => $rpc_backend, + image_service => $image_service, + glance_api_servers => "${glance_api_servers_host}:${glance_api_servers_port}", + memcached_servers => $memcached_servers, + rabbit_host => $rabbit_host, + rabbit_hosts => $rabbit_hosts, + rabbit_password => $rabbit_password, + rabbit_port => $rabbit_port, + rabbit_userid => $rabbit_userid, + rabbit_virtual_host => $rabbit_virtual_host, + rabbit_use_ssl => $rabbit_use_ssl, + rabbit_ha_queues => $rabbit_ha_queues, + kombu_ssl_ca_certs => $kombu_ssl_ca_certs, + kombu_ssl_certfile => $kombu_ssl_certfile, + kombu_ssl_keyfile => $kombu_ssl_keyfile, + kombu_ssl_version => $kombu_ssl_version, + amqp_durable_queues => $amqp_durable_queues, + qpid_hostname => $qpid_hostname, + qpid_port => $qpid_port, + qpid_username => $qpid_username, + qpid_password => $qpid_password, + qpid_sasl_mechanisms => $qpid_sasl_mechanisms, + qpid_heartbeat => $qpid_heartbeat, + qpid_protocol => $qpid_protocol, + qpid_tcp_nodelay => $qpid_tcp_nodelay, + auth_strategy => $auth_strategy, + service_down_time => $service_down_time, + log_dir => $log_dir, + state_path => $state_path, + lock_path => $lock_path, + verbose => $verbose, + debug => $debug, + periodic_interval => $periodic_interval, + report_interval => $report_interval, + rootwrap_config => $rootwrap_config, + use_ssl => $use_ssl, + enabled_ssl_apis => $enabled_ssl_apis, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + nova_user_id => $nova_user_id, + nova_group_id => $nova_group_id, + nova_public_key => $nova_public_key, + nova_private_key => $nova_private_key, + nova_shell => $nova_shell, + monitoring_notifications => $monitoring_notifications, + use_syslog => $use_syslog, + log_facility => $log_facility, + install_utilities => $install_utilities, + notification_driver => $notification_driver, + notification_topics => $notification_topics, + notify_api_faults => $notify_api_faults, + notify_on_state_change => $notify_on_state_change, + mysql_module => $mysql_module, + nova_cluster_id => $nova_cluster_id, + sql_idle_timeout => $sql_idle_timeout, + logdir => $logdir, + os_region_name => $os_region_name, +}