119 Commits

Author SHA1 Message Date
Jenkins
92230f17da Merge "Neutron parses the wrong json revert to shell/csv." 2016-01-18 13:27:32 +00:00
Martin Mágr
567d41a349 LBaaSv2 support
This patch adds class for modifying LBaaS configuration in neutron_lbaas.conf

Depends-On: I619de3038cd2690bebe47cd601c085692506ac3d
Change-Id: I95cf32c3211bc4498eaa68e6e748a27dfd9af0fa
2016-01-14 10:23:21 +01:00
Mike Dorman
1d354007be Do not manage network, subnet, router resources if prefetch fails
If prefetch of neutron_network, neutron_subnet, or neutron_router
resources fails (because of Neutron API timeouts or failures, for
example) then the provider will believe the resources don't exist
and will attempt to create them.  This can cause duplicate
resources in Neutron.

This patch records when the prefetch fails, and if so, shunts
any of the resource management methods to fail().

Change-Id: I612847bfd23ac735583ab228d8a9396f52f0ef14
Closes-bug: 1532284
2016-01-10 11:59:24 -07:00
Mike Dorman
023292b59c Rename admin_state_up method to avoid conflict with accessor
The admin_state_up(value) method conflicts with the accessor method
for the admin_state_up resource parameter.  This patch renames
it to set_admin_state_up(value) to avoid this conflict.

Change-Id: I5a1e23c1541d7ed815ea37f1972abc345e2ba984
Closes-bug: 1532282
2016-01-08 10:52:07 -07:00
Sofer Athlan-Guyot
273ef1b228 Neutron parses the wrong json revert to shell/csv.
The neutron network provider is parsing the wrong json format leading
to an error when you're unlucky. Affected providers:
 - neutron_port
 - neutron_subnet
 - neutron_router
 - neutron_network

The neutron provider parses the json of the cliff-tablib's output while
the official one is the cliff' output[1].

As discussed in the ML[2] this patch implements a simple revert of the
json change.

Revert "Use json output instead plain-text"

This reverts commit 79f0e636c07b80b2c6699d934b42641bfef4352b[3]
 and part of commit 791a0f146b28544ec3d70c0ab2a950c4d5ca9f98[4]

[1]: https://bugs.launchpad.net/python-neutronclient/+bug/1529914
[2]: http://lists.openstack.org/pipermail/openstack-dev/2015-December/083172.html
[3]: https://review.openstack.org/#/c/238156/
[4]: https://review.openstack.org/#/c/261418/

Change-Id: I93263256eb9d83544910ca4055bb3e9a463645e3
Closes-bug: 1530163
2016-01-05 20:23:04 +01:00
Charlie Brown
791a0f146b provider/neutron.rb: fix list_router_ports
The json output of neutron router-interface-list may contain an
an empty 'fixed_ips' field for a port, but JSON.parse does not
work with empty strings. A check is added to ensure that empty
'fixed_ips' fields are directly removed.

Change-Id: Ie130e1c0b9b8fbbfc679ce0c8b5320226249617f
2015-12-25 20:27:27 +08:00
Sergey Kolekonov
fd4ba5f9f3 Add 'ha' parameter for neutron_router
'ha' parameter allows user to set the router's type to HA or not.
If this parameter is not specified, neutron will use default value, which
depends on whether L3 HA is enabled or not.

Change-Id: I74a5e8482b5e0019e101f78ee9eafb964cf57810
2015-12-21 19:09:33 +03:00
Andrey Shestakov
49393ab193 Add 'distributed' parameter for neutron_router
'distributed' parameter allows user to set this router distributed or not.
If this parameter not specified, neutron will use default value, which
depends on DVR enabled or not.

Change-Id: I62bf006d51d7607f4b64a5ba05fe600c3573480a
2015-12-14 10:08:50 +00:00
Jenkins
35c72935b5 Merge "Swap Facter[].value with Facter.value()" 2015-11-18 01:22:24 +00:00
Alex Schultz
e7487aff3d Add workaround for v2 tenant names
The change (https://review.openstack.org/#/c/226919/) to the naming
convention for keystone tenants has introduced an issue with some
neutron providers as they are no longer able to find the v2 named
tenants since the name returned from the keystone provider now
also includes the domain. This change adds a check to see if the name
matches the Default domain applied by default until support for a
resource without the domain set is removed.

Change-Id: I4c5b6b2b663a1d08005369fa755ac03b0603102b
Closes-Bug: #1515787
2015-11-13 08:37:06 -06:00
Cody Herriges
dff00fb54a Swap Facter[].value with Facter.value()
This commit swaps out the usage of Facter['operatingsystem'].value
  with Facter.value(:operatingsystem) in all neutron providers that
  use the array method on a ruby module style syntax.

  This commit doesn't actually fix anything that is broken just
  implements a specific syntax to keep consistency across Puppet
  OpenStack modules.

  https://review.openstack.org/#/c/243849
  https://review.openstack.org/#/c/243854

Change-Id: I623f92a5071c4e61a614319ece08b9495d83ff59
2015-11-12 17:05:10 -08:00
Jenkins
25eb87f6be Merge "Split SR-IOV configuration file into driver and agent pieces" 2015-11-12 13:05:29 +00:00
Jenkins
1d56bf1fa9 Merge "Support for Nuage Neutron plugin in puppet-neutron" 2015-11-12 10:32:52 +00:00
Sergey Vasilenko
79f0e636c0 Use json output instead plain-text
Openstack CLI utilities can return warning messages while
run to stderr. It's a normal behavior for Openstack CLI.
But Puppet mixs stderr and stdout for commands.

For preventing parsing warning messages,
I propose got response from Neutron CLI as JSON if it required
and parse it by ruby JSON parser.

JSON is a more usable format for interprocess communication,
than plain-text or CSV.

Change-Id: Iba1105bc119272715fa211ac129a366fe50cbf47
Closes-bug: #1508511
2015-11-10 23:41:18 +03:00
Ramkumar Gowrishankar
d4340331aa Support for Nuage Neutron plugin in puppet-neutron
* manifests/plugins/nuage.pp
  ** Nuage Neutron plugin is a monolithic Neutron plugin (core_plugin in
     neutron.conf can be set to nuage).
  ** The plugin.ini file for the Nuage Neutron plugin needs to be created
     with correct properties for the Neutron service to come up
     (configured in manifests/plugins/nuage.pp).
  ** To add the configuration parameters to the plugin.ini file a custom
     resource type has been created (neutron_plugins_nuage).
* init.pp
  ** Just comment addition that core_plugin=nuage is now supported
     by puppet-neutron
* params.pp
  ** Parameterizing names of Nuage Neutron Plugin
     (pattern based on existing midonet code)
* config.pp
  ** Call to create_resource similar to other plugins
* Spec tests
  ** spec tests for the plugin/nuage.pp

The associated spec tests and custom types and providers
have also been added. This follows the same pattern as other plugins
such as midonet and opencontrail.

Change-Id: I0f092bf437739cac0b328822022e932fe5d1c6f2
2015-11-10 13:49:46 -05:00
Jenkins
df5bb97ba9 Merge "Use json instead of regexp to parse subnet data" 2015-10-19 16:36:28 +00:00
Lukas Bezdicka
919a3a932e Drop nova_admin_tenant_id_setter
Neutron now has two options nova_admin_tenant_id and nova_admin_tenant_name.
One can just simply specify name of the nova admin tenant instead of probing
the api to get tenant id.

Change-Id: I21dc10396e92906eab4651c318aa2ee62a8e03c7
2015-10-19 16:12:19 +02:00
Dmitry Borodaenko
c0481d3020 Use json instead of regexp to parse subnet data
The order of name/value pairs in the json string for allocation pools
and host routes is not guaranteed, and when it comes in a different
order from what the regular expression expects, it doesn't match and
causes the method to throw an unhandled exception when attempting to
extract values from matchdata.

Change-Id: I80dec4019a51943f0e04fcbb3be193b4a8d77745
2015-10-16 17:26:41 -07:00
Ivan Chavero
8f7f334999 Split SR-IOV configuration file into driver and agent pieces
On Liberty the configuration files for SR-IOV split into agent and
driver, also they are now stored on a specific directory.

Change-Id: I8d4e2fda6beb1d7dac77fa1fbb9bbbbe3432a3ef
2015-10-12 12:58:30 -05:00
Colleen Murphy
1398b8b7b7 Map allocation_pool property to set
If the user specifies an array of more than one allocation pool for the
neutron_subnet allocation_pool parameter, the order of the pools is not
guaranteed. On sequential puppet runs, puppet may error with "Property
allocation_pools does not support being updated" because the array is
read in a different order. To avoid this, define the insync? method to
compare the values as though they were unordered sets rather than
ordered lists.

Change-Id: I9c146b5abe563c7e6ebfed169e770ffe8e5cf94b
2015-09-21 21:16:11 -07:00
Yanis Guenane
e956eba829 Reflect provider change in puppet-openstacklib
With the creation of the new openstack_config provider, some processing
that was done in neutron_config has been centralized in
openstack_config.

The same logic applies for all the neutron resources that edit a
ini-like configuration file.

Impacted methods are :

  * section
  * setting
  * separator

Also, this commit adds the fact that, when passing a specific string
(ensure_absent_val) the provider will behave as if ensure => absent was
specified. '<SERVICE DEFAULT>' is the default value for
ensure_absent_val.

The use case is the following :

neutron_config { 'DEFAULT/foo' : value => 'bar' } # will work as usual

neutron_config { 'DEFAULT/foo' : value => '<SERVICE DEFAULT>' } # will mean absent

That means that all the current :

if $myvar {
  neutron_config { 'DEFAULT/foo' : value => $myvar }
} else {
  neutron_config { 'DEFAULT/foo' : ensure => absent }
}

can be removed in favor of :

neutron_config { 'DEFAULT/foo' : value => $myvar }

If for any reason '<SERVICE DEFAULT>' turns out to be a valid value for
a specific parameter. One could by pass that doing the following :

neutron_config { 'DEFAULT/foo' : value => '<SERVICE DEFAULT>',
ensure_absent_val => 'foo' }

Change-Id: I3f972ecbde3719fe71a82a64f894d41f6ea7e842
Depends-On: I0eeebde3aac2662cc7e69bfad7f8d2481463a218
2015-09-09 09:36:27 +02:00
Jenkins
dd3432bbc7 Merge "Use strip for nova_region_name" 2015-09-08 15:17:11 +00:00
Jenkins
2551810e8a Merge "Fix neutron_agent_linuxbridge file path" 2015-09-08 13:05:53 +00:00
Yanis Guenane
2c21af85da Rely on autorequire for config resource ordering
Currently we specify the ordering of config resources wherever it is
necessary based on the presence of the file it will write to, or the
presence of the package in charge of providing the file it will write
to.

Those kind of ordering can be specified directly at the resource level
using the autorequire mechanism. With this patch, any config resource
will make sure the package in charge of providing the file will be
installed first.

Change-Id: I5542165142516fcd8fd3969c24ca92ac221452bd
2015-09-07 12:59:06 +02:00
Sergey Kolekonov
4c8f960b16 Use strip for nova_region_name
If neutron.conf file contains some value for nova_region_name before Puppet
execution, if will keep whitespaces from the original value.
Later this value can be passed to neutron_network provider, for example,
which won't authorize at Keystone due to a whitespace in nova_region_name.

Change-Id: I9eddcc3fb2e8224bb541abbb6dd1e770ca5ef76c
2015-09-04 17:53:39 +03:00
Colleen Murphy
d465022f42 Fix neutron_agent_linuxbridge file path
Like the ML2 OpenVSwitch agent, the ML2 LinuxBridge agent defines its
config in ml2_conf.ini on Ubuntu. This patch updates the
neutron_agent_linuxbridge provider to behave the same as the
neutron_agent_ovs provider.

Closes-Bug: #1480277

Change-Id: I24462f9d04a07926c05790b80ed5f0064fcef97d
2015-09-02 19:57:44 +00:00
Sergey Kolekonov
f4a0f2aa66 Fix 'shared' parameter check in neutron_network provider
Use stricter check for 'shared' parameter

Change-Id: I36149b42943238dc342f8c6e71c1261f00e01c4a
Closes-bug: #1476680
2015-08-29 23:01:42 +03:00
Jenkins
0143e4721f Merge "Prepare Liberty release" 2015-08-18 21:44:05 +00:00
Emilien Macchi
737135ef49 Prepare Liberty release
Two patches in the same review, because they come together.

1) Upgrade acceptance manifest from Kilo (stable) to Liberty (dev)
on both Ubuntu Trusty & Centos7.

Also:
2) Support for configuring openvswitch_agent.ini Upstream Liberty Neutron
now uses ml2/openvswitch_agent.ini to configure the neutron ML2 agent
instead of openvswitch/ovs_neutron_plugin.ini. This patch updates all
resources that configured the old file to use the newer version. This is
required since neutron If6feca7b7a6bdd6c3c6feb929fa26fb4b1f72770 and
should fix issues using puppet-neutron with the latest upstream
packages.

Depends-On: I7c1f31b3cc4c6ea1f894a263a8cff60e357accb8
Change-Id: If9fae3c83d606cb528f69ff54a28c046e0f7cc49
Co-Authored-By: Lukas Bezdicka <lbezdick@redhat.com>
Co-Authored-By: Dan Prince <dprince@redhat.com>
2015-08-14 23:38:08 +00:00
Emilien Macchi
09961314b8 drop neutron_plugin_ovs type/provider
In Kilo, we removed Neutron OVS plugin because it was dropped in Juno in
favor of using ML2 plugin.

We missed to drop the neutron_plugin_ovs type/provider in the patch and
this is what this patch aims about.

Change-Id: Ic9addc51de43ec67db4835072be61e1306281611
2015-08-07 11:52:06 -04:00
Jenkins
6e786883de Merge "Fix parsing of network gateway id for router" 2015-07-08 15:22:23 +00:00
Cody Herriges
32ca5213d5 Include tests that test the use of create.
This commit will add new tests for neutron providers that have the
  create method.  Includes a fix to the Puppet::Provider::Neutron_subnet
  which was parsing host_routes backwards and replaces the use of the
  model method with @resource.

  Without this we are not successfully testing for methods removed in the
  Puppet 3 to 4 transition.

Co-Authored-By: Lukas Bezdicka <social@v3.sk>
Change-Id: I82382b9f9da7db6910a3d9b5c7060c3f03473585
Close-Bug: #1466555
2015-06-30 22:57:42 +00:00
Yanis Guenane
183541d389 Opencontrail: Create neutron::plugins::opencontrail
Create the neutron::plugins::opencontrail class that allows one to
configure neutron to work with opencontrail. The parameters have been
taken from here[1]

[1]
https://github.com/Juniper/contrail-neutron-plugin/blob/master/etc/neutron/plugins/opencontrail/ContrailPlugin.ini

Change-Id: I080c4aed23ebde320e67c98c44171b18bf2758ad
2015-06-23 08:22:45 +02:00
Colleen Murphy
7dc6dd0e71 Fix parsing of network gateway id for router
The neutron router-show command with shell formating outputs the
external_gateway_info with literal backslashes to escape the double
quotes. The provider must then match against the literal slashes when
extracting the gateway id. If this is not done, the provider cannot
detect the gateway id from the external_gateway_info property and will
always attempt to change the gateway name from '' to the desired name.

Change-Id: I85a18ed08886cebd14f61b65b3681a75a8d41741
2015-06-18 12:45:27 +02:00
Jenkins
b90e0efc51 Merge "Fix support for auth_uri setting in neutron provider" 2015-06-09 15:29:18 +00:00
David Moreau Simard
340186e2ed Fix avalaible/available typo
Change-Id: I19a38f6bd26a6a47b5772799c8024872e6d7bbff
2015-05-15 15:23:00 -04:00
Lukas Bezdicka
6fb01efe21 Fix support for auth_uri setting in neutron provider
Neutron provider still uses auth_port and auth_host config
options even though those are now deprecated and won't be set
if someone chooses to use auth_uri. This commit adds support
for auth_uri and keeps the provider backwards compatible.


Change-Id: I4824c09e6af4a800b5ac0c22bf5daea99452bd7e
2015-05-14 11:46:36 +00:00
Lukas Bezdicka
b29ee6f706 Fix neutron_network for --router:external setting
Neutron can't be called with --router:external=True as that
will cause "ignored explicit argument u'True'" error.

Change-Id: I49a033fd2821100283e217225896fc93a927edd2
2015-05-11 11:06:57 +02:00
Jenkins
a553fe4213 Merge "Linuxbridge Agent with ML2: switch provider" 2015-04-29 17:44:49 +00:00
Emilien Macchi
65fd4f3017 Linuxbridge Agent with ML2: switch provider
Like we did in OVS agent when running ML2 plugin, we need to:
* use neutron_agent_linuxbridge provider to configure the right config file.

Closes-bug: #1426080
Change-Id: Icf7391563dbfcafb788d23b0367fba810a90fb48
2015-04-29 18:49:43 +02:00
salmank
4ff68894b3 Add PLUMgrid plugin support.
Define the resources to configure PLUMgrid plugin with Neutron.

Change-Id: Ifcdc5eb05457f27de947347237dd1f6fd781f46b
2015-04-27 13:49:07 +01:00
Jenkins
5d10eaaf09 Merge "Make retry message more descriptive" 2015-04-23 04:07:41 +00:00
Colleen Murphy
2c695f64a0 Make retry message more descriptive
When neutron fails the neutron client is often very helpful in
describing the issue. This message should not be hidden in a debug
statement, we should be able to see it easily since it is often easy to
fix. This patch removes the debug output and puts the error message in
the notice.

Change-Id: Ic7769ba463bca22af8c5b1ebc9c43e2b25a0ca99
2015-04-21 17:06:44 -07:00
Jenkins
62c1d86c67 Merge "Rename handle_request to neutron_handle_request" 2015-04-21 20:47:56 +00:00
Emilien Macchi
ccccfb97ed Rename handle_request to neutron_handle_request
To avoid a future colision with other modules, we rename the
handle_request method with a prefix (module name).

Same patch in puppet-heat: https://review.openstack.org/#/c/162292/
Closes-bug: #1429096

Change-Id: If477dd15b1ffeb957481494a1da0b3e8ab29e299
2015-04-14 17:42:54 -04:00
Gael Chamoulaud
48ae3df855 Configure OVS mechanism agent configs in its config file
Configurations for the OVS agent should go in its config file:
/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
but as packaging is broken and different in Ubuntu and Redhat
we have to use new neutron_agent_ovs provider to configure
ovs agent correctly.

Therefore, we should not remove the agent config file and
replace it with a symlink to plugin.ini or ml2_conf.ini.

Those config files are meant to be used by the core plugin itself
in neutron-server, not the agents themselves.

- Remove symlink creation from ovs_neutron_plugin.ini to plugin.ini
- Use neutron_agent_ovs to configure OVS mechanism agent configs

Change-Id: I53d9b923784587e8a2a934f004a3b054c716daaa
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-04-14 06:57:40 +02:00
Jenkins
30ec788d36 Merge "Reduce neutron API timeout to 10 seconds" 2015-04-11 01:42:15 +00:00
Jenkins
b26e3bcfac Merge "provide explicit defaults for boolean values" 2015-04-10 12:43:18 +00:00
Colleen Murphy
26f1ae6996 Reduce neutron API timeout to 10 seconds
If the neutron server is down, 120 seconds is far too long to wait for
puppet to fail. This patch reduces the timeout to 10 seconds because if
the neutron server is flaky, but not down, 10 seconds is a reasonable
amount of time to retry connecting.

Change-Id: I7bd694d1e5ee3477f7ea862965f7f3368903abde
2015-04-01 16:46:10 -07:00
Jenkins
823de0c414 Merge "Fix ipv6 support" 2015-03-30 18:54:46 +00:00