From 08a1141f160bdf71cc218cbf26142022b51918a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20Gagne=CC=81?= Date: Wed, 28 Aug 2013 14:23:36 -0400 Subject: [PATCH] Deprecate classes with hyphens Puppet does not recommend the use of hyphens in class names. This change deprecates classes with hypens and inform the users to use the new ones. Backward compatibility is preserved. Change-Id: Ib4ce5ec3f9354d77397d97500811ccac2a0ff395 --- manifests/api-cfn.pp | 60 ++++++++++------------------------ manifests/api-cloudwatch.pp | 60 ++++++++++------------------------ manifests/api_cfn.pp | 64 +++++++++++++++++++++++++++++++++++++ manifests/api_cloudwatch.pp | 64 +++++++++++++++++++++++++++++++++++++ manifests/engine.pp | 4 +-- 5 files changed, 162 insertions(+), 90 deletions(-) create mode 100644 manifests/api_cfn.pp create mode 100644 manifests/api_cloudwatch.pp diff --git a/manifests/api-cfn.pp b/manifests/api-cfn.pp index 3bb3facf..6e30387b 100644 --- a/manifests/api-cfn.pp +++ b/manifests/api-cfn.pp @@ -1,5 +1,5 @@ # Installs & configure the heat CloudFormation API service - +# class heat::api-cfn ( $enabled = true, $keystone_host = '127.0.0.1', @@ -16,49 +16,21 @@ class heat::api-cfn ( $debug = false, ) { - include heat::params + warning('heat::api-cfn is deprecated. Use heat::api_cfn instead.') - validate_string($keystone_password) - - Heat_config<||> ~> Service['heat-api-cfn'] - - Package['heat-api-cfn'] -> Heat_config<||> - Package['heat-api-cfn'] -> Service['heat-api-cfn'] - package { 'heat-api-cfn': - ensure => installed, - name => $::heat::params::api_cfn_package_name, - } - - if $enabled { - $service_ensure = 'running' - } else { - $service_ensure = 'stopped' - } - - Package['heat-common'] -> Service['heat-api-cfn'] - - service { 'heat-api-cfn': - ensure => $service_ensure, - name => $::heat::params::api_cfn_service_name, - enable => $enabled, - hasstatus => true, - hasrestart => true, - require => Class['heat::db'], - } - - heat_config { - 'DEFAULT/debug' : value => $debug; - 'DEFAULT/verbose' : value => $verbose; - 'DEFAULT/log_dir' : value => $::heat::params::log_dir; - 'DEFAULT/bind_host' : value => $bind_host; - 'DEFAULT/bind_port' : value => $bind_port; - 'ec2authtoken/keystone_ec2_uri' : value => $keystone_ec2_uri; - 'ec2authtoken/auth_uri' : value => $auth_uri; - 'keystone_authtoken/auth_host' : value => $keystone_host; - 'keystone_authtoken/auth_port' : value => $keystone_port; - 'keystone_authtoken/auth_protocol' : value => $keystone_protocol; - 'keystone_authtoken/admin_tenant_name' : value => $keystone_tenant; - 'keystone_authtoken/admin_user' : value => $keystone_user; - 'keystone_authtoken/admin_password' : value => $keystone_password; + class { 'heat::api_cfn': + enabled => $enabled, + keystone_host => $keystone_host, + keystone_port => $keystone_port, + keystone_protocol => $keystone_protocol, + keystone_user => $keystone_user, + keystone_tenant => $keystone_tenant, + keystone_password => $keystone_password, + keystone_ec2_uri => $keystone_ec2_uri, + auth_uri => $auth_uri, + bind_host => $bind_host, + bind_port => $bind_port, + verbose => $verbose, + debug => $debug, } } diff --git a/manifests/api-cloudwatch.pp b/manifests/api-cloudwatch.pp index a6d960e9..67657b16 100644 --- a/manifests/api-cloudwatch.pp +++ b/manifests/api-cloudwatch.pp @@ -1,5 +1,5 @@ # Installs & configure the heat CloudWatch API service - +# class heat::api-cloudwatch ( $enabled = true, $keystone_host = '127.0.0.1', @@ -16,49 +16,21 @@ class heat::api-cloudwatch ( $debug = false, ) { - include heat::params + warning('heat::api-cloudwatch is deprecated. Use heat::api_cloudwatch instead.') - validate_string($keystone_password) - - Heat_config<||> ~> Service['heat-api-cloudwatch'] - - Package['heat-api-cloudwatch'] -> Heat_config<||> - Package['heat-api-cloudwatch'] -> Service['heat-api-cloudwatch'] - package { 'heat-api-cloudwatch': - ensure => installed, - name => $::heat::params::api_cloudwatch_package_name, - } - - if $enabled { - $service_ensure = 'running' - } else { - $service_ensure = 'stopped' - } - - Package['heat-common'] -> Service['heat-api-cloudwatch'] - - service { 'heat-api-cloudwatch': - ensure => $service_ensure, - name => $::heat::params::api_cloudwatch_service_name, - enable => $enabled, - hasstatus => true, - hasrestart => true, - require => Class['heat::db'], - } - - heat_config { - 'DEFAULT/debug' : value => $debug; - 'DEFAULT/verbose' : value => $verbose; - 'DEFAULT/log_dir' : value => $::heat::params::log_dir; - 'DEFAULT/bind_host' : value => $bind_host; - 'DEFAULT/bind_port' : value => $bind_port; - 'ec2authtoken/keystone_ec2_uri' : value => $keystone_ec2_uri; - 'ec2authtoken/auth_uri' : value => $auth_uri; - 'keystone_authtoken/auth_host' : value => $keystone_host; - 'keystone_authtoken/auth_port' : value => $keystone_port; - 'keystone_authtoken/auth_protocol' : value => $keystone_protocol; - 'keystone_authtoken/admin_tenant_name' : value => $keystone_tenant; - 'keystone_authtoken/admin_user' : value => $keystone_user; - 'keystone_authtoken/admin_password' : value => $keystone_password; + class { 'heat::api_cloudwatch': + enabled => $enabled, + keystone_host => $keystone_host, + keystone_port => $keystone_port, + keystone_protocol => $keystone_protocol, + keystone_user => $keystone_user, + keystone_tenant => $keystone_tenant, + keystone_password => $keystone_password, + keystone_ec2_uri => $keystone_ec2_uri, + auth_uri => $auth_uri, + bind_host => $bind_host, + bind_port => $bind_port, + verbose => $verbose, + debug => $debug, } } diff --git a/manifests/api_cfn.pp b/manifests/api_cfn.pp new file mode 100644 index 00000000..59cb08fb --- /dev/null +++ b/manifests/api_cfn.pp @@ -0,0 +1,64 @@ +# Installs & configure the heat CloudFormation API service +# +class heat::api_cfn ( + $enabled = true, + $keystone_host = '127.0.0.1', + $keystone_port = '35357', + $keystone_protocol = 'http', + $keystone_user = 'heat', + $keystone_tenant = 'services', + $keystone_password = false, + $keystone_ec2_uri = 'http://127.0.0.1:5000/v2.0/ec2tokens', + $auth_uri = 'http://127.0.0.1:5000/v2.0', + $bind_host = '0.0.0.0', + $bind_port = '8000', + $verbose = false, + $debug = false, +) { + + include heat::params + + validate_string($keystone_password) + + Heat_config<||> ~> Service['heat-api-cfn'] + + Package['heat-api-cfn'] -> Heat_config<||> + Package['heat-api-cfn'] -> Service['heat-api-cfn'] + package { 'heat-api-cfn': + ensure => installed, + name => $::heat::params::api_cfn_package_name, + } + + if $enabled { + $service_ensure = 'running' + } else { + $service_ensure = 'stopped' + } + + Package['heat-common'] -> Service['heat-api-cfn'] + + service { 'heat-api-cfn': + ensure => $service_ensure, + name => $::heat::params::api_cfn_service_name, + enable => $enabled, + hasstatus => true, + hasrestart => true, + require => Class['heat::db'], + } + + heat_config { + 'DEFAULT/debug' : value => $debug; + 'DEFAULT/verbose' : value => $verbose; + 'DEFAULT/log_dir' : value => $::heat::params::log_dir; + 'DEFAULT/bind_host' : value => $bind_host; + 'DEFAULT/bind_port' : value => $bind_port; + 'ec2authtoken/keystone_ec2_uri' : value => $keystone_ec2_uri; + 'ec2authtoken/auth_uri' : value => $auth_uri; + 'keystone_authtoken/auth_host' : value => $keystone_host; + 'keystone_authtoken/auth_port' : value => $keystone_port; + 'keystone_authtoken/auth_protocol' : value => $keystone_protocol; + 'keystone_authtoken/admin_tenant_name' : value => $keystone_tenant; + 'keystone_authtoken/admin_user' : value => $keystone_user; + 'keystone_authtoken/admin_password' : value => $keystone_password; + } +} diff --git a/manifests/api_cloudwatch.pp b/manifests/api_cloudwatch.pp new file mode 100644 index 00000000..8e4af6ab --- /dev/null +++ b/manifests/api_cloudwatch.pp @@ -0,0 +1,64 @@ +# Installs & configure the heat CloudWatch API service +# +class heat::api_cloudwatch ( + $enabled = true, + $keystone_host = '127.0.0.1', + $keystone_port = '35357', + $keystone_protocol = 'http', + $keystone_user = 'heat', + $keystone_tenant = 'services', + $keystone_password = false, + $keystone_ec2_uri = 'http://127.0.0.1:5000/v2.0/ec2tokens', + $auth_uri = 'http://127.0.0.1:5000/v2.0', + $bind_host = '0.0.0.0', + $bind_port = '8003', + $verbose = false, + $debug = false, +) { + + include heat::params + + validate_string($keystone_password) + + Heat_config<||> ~> Service['heat-api-cloudwatch'] + + Package['heat-api-cloudwatch'] -> Heat_config<||> + Package['heat-api-cloudwatch'] -> Service['heat-api-cloudwatch'] + package { 'heat-api-cloudwatch': + ensure => installed, + name => $::heat::params::api_cloudwatch_package_name, + } + + if $enabled { + $service_ensure = 'running' + } else { + $service_ensure = 'stopped' + } + + Package['heat-common'] -> Service['heat-api-cloudwatch'] + + service { 'heat-api-cloudwatch': + ensure => $service_ensure, + name => $::heat::params::api_cloudwatch_service_name, + enable => $enabled, + hasstatus => true, + hasrestart => true, + require => Class['heat::db'], + } + + heat_config { + 'DEFAULT/debug' : value => $debug; + 'DEFAULT/verbose' : value => $verbose; + 'DEFAULT/log_dir' : value => $::heat::params::log_dir; + 'DEFAULT/bind_host' : value => $bind_host; + 'DEFAULT/bind_port' : value => $bind_port; + 'ec2authtoken/keystone_ec2_uri' : value => $keystone_ec2_uri; + 'ec2authtoken/auth_uri' : value => $auth_uri; + 'keystone_authtoken/auth_host' : value => $keystone_host; + 'keystone_authtoken/auth_port' : value => $keystone_port; + 'keystone_authtoken/auth_protocol' : value => $keystone_protocol; + 'keystone_authtoken/admin_tenant_name' : value => $keystone_tenant; + 'keystone_authtoken/admin_user' : value => $keystone_user; + 'keystone_authtoken/admin_password' : value => $keystone_password; + } +} diff --git a/manifests/engine.pp b/manifests/engine.pp index 12a3892e..5b4178f4 100644 --- a/manifests/engine.pp +++ b/manifests/engine.pp @@ -58,8 +58,8 @@ class heat::engine ( exec {'heat-encryption-key-replacement': command => 'sed -i "s/%ENCRYPTION_KEY%/`hexdump -n 16 -v -e \'/1 "%02x"\' /dev/random`/" /etc/heat/heat-engine.conf', - path => [ '/usr/bin', '/bin'], - onlyif => 'grep -c ENCRYPTION_KEY /etc/heat/heat-engine.conf', + path => [ '/usr/bin', '/bin'], + onlyif => 'grep -c ENCRYPTION_KEY /etc/heat/heat-engine.conf', } heat_config {