neutron.pp 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. # == Class: nova::network::neutron
  2. #
  3. # Configures Nova network to use Neutron.
  4. #
  5. # === Parameters:
  6. #
  7. # [*neutron_password*]
  8. # (required) Password for connecting to Neutron network services in
  9. # admin context through the OpenStack Identity service.
  10. #
  11. # [*neutron_auth_type*]
  12. # Name of the auth type to load (string value)
  13. # Defaults to 'v3password'
  14. #
  15. # [*neutron_url*]
  16. # (optional) URL for connecting to the Neutron networking service.
  17. # Defaults to 'http://127.0.0.1:9696'
  18. #
  19. # [*neutron_url_timeout*]
  20. # (optional) Timeout value for connecting to neutron in seconds.
  21. # Defaults to '30'
  22. #
  23. # [*neutron_project_name*]
  24. # (optional) Project name for connecting to Neutron network services in
  25. # admin context through the OpenStack Identity service.
  26. # Defaults to 'services'
  27. #
  28. # [*neutron_project_domain_name*]
  29. # (optional) Project Domain name for connecting to Neutron network services in
  30. # admin context through the OpenStack Identity service.
  31. # Defaults to 'Default'
  32. #
  33. # [*neutron_user_domain_name*]
  34. # (optional) User Domain name for connecting to Neutron network services in
  35. # admin context through the OpenStack Identity service.
  36. # Defaults to 'Default'
  37. #
  38. # [*neutron_region_name*]
  39. # (optional) Region name for connecting to neutron in admin context
  40. # through the OpenStack Identity service.
  41. # Defaults to 'RegionOne'
  42. #
  43. # [*neutron_username*]
  44. # (optional) Username for connecting to Neutron network services in admin context
  45. # through the OpenStack Identity service.
  46. # Defaults to 'neutron'
  47. #
  48. # [*neutron_ovs_bridge*]
  49. # (optional) Name of Integration Bridge used by Open vSwitch
  50. # Defaults to 'br-int'
  51. #
  52. # [*neutron_extension_sync_interval*]
  53. # (optional) Number of seconds before querying neutron for extensions
  54. # Defaults to '600'
  55. #
  56. # [*neutron_auth_url*]
  57. # (optional) Points to the OpenStack Identity server IP and port.
  58. # This is the Identity (keystone) admin API server IP and port value,
  59. # and not the Identity service API IP and port.
  60. # Defaults to 'http://127.0.0.1:35357/v3'
  61. #
  62. # [*firewall_driver*]
  63. # (optional) Firewall driver.
  64. # This prevents nova from maintaining a firewall so it does not interfere
  65. # with Neutron's. Set to 'nova.virt.firewall.IptablesFirewallDriver'
  66. # to re-enable the Nova firewall.
  67. # Defaults to 'nova.virt.firewall.NoopFirewallDriver'
  68. #
  69. # [*vif_plugging_is_fatal*]
  70. # (optional) Fail to boot instance if vif plugging fails.
  71. # This prevents nova from booting an instance if vif plugging notification
  72. # is not received from neutron.
  73. # Defaults to 'True'
  74. #
  75. # [*vif_plugging_timeout*]
  76. # (optional) Number of seconds to wait for neutron vif plugging events.
  77. # Set to '0' and vif_plugging_is_fatal to 'False' if vif plugging
  78. # notification is not being used.
  79. # Defaults to '300'
  80. #
  81. # [*dhcp_domain*]
  82. # (optional) domain to use for building the hostnames
  83. # Defaults to 'novalocal'
  84. #
  85. # DEPRECATED PARAMETERS
  86. # [*neutron_auth_strategy*]
  87. # (optional) DEPRECATED.
  88. #
  89. # [*neutron_admin_password*]
  90. # DEPRECATED. Password for connecting to Neutron network services
  91. # in admin context through the OpenStack Identity service.
  92. # Use neutron_password instead.
  93. #
  94. # [*neutron_admin_tenant_name*]
  95. # (optional) DEPRECATED. Tenant name for connecting to Neutron network
  96. # services in admin context through the OpenStack Identity service.
  97. # Use neutron_project_name instead.
  98. #
  99. # [*neutron_admin_username*]
  100. # (optional) DEPRECATED. Username for connecting to Neutron network services
  101. # in admin context through the OpenStack Identity service.
  102. # Use neutron_username instead.
  103. #
  104. # [*neutron_admin_auth_url*]
  105. # (optional) DEPRECATED. Points to the OpenStack Identity server IP and port.
  106. # This is the Identity (keystone) admin API server IP and port value,
  107. # and not the Identity service API IP and port.
  108. # Use neutron_auth_url instead.
  109. #
  110. # [*neutron_default_tenant_id*]
  111. # (optional) DEPRECATED. Default tenant id when creating neutron networks
  112. #
  113. # [*neutron_auth_plugin*]
  114. # Name of the plugin to load (string value)
  115. # Defaults to undef
  116. #
  117. # [*neutron_ca_certificates_file*]
  118. # (optional) Location of ca certicates file to use for neutronclient requests.
  119. # Defaults to undef
  120. #
  121. class nova::network::neutron (
  122. $neutron_password = false,
  123. $neutron_auth_type = 'v3password',
  124. $neutron_project_name = 'services',
  125. $neutron_project_domain_name = 'Default',
  126. $neutron_username = 'neutron',
  127. $neutron_user_domain_name = 'Default',
  128. $neutron_auth_url = 'http://127.0.0.1:35357/v3',
  129. $neutron_url = 'http://127.0.0.1:9696',
  130. $neutron_url_timeout = '30',
  131. $neutron_region_name = 'RegionOne',
  132. $neutron_ovs_bridge = 'br-int',
  133. $neutron_extension_sync_interval = '600',
  134. $firewall_driver = 'nova.virt.firewall.NoopFirewallDriver',
  135. $vif_plugging_is_fatal = true,
  136. $vif_plugging_timeout = '300',
  137. $dhcp_domain = 'novalocal',
  138. # DEPRECATED PARAMETERS
  139. $neutron_admin_password = false,
  140. $neutron_auth_strategy = undef,
  141. $neutron_admin_tenant_name = undef,
  142. $neutron_admin_username = undef,
  143. $neutron_admin_auth_url = undef,
  144. $neutron_default_tenant_id = undef,
  145. $neutron_auth_plugin = undef,
  146. $neutron_ca_certificates_file = undef,
  147. ) {
  148. include ::nova::deps
  149. # neutron_admin params removed in Mitaka
  150. if $neutron_password {
  151. $neutron_password_real = $neutron_password
  152. } else {
  153. if $neutron_admin_password {
  154. warning('neutron_admin_password is deprecated. Use neutron_password')
  155. $neutron_password_real = $neutron_admin_password
  156. } else {
  157. fail('neutron_password is required')
  158. }
  159. }
  160. # neutron_auth_plugin deprecated in Newton
  161. if $neutron_auth_plugin {
  162. warning('neutron_auth_plugin parameter is deprecated and will be removed in a future release, use neutron_auth_type instead.')
  163. $neutron_auth_type_real = $neutron_auth_plugin
  164. } else {
  165. $neutron_auth_type_real = $neutron_auth_type
  166. }
  167. if $neutron_admin_tenant_name {
  168. warning('neutron_admin_tenant_name is deprecated. Use neutron_project_name')
  169. $neutron_project_name_real = $neutron_admin_tenant_name
  170. } else {
  171. $neutron_project_name_real = $neutron_project_name
  172. }
  173. if $neutron_admin_username {
  174. warning('neutron_admin_username is deprecated. Use neutron_username')
  175. $neutron_username_real = $neutron_admin_username
  176. } else {
  177. $neutron_username_real = $neutron_username
  178. }
  179. if $neutron_admin_auth_url {
  180. warning('neutron_admin_auth_url is deprecated. Use neutron_auth_url')
  181. $neutron_auth_url_real = $neutron_admin_auth_url
  182. } else {
  183. $neutron_auth_url_real = $neutron_auth_url
  184. }
  185. # neutron_auth_strategy removed in Mitaka
  186. if $neutron_auth_strategy {
  187. warning('neutron_auth_strategy is deprecated')
  188. }
  189. nova_config {
  190. 'neutron/auth_strategy': ensure => absent;
  191. }
  192. # neutron_default_tenant_id removed in Mitaka
  193. # the parameter is deprecated but still can be used if needed
  194. if $neutron_default_tenant_id {
  195. warning('neutron_default_tenant_id is deprecated')
  196. nova_config {
  197. 'neutron/default_tenant_id': value => $neutron_default_tenant_id;
  198. }
  199. } else {
  200. nova_config {
  201. 'neutron/default_tenant_id': ensure => absent;
  202. }
  203. }
  204. nova_config {
  205. 'DEFAULT/dhcp_domain': value => $dhcp_domain;
  206. 'DEFAULT/firewall_driver': value => $firewall_driver;
  207. 'DEFAULT/vif_plugging_is_fatal': value => $vif_plugging_is_fatal;
  208. 'DEFAULT/vif_plugging_timeout': value => $vif_plugging_timeout;
  209. 'DEFAULT/use_neutron': value => true;
  210. 'neutron/url': value => $neutron_url;
  211. 'neutron/timeout': value => $neutron_url_timeout;
  212. 'neutron/project_name': value => $neutron_project_name_real;
  213. 'neutron/project_domain_name': value => $neutron_project_domain_name;
  214. 'neutron/region_name': value => $neutron_region_name;
  215. 'neutron/username': value => $neutron_username_real;
  216. 'neutron/user_domain_name': value => $neutron_user_domain_name;
  217. 'neutron/password': value => $neutron_password_real, secret => true;
  218. 'neutron/auth_url': value => $neutron_auth_url_real;
  219. 'neutron/ovs_bridge': value => $neutron_ovs_bridge;
  220. 'neutron/extension_sync_interval': value => $neutron_extension_sync_interval;
  221. 'neutron/auth_type': value => $neutron_auth_type_real;
  222. }
  223. if $neutron_ca_certificates_file {
  224. warning('neutron_ca_certificates_file parameter is deprecated, has no effect and will be dropped in a future release.')
  225. }
  226. }