Install utility to deploy OpenStack on multiple hosts.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tempest.pp 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. class packstack::provision::tempest ()
  2. {
  3. $provision_demo = str2bool(hiera('CONFIG_PROVISION_DEMO'))
  4. if $provision_demo {
  5. $username = 'demo'
  6. $password = hiera('CONFIG_KEYSTONE_DEMO_PW')
  7. $tenant_name = 'demo'
  8. $floating_range = hiera('CONFIG_PROVISION_DEMO_FLOATRANGE')
  9. } else {
  10. $username = hiera('CONFIG_PROVISION_TEMPEST_USER')
  11. $password = hiera('CONFIG_PROVISION_TEMPEST_USER_PW')
  12. $tenant_name = 'tempest'
  13. $floating_range = hiera('CONFIG_PROVISION_TEMPEST_FLOATRANGE')
  14. }
  15. # Authentication/Keystone
  16. $identity_uri = regsubst(hiera('CONFIG_KEYSTONE_PUBLIC_URL'), 'v3', 'v2.0')
  17. $identity_uri_v3 = regsubst(hiera('CONFIG_KEYSTONE_PUBLIC_URL'), 'v2.0', 'v3')
  18. $auth_version = regsubst(hiera('CONFIG_KEYSTONE_API_VERSION'), '.0', '')
  19. $admin_username = hiera('CONFIG_KEYSTONE_ADMIN_USERNAME')
  20. $admin_password = hiera('CONFIG_KEYSTONE_ADMIN_PW')
  21. $admin_tenant_name = 'admin'
  22. $admin_domain_name = 'Default'
  23. # get image and network id
  24. $configure_images = true
  25. $configure_networks = true
  26. # Image
  27. $uec_image_name = hiera('CONFIG_PROVISION_UEC_IMAGE_NAME')
  28. $image_ssh_user = hiera('CONFIG_PROVISION_IMAGE_SSH_USER')
  29. $image_name_alt = "${uec_image_name}_alt"
  30. $image_alt_ssh_user = hiera('CONFIG_PROVISION_IMAGE_SSH_USER')
  31. $image_source = hiera('CONFIG_PROVISION_IMAGE_URL')
  32. $image_format = hiera('CONFIG_PROVISION_IMAGE_FORMAT')
  33. # network name
  34. $public_network_name = 'public'
  35. # nova should be able to resize with packstack setup
  36. $resize_available = true
  37. $change_password_available = undef
  38. $allow_tenant_isolation = true
  39. $dir_log = hiera('DIR_LOG')
  40. $log_file = "${dir_log}/tempest.log"
  41. $use_stderr = false
  42. $debug = true
  43. $public_router_id = undef
  44. # Tempest
  45. $tempest_workspace = '/var/lib/tempest'
  46. $tempest_user = hiera('CONFIG_PROVISION_TEMPEST_USER')
  47. $tempest_password = hiera('CONFIG_PROVISION_TEMPEST_USER_PW')
  48. $tempest_flavor_name = hiera('CONFIG_PROVISION_TEMPEST_FLAVOR_NAME')
  49. $tempest_flavor_ref = "42"
  50. $tempest_flavor_ram = hiera('CONFIG_PROVISION_TEMPEST_FLAVOR_RAM')
  51. $tempest_flavor_disk = hiera('CONFIG_PROVISION_TEMPEST_FLAVOR_DISK')
  52. $tempest_flavor_vcpus= hiera('CONFIG_PROVISION_TEMPEST_FLAVOR_VCPUS')
  53. $tempest_flavor_alt_name = hiera('CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_NAME')
  54. $tempest_flavor_alt_ref = "84"
  55. $tempest_flavor_alt_ram = hiera('CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_RAM')
  56. $tempest_flavor_alt_disk = hiera('CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_DISK')
  57. $tempest_flavor_alt_vcpus= hiera('CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_VCPUS')
  58. nova_flavor { $tempest_flavor_name :
  59. ensure => present,
  60. id => $tempest_flavor_ref,
  61. ram => $tempest_flavor_ram,
  62. disk => $tempest_flavor_disk,
  63. vcpus => $tempest_flavor_vcpus,
  64. require => [ Class['::nova::api'], Class['::nova::keystone::auth'] ],
  65. }
  66. nova_flavor { $tempest_flavor_alt_name :
  67. ensure => present,
  68. id => $tempest_flavor_alt_ref,
  69. ram => $tempest_flavor_alt_ram,
  70. disk => $tempest_flavor_alt_disk,
  71. vcpus => $tempest_flavor_alt_vcpus,
  72. require => [ Class['::nova::api'], Class['::nova::keystone::auth'] ],
  73. }
  74. # Service availability for testing based on configuration
  75. $cinder_available = str2bool(hiera('CONFIG_CINDER_INSTALL'))
  76. $glance_available = str2bool(hiera('CONFIG_GLANCE_INSTALL'))
  77. $horizon_available = str2bool(hiera('CONFIG_HORIZON_INSTALL'))
  78. $nova_available = str2bool(hiera('CONFIG_NOVA_INSTALL'))
  79. $neutron_available = str2bool(hiera('CONFIG_NEUTRON_INSTALL'))
  80. $ceilometer_available = str2bool(hiera('CONFIG_CEILOMETER_INSTALL'))
  81. $aodh_available = str2bool(hiera('CONFIG_AODH_INSTALL'))
  82. $trove_available = str2bool(hiera('CONFIG_TROVE_INSTALL'))
  83. $sahara_available = str2bool(hiera('CONFIG_SAHARA_INSTALL'))
  84. $heat_available = str2bool(hiera('CONFIG_HEAT_INSTALL'))
  85. $swift_available = str2bool(hiera('CONFIG_SWIFT_INSTALL'))
  86. $configure_tempest = str2bool(hiera('CONFIG_PROVISION_TEMPEST'))
  87. # Some API extensions as l3_agent_scheduler are not enabled by OVN plugin
  88. $l2_agent = hiera('CONFIG_NEUTRON_L2_AGENT')
  89. if $l2_agent == 'ovn' {
  90. $neutron_api_extensions = 'ext-gw-mode,binding,agent,external-net,quotas,provider,extraroute,router,extra_dhcp_opt,allowed-address-pairs,security-group,trunk'
  91. } else {
  92. $neutron_api_extensions = undef
  93. }
  94. class { '::tempest':
  95. admin_domain_name => $admin_domain_name,
  96. admin_password => $admin_password,
  97. admin_tenant_name => $admin_tenant_name,
  98. admin_username => $admin_username,
  99. allow_tenant_isolation => $allow_tenant_isolation,
  100. aodh_available => $aodh_available,
  101. auth_version => $auth_version,
  102. ceilometer_available => $ceilometer_available,
  103. cinder_available => $cinder_available,
  104. change_password_available => $change_password_available,
  105. configure_images => $configure_images,
  106. configure_networks => $configure_networks,
  107. debug => $debug,
  108. flavor_ref => $tempest_flavor_ref,
  109. flavor_ref_alt => $tempest_flavor_alt_ref,
  110. glance_available => $glance_available,
  111. heat_available => $heat_available,
  112. horizon_available => $horizon_available,
  113. identity_uri => $identity_uri,
  114. identity_uri_v3 => $identity_uri_v3,
  115. keystone_v2 => false,
  116. image_alt_ssh_user => $image_alt_ssh_user,
  117. image_name_alt => $image_name_alt,
  118. image_name => $uec_image_name,
  119. image_ssh_user => $image_ssh_user,
  120. run_ssh => true,
  121. log_file => $log_file,
  122. neutron_available => $neutron_available,
  123. nova_available => $nova_available,
  124. password => $password,
  125. public_network_name => $public_network_name,
  126. public_router_id => $public_router_id,
  127. resize_available => $resize_available,
  128. sahara_available => $sahara_available,
  129. swift_available => $swift_available,
  130. tempest_workspace => $tempest_workspace,
  131. install_from_source => false,
  132. tenant_name => $tenant_name,
  133. trove_available => $trove_available,
  134. username => $username,
  135. use_stderr => $use_stderr,
  136. neutron_api_extensions => $neutron_api_extensions,
  137. }
  138. tempest_config { 'object-storage/operator_role':
  139. value => 'SwiftOperator',
  140. path => "${tempest_workspace}/etc/tempest.conf",
  141. }
  142. }